kumquat-buildroot/package/flatbuffers/flatbuffers.mk
James Hilliard 730e50f520 package/flatbuffers: build position independent code
The upcoming tensorflow-lite package requires flatbuffers to be
built with position independent code.

Fixes:
/home/buildroot/buildroot/output/per-package/tensorflow-lite/host/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /home/buildroot/buildroot/output/per-package/tensorflow-lite/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libflatbuffers.a(util.cpp.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZN11flatbuffers11CharToUpperEc' which may bind externally can not be used when making a shared object; recompile with -fPIC

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2023-01-29 21:54:28 +01:00

38 lines
1.1 KiB
Makefile

################################################################################
#
# flatbuffers
#
################################################################################
FLATBUFFERS_VERSION = 2.0.8
FLATBUFFERS_SITE = $(call github,google,flatbuffers,v$(FLATBUFFERS_VERSION))
FLATBUFFERS_LICENSE = Apache-2.0
FLATBUFFERS_LICENSE_FILES = LICENSE.txt
FLATBUFFERS_CPE_ID_VENDOR = google
FLATBUFFERS_INSTALL_STAGING = YES
FLATBUFFERS_DEPENDENCIES = host-flatbuffers
FLATBUFFERS_CONF_OPTS += \
-DCMAKE_CXX_FLAGS="-std=c++11" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DFLATBUFFERS_FLATC_EXECUTABLE=$(HOST_DIR)/bin/flatc
ifeq ($(BR2_STATIC_LIBS),y)
FLATBUFFERS_CONF_OPTS += -DFLATBUFFERS_BUILD_SHAREDLIB=OFF
else
FLATBUFFERS_CONF_OPTS += -DFLATBUFFERS_BUILD_SHAREDLIB=ON
endif
HOST_FLATBUFFERS_CONF_OPTS += \
-DCMAKE_CXX_FLAGS="-std=c++11" \
-DFLATBUFFERS_BUILD_FLATLIB=OFF \
-DFLATBUFFERS_BUILD_FLATC=ON \
-DFLATBUFFERS_BUILD_FLATHASH=OFF \
-DFLATBUFFERS_BUILD_GRPCTEST=OFF \
-DFLATBUFFERS_BUILD_SHAREDLIB=OFF \
-DFLATBUFFERS_BUILD_TESTS=OFF
$(eval $(cmake-package))
$(eval $(host-cmake-package))