diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-03-27 11:41:00 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-03-27 13:08:32 +0100 |
commit | 219a880d591852d45f8a25b38b269bda98e4a06f (patch) | |
tree | a30ff865916e1000e030ec42bd0f8db00d3fd8fe /patches | |
parent | 866fae6c76146762cf3e9a233f8a16ac08d7d28d (diff) | |
download | ptxdist-219a880d591852d45f8a25b38b269bda98e4a06f.tar.gz ptxdist-219a880d591852d45f8a25b38b269bda98e4a06f.tar.xz |
nodejs: fix cross-compiling for the same architecture
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches')
-rw-r--r-- | patches/node-v12.16.1/0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch | 44 | ||||
-rw-r--r-- | patches/node-v12.16.1/series | 3 |
2 files changed, 46 insertions, 1 deletions
diff --git a/patches/node-v12.16.1/0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch b/patches/node-v12.16.1/0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch new file mode 100644 index 000000000..121bba28b --- /dev/null +++ b/patches/node-v12.16.1/0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch @@ -0,0 +1,44 @@ +From: Michael Olbrich <m.olbrich@pengutronix.de> +Date: Fri, 27 Mar 2020 11:32:01 +0100 +Subject: [PATCH] HACK: don't add LD_LIBRARY_PATH for external tools + +When host and target architecture match, then the target path in +LD_LIBRARY_PATH confuses the linker and the wrong libraries are used. +As a result executing the tool fails. +Always removing the target path from LD_LIBRARY_PATH is not an options +because in this case building host-nodejs fails with a missing library. + +In PTXdist we overwrite the path to the tool to point to sysroot-host when +building the target nodejs. We can use that to set the LD_LIBRARY_PATH only +for host-nodejs. + +Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> +--- + tools/gyp/pylib/gyp/generator/make.py | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py +index c109b2b488ec..995f6df0f441 100644 +--- a/tools/gyp/pylib/gyp/generator/make.py ++++ b/tools/gyp/pylib/gyp/generator/make.py +@@ -923,11 +923,15 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD + # libraries, but until everything is made cross-compile safe, also use + # target libraries. + # TODO(piman): when everything is cross-compile safe, remove lib.target +- self.WriteLn('cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:' +- '$(builddir)/lib.target:$$LD_LIBRARY_PATH; ' +- 'export LD_LIBRARY_PATH; ' +- '%s%s' +- % (name, cd_action, command)) ++ if action['action'][0].startswith('$(builddir)'): ++ self.WriteLn('cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:' ++ '$(builddir)/lib.target:$$LD_LIBRARY_PATH; ' ++ 'export LD_LIBRARY_PATH; ' ++ '%s%s' ++ % (name, cd_action, command)) ++ else: ++ self.WriteLn('cmd_%s = %s%s' ++ % (name, cd_action, command)) + self.WriteLn() + outputs = [self.Absolutify(o) for o in outputs] + # The makefile rules are all relative to the top dir, but the gyp actions diff --git a/patches/node-v12.16.1/series b/patches/node-v12.16.1/series index f86c12166..706723222 100644 --- a/patches/node-v12.16.1/series +++ b/patches/node-v12.16.1/series @@ -3,4 +3,5 @@ 0001-Disable-running-gyp-on-shared-deps.patch 0002-Install-both-binaries-and-use-libdir.patch 0003-tools-do-not-explicitely-set-an-rpath-in-make-genera.patch -# b4f94a5ae9905853dec0da236e8ee053 - git-ptx-patches magic +0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch +# 54ccf86e2c772cc50a5febf46b50b9c9 - git-ptx-patches magic |