Skip to contentSkip to conversation

mozjs: Pass C/C++ flags to js configure

PATCH New Khem Raj 1 participant 1 message Nov 2, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 mozjs: Pass C/C++ flags to js configure

On mips ensure -fpie is passed when using clang compiler, this fixes configure issues e.g.

/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/mozjs-78/78.15.0-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: non-dynamic relocations refer to dynamic symbol localtime_r@@GLIBC_2.0 /mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/mozjs-78/78.15.0-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: failed to set dynamic section sizes: bad value

---
 .../meta-python/recipes-extended/mozjs/mozjs-78_78.15.0.bb   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs-78_78.15.0.bb +4 -1
index 090c2fe058..61c5861153 100644
@@ -91,6 +91,9 @@ export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
 # otherwise we are asked for yasm...
 export AS = "${CC}"
 
+CPPFLAGS:append:mips:toolchain-clang = " -fpie"
+CPPFLAGS:append:mipsel:toolchain-clang = " -fpie"
+
 do_configure() {
     prepare_python_and_rust
 
@@ -102,7 +105,7 @@ do_configure() {
     # * with mozjs-78 we get without:
     # | Path specified in LOCAL_INCLUDES (..) resolves to the topsrcdir or topobjdir (<tmpdir>/oe-core-glibc/work/cortexa72-mortsgna-linux/mozjs-78/78.15.0-r0/firefox-78.15.0/js/src), which is not allowed
     mkdir -p "${B}/lcl_tmp"
-    TMPDIR="${B}/lcl_tmp"  ${S}/js/src/configure ${EXTRA_OECONF}
+    TMPDIR="${B}/lcl_tmp"  CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" ${S}/js/src/configure ${EXTRA_OECONF}
 
     # inspired by what fedora [1] does: for big endian rebuild icu dat
     # this avoids gjs qemu crash on mips at gir creation
Signature · 1 line
2.33.1