diff options
author | Ivan Trubach <mr.trubach@icloud.com> | 2023-06-16 08:55:13 +0300 |
---|---|---|
committer | Ivan Trubach <mr.trubach@icloud.com> | 2023-08-28 12:16:30 +0300 |
commit | 3751f6abb015d6141f33acd82ef7a55e76a02217 (patch) | |
tree | a5366d42564c49f123e4dae1aad5db7ac7d217e3 /pkgs/development/web/nodejs/common-gypi-cross.patch | |
parent | deb5cc6dc8a300ef9d64252445329f288869440e (diff) |
nodejs_{18,20}: fix cross compilation from aarch64-linux
This change adds a fix for Node.js build system passing flags intended for the target toolchain to the host toolchain.
Diffstat (limited to 'pkgs/development/web/nodejs/common-gypi-cross.patch')
-rw-r--r-- | pkgs/development/web/nodejs/common-gypi-cross.patch | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/pkgs/development/web/nodejs/common-gypi-cross.patch b/pkgs/development/web/nodejs/common-gypi-cross.patch new file mode 100644 index 0000000000000..00bc7d7d2febe --- /dev/null +++ b/pkgs/development/web/nodejs/common-gypi-cross.patch @@ -0,0 +1,84 @@ +Fixes target toolchain arguments being passed to the host toolchain when +cross-compiling. For example, -m64 is not available on aarch64. + +diff --git a/common.gypi b/common.gypi +index 3161adbe09..08983f589c 100644 +--- a/common.gypi ++++ b/common.gypi +@@ -411,28 +411,56 @@ + 'cflags': [ '-I/usr/local/include' ], + 'ldflags': [ '-Wl,-z,wxneeded' ], + }], +- ], +- 'conditions': [ +- [ 'target_arch=="ia32"', { +- 'cflags': [ '-m32' ], +- 'ldflags': [ '-m32' ], +- }], +- [ 'target_arch=="x64"', { +- 'cflags': [ '-m64' ], +- 'ldflags': [ '-m64' ], +- }], +- [ 'target_arch=="ppc" and OS not in "aix os400"', { +- 'cflags': [ '-m32' ], +- 'ldflags': [ '-m32' ], +- }], +- [ 'target_arch=="ppc64" and OS not in "aix os400"', { +- 'cflags': [ '-m64', '-mminimal-toc' ], +- 'ldflags': [ '-m64' ], ++ ['_toolset=="host"', { ++ 'conditions': [ ++ [ 'host_arch=="ia32"', { ++ 'cflags': [ '-m32' ], ++ 'ldflags': [ '-m32' ], ++ }], ++ [ 'host_arch=="x64"', { ++ 'cflags': [ '-m64' ], ++ 'ldflags': [ '-m64' ], ++ }], ++ [ 'host_arch=="ppc" and OS not in "aix os400"', { ++ 'cflags': [ '-m32' ], ++ 'ldflags': [ '-m32' ], ++ }], ++ [ 'host_arch=="ppc64" and OS not in "aix os400"', { ++ 'cflags': [ '-m64', '-mminimal-toc' ], ++ 'ldflags': [ '-m64' ], ++ }], ++ [ 'host_arch=="s390x" and OS=="linux"', { ++ 'cflags': [ '-m64', '-march=z196' ], ++ 'ldflags': [ '-m64', '-march=z196' ], ++ }], ++ ], + }], +- [ 'target_arch=="s390x" and OS=="linux"', { +- 'cflags': [ '-m64', '-march=z196' ], +- 'ldflags': [ '-m64', '-march=z196' ], ++ ['_toolset=="target"', { ++ 'conditions': [ ++ [ 'target_arch=="ia32"', { ++ 'cflags': [ '-m32' ], ++ 'ldflags': [ '-m32' ], ++ }], ++ [ 'target_arch=="x64"', { ++ 'cflags': [ '-m64' ], ++ 'ldflags': [ '-m64' ], ++ }], ++ [ 'target_arch=="ppc" and OS not in "aix os400"', { ++ 'cflags': [ '-m32' ], ++ 'ldflags': [ '-m32' ], ++ }], ++ [ 'target_arch=="ppc64" and OS not in "aix os400"', { ++ 'cflags': [ '-m64', '-mminimal-toc' ], ++ 'ldflags': [ '-m64' ], ++ }], ++ [ 'target_arch=="s390x" and OS=="linux"', { ++ 'cflags': [ '-m64', '-march=z196' ], ++ 'ldflags': [ '-m64', '-march=z196' ], ++ }], ++ ], + }], ++ ], ++ 'conditions': [ + [ 'OS=="solaris"', { + 'cflags': [ '-pthreads' ], + 'ldflags': [ '-pthreads' ], |