Add -fno-lto for creating static library
authorSemun Lee <semun.lee@samsung.com>
Fri, 17 Jul 2020 09:27:47 +0000 (18:27 +0900)
committerGichan Jang <gichan2.jang@samsung.com>
Thu, 13 May 2021 02:42:22 +0000 (11:42 +0900)
When -flto option is used, static library doesn't contain
symbol names in it.
It may leads "undefined symbol" problem in some applications.

Change-Id: I3ab5f644b72e504d9390311e4ce945d9ac28527e
Signed-off-by: Semun Lee <semun.lee@samsung.com>
packaging/flatbuffers.spec

index 36debb7..4e1d495 100644 (file)
@@ -29,6 +29,9 @@ This package provides headers and other miscellaneous files required to use flat
 cp %{SOURCE1} .
 
 %build
+export CFLAGS+=" -fno-lto"
+export CXXFLAGS+=" -fno-lto"
+
 # flatbuffers build occasionally fails when using -j${BUILD_THREADS} with an error similar to:
 # /mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:17: error: 'MyGame' has not been declared
 # /mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:25: error: 'Sample' is not a namespace-name