diff options
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-devtools/nodejs')
3 files changed, 137 insertions, 27 deletions
diff --git a/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0006-Use-target-ldflags.patch b/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0006-Use-target-ldflags.patch deleted file mode 100644 index f6569cd57a..0000000000 --- a/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0006-Use-target-ldflags.patch +++ /dev/null @@ -1,24 +0,0 @@ -The target LDFLAGS have been ignored. Tools like torque -have been loaded from system libraries, even if a native -one was the target. -|$ ldd torque -| libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 -| libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 -| libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 -| libicui18n.so.63 => not found -| libicuuc.so.63 => not found -... - -Signed-off-by: Andrej Valek <andrej.valek@siemens.com> - -diff -Naur node-v10.15.1/deps/v8/gypfiles/toolchain.gypi node-v10.15.1/deps/v8/gypfiles/toolchain.gypi ---- node-v10.15.1/deps/v8/gypfiles/toolchain.gypi 2019-03-18 15:01:39.000000000 +0100 -+++ node-v10.15.1/deps/v8/gypfiles/toolchain.gypi 2019-03-18 15:04:08.628361308 +0100 -@@ -1106,6 +1106,7 @@ - 'cflags': [ '-fno-strict-aliasing' ], - }], - ], # conditions -+ 'ldflags+': [ '$(LDFLAGS)' ], - }], - ['OS=="solaris"', { - 'defines': [ '__C99FEATURES__=1' ], # isinf() etc. diff --git a/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0007-v8-don-t-override-ARM-CFLAGS.patch b/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0007-v8-don-t-override-ARM-CFLAGS.patch new file mode 100644 index 0000000000..eb2cbfb8b1 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0007-v8-don-t-override-ARM-CFLAGS.patch @@ -0,0 +1,102 @@ +From 47ee5cc5501289205d3e8e9f27ea9daf18cebac1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net> +Date: Sat, 9 Nov 2019 14:45:30 +0000 +Subject: [PATCH] v8: don't override ARM CFLAGS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This overrides yocto-provided build flags with its own, e.g we get + arm-poky-linux-musleabi-g++ -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 \ + ... \ + -march=armv7-a -mfpu=neon -mfloat-abi=hard -marm + +Causing the latter to override the former, and compiler warnings: + cc1plus: warning: switch '-mcpu=cortex-a7' conflicts with '-march=armv7-a' switch + +Patch this out, so that yocto-provided flags take precedence. +Note that in reality the same should probably be done for all the other +supported architectures, too. + +Note that this also switches to Thumb(2) mode (in my case). No obvious +problems have been noted during compilation or runtime. + +Upstream-Status: Inappropriate [oe-specific] +Signed-off-by: André Draszik <git@andred.net> +--- + deps/v8/gypfiles/toolchain.gypi | 52 ++------------------------------- + 1 file changed, 2 insertions(+), 50 deletions(-) + +diff --git a/deps/v8/gypfiles/toolchain.gypi b/deps/v8/gypfiles/toolchain.gypi +index 910a212..1390b15 100644 +--- a/deps/v8/gypfiles/toolchain.gypi ++++ b/deps/v8/gypfiles/toolchain.gypi +@@ -199,31 +199,7 @@ + 'target_conditions': [ + ['_toolset=="host"', { + 'conditions': [ +- ['v8_target_arch==host_arch', { +- # Host built with an Arm CXX compiler. +- 'conditions': [ +- [ 'arm_version==7', { +- 'cflags': ['-march=armv7-a',], +- }], +- [ 'arm_version==7 or arm_version=="default"', { +- 'conditions': [ +- [ 'arm_fpu!="default"', { +- 'cflags': ['-mfpu=<(arm_fpu)',], +- }], +- ], +- }], +- [ 'arm_float_abi!="default"', { +- 'cflags': ['-mfloat-abi=<(arm_float_abi)',], +- }], +- [ 'arm_thumb==1', { +- 'cflags': ['-mthumb',], +- }], +- [ 'arm_thumb==0', { +- 'cflags': ['-marm',], +- }], +- ], +- }, { +- # 'v8_target_arch!=host_arch' ++ ['v8_target_arch!=host_arch', { + # Host not built with an Arm CXX compiler (simulator build). + 'conditions': [ + [ 'arm_float_abi=="hard"', { +@@ -242,31 +218,7 @@ + }], # _toolset=="host" + ['_toolset=="target"', { + 'conditions': [ +- ['v8_target_arch==target_arch', { +- # Target built with an Arm CXX compiler. +- 'conditions': [ +- [ 'arm_version==7', { +- 'cflags': ['-march=armv7-a',], +- }], +- [ 'arm_version==7 or arm_version=="default"', { +- 'conditions': [ +- [ 'arm_fpu!="default"', { +- 'cflags': ['-mfpu=<(arm_fpu)',], +- }], +- ], +- }], +- [ 'arm_float_abi!="default"', { +- 'cflags': ['-mfloat-abi=<(arm_float_abi)',], +- }], +- [ 'arm_thumb==1', { +- 'cflags': ['-mthumb',], +- }], +- [ 'arm_thumb==0', { +- 'cflags': ['-marm',], +- }], +- ], +- }, { +- # 'v8_target_arch!=target_arch' ++ ['v8_target_arch!=target_arch', { + # Target not built with an Arm CXX compiler (simulator build). + 'conditions': [ + [ 'arm_float_abi=="hard"', { +-- +2.23.0.rc1 + diff --git a/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_10.17.0.bb b/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_10.17.0.bb index 4013c6931e..8c690ae7dc 100644 --- a/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_10.17.0.bb +++ b/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_10.17.0.bb @@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=be980eb7ccafe287cb438076a65e888c" DEPENDS = "openssl" DEPENDS_append_class-target = " nodejs-native" -inherit pkgconfig +inherit pkgconfig pythonnative COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*" COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*" @@ -19,7 +19,7 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ file://0001-Disable-running-gyp-files-for-bundled-deps.patch \ file://0004-Make-compatibility-with-gcc-4.8.patch \ file://0005-Link-atomic-library.patch \ - file://0006-Use-target-ldflags.patch \ + file://0007-v8-don-t-override-ARM-CFLAGS.patch \ " SRC_URI_append_class-target = " \ file://0002-Using-native-torque.patch \ @@ -53,14 +53,46 @@ ARCHFLAGS ?= "" PACKAGECONFIG ??= "ares icu libuv zlib" PACKAGECONFIG[ares] = "--shared-cares,,c-ares" +PACKAGECONFIG[gyp] = ",,gyp-py2-native" PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu" PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" PACKAGECONFIG[zlib] = "--shared-zlib,,zlib" +# We don't want to cross-compile during target compile, +# and we need to use the right flags during host compile, +# too. +EXTRA_OEMAKE = "\ + CC.host='${CC}' \ + CFLAGS.host='${CPPFLAGS} ${CFLAGS}' \ + CXX.host='${CXX}' \ + CXXFLAGS.host='${CPPFLAGS} ${CXXFLAGS}' \ + LDFLAGS.host='${LDFLAGS}' \ + AR.host='${AR}' \ + \ + builddir_name=./ \ +" + +python do_unpack() { + import shutil + + bb.build.exec_func('base_do_unpack', d) + + shutil.rmtree(d.getVar('S') + '/deps/openssl', True) + if 'ares' in d.getVar('PACKAGECONFIG'): + shutil.rmtree(d.getVar('S') + '/deps/cares', True) + if 'gyp' in d.getVar('PACKAGECONFIG'): + shutil.rmtree(d.getVar('S') + '/tools/gyp', True) + if 'libuv' in d.getVar('PACKAGECONFIG'): + shutil.rmtree(d.getVar('S') + '/deps/uv', True) + if 'nghttp2' in d.getVar('PACKAGECONFIG'): + shutil.rmtree(d.getVar('S') + '/deps/nghttp2', True) + if 'zlib' in d.getVar('PACKAGECONFIG'): + shutil.rmtree(d.getVar('S') + '/deps/zlib', True) +} + # Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi do_configure () { - rm -rf ${S}/deps/openssl export LD="${CXX}" GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES # $TARGET_ARCH settings don't match --dest-cpu settings |