summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-test/googletest
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2024-03-07 11:21:04 +0800
committerKhem Raj <raj.khem@gmail.com>2024-03-08 10:07:25 -0800
commitbe06d51d61361b4d09cd943fb0e6248089073bd5 (patch)
treef7dd34195c36b78b3757a61b05b5ec817d2e33b7 /meta-oe/recipes-test/googletest
parentbe21057c22d18b2625ba8d087030ebc16cc1cf83 (diff)
downloadmeta-openembedded-be06d51d61361b4d09cd943fb0e6248089073bd5.tar.gz
googletest: Pass -fPIC to CFLAGS
Fail to build re2 which depends on googletest as below: /build/tmp-glibc/work/core2-64-wrs-linux/re2/2024.03.01/recipe-sysroot-native/usr/bin/x86_64-wrs-linux/../../libexec/x86_64-wrs-linux/gcc/x86_64-wrs-linux/13.2.0/ld: /build/tmp-glibc/work/core2-64-wrs-linux/re2/2024.03.01/recipe-sysroot/usr/lib64/libgtest.a(gtest-all.cc.o): warning: relocation against `_ZTVN7testing8internal11MatcherBaseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE' in read-only section `.text._ZN7testing8internal11MatcherBaseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED0Ev[_ZN7testing8internal11MatcherBaseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED5Ev]' /build/tmp-glibc/work/core2-64-wrs-linux/re2/2024.03.01/recipe-sysroot-native/usr/bin/x86_64-wrs-linux/../../libexec/x86_64-wrs-linux/gcc/x86_64-wrs-linux/13.2.0/ld: /build/tmp-glibc/work/core2-64-wrs-linux/re2/2024.03.01/recipe-sysroot/usr/lib64/libgtest.a(gtest-all.cc.o): relocation R_X86_64_PC32 against symbol `_ZTVN7testing8internal17TestEventRepeaterE' can not be used when making a shared object; recompile with -fPIC /build/tmp-glibc/work/core2-64-wrs-linux/re2/2024.03.01/recipe-sysroot-native/usr/bin/x86_64-wrs-linux/../../libexec/x86_64-wrs-linux/gcc/x86_64-wrs-linux/13.2.0/ld: final link failed: bad value collect2: error: ld returned 1 exit status So pass -fPIC to fix the above issue. Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-test/googletest')
-rw-r--r--meta-oe/recipes-test/googletest/googletest_1.14.0.bb1
1 files changed, 1 insertions, 0 deletions
diff --git a/meta-oe/recipes-test/googletest/googletest_1.14.0.bb b/meta-oe/recipes-test/googletest/googletest_1.14.0.bb
index 1b05f3d33..4c9d1e709 100644
--- a/meta-oe/recipes-test/googletest/googletest_1.14.0.bb
+++ b/meta-oe/recipes-test/googletest/googletest_1.14.0.bb
@@ -16,6 +16,7 @@ inherit cmake pkgconfig
16# 16#
17PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,," 17PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,,"
18 18
19CXXFLAGS:append = " -fPIC"
19 20
20ALLOW_EMPTY:${PN} = "1" 21ALLOW_EMPTY:${PN} = "1"
21ALLOW_EMPTY:${PN}-dbg = "1" 22ALLOW_EMPTY:${PN}-dbg = "1"