Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node: can not compile on host debian11 amd64 #17496

Closed
svlobanov opened this issue Jan 4, 2022 · 6 comments
Closed

node: can not compile on host debian11 amd64 #17496

svlobanov opened this issue Jan 4, 2022 · 6 comments

Comments

@svlobanov
Copy link
Contributor

Maintainer: @nxhack
Environment: target: armvirt/64, OpenWrt version master 4a2cca7
host: debian11 amd64
packages version: b434cd7

Description:

node build failed on debian11 amd64 for armvirt/64 target

$ make -j1 package/feeds/packages/node/compile V=sc
...
/home/sergey/openwrt2/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/lib/gcc/aarch64-openwrt-linux-musl/11.2.0/../../../../aarch64-openwrt-linux-musl/bin/ld: /home/sergey/openwrt2/build_dir/target-aarch64_cortex-a53_musl/node-v14.18.2/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a: error adding symbols: malformed archive
collect2: error: ld returned 1 exit status
make[4]: *** [mkcodecache.target.mk:176: /home/sergey/openwrt2/build_dir/target-aarch64_cortex-a53_musl/node-v14.18.2/out/Release/mkcodecache] Error 1
rm 7b5fc5ee81ce088234765b79064235bf25dcbeb8.intermediate c5e5ccdf03bb1a32d27790790235168774ff2e70.intermediate c0111d5b0c3d72ad0610b58b1e42f313bd201dbb.intermediate d5363770ebb9ca494965a0c4d84db35637d42e62.intermediate d2f8b8e1c4bef2e5a5403aced1738cc5d1553afc.intermediate f9f8ef52de441648f5fff1919a8505995bebcd9d.intermediate
make[3]: *** [Makefile:109: node] Error 2
make[3]: Leaving directory '/home/sergey/openwrt2/build_dir/target-aarch64_cortex-a53_musl/node-v14.18.2'
make[2]: *** [Makefile:160: /home/sergey/openwrt2/build_dir/target-aarch64_cortex-a53_musl/node-v14.18.2/.built] Error 2
make[2]: Leaving directory '/home/sergey/openwrt2/feeds/packages/lang/node'
time: package/feeds/packages/node/compile#33.06#2.36#35.18
    ERROR: package/feeds/packages/node failed to build.
make[1]: *** [package/Makefile:116: package/feeds/packages/node/compile] Error 1
make[1]: Leaving directory '/home/sergey/openwrt2'
make: *** [/home/sergey/openwrt2/include/toplevel.mk:230: package/feeds/packages/node/compile] Error 2

build host

sergey@deb11k:~/openwrt2$ uname -a
Linux deb11k 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 GNU/Linux
sergey@deb11k:~/openwrt2$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

.config and log build attached
config.txt
node.log

@svlobanov
Copy link
Contributor Author

Github CI is able to build node https://github.com/svlobanov/packages/runs/4707270364?check_suite_focus=true

I've tried on clean installation of Debian11 amd64 and Ubuntu 20.04 amd64, but it fails. I can not understand why

@nxhack
Copy link
Contributor

nxhack commented Jan 5, 2022

@svlobanov

Please refer here.
#16729
#17164

@svlobanov
Copy link
Contributor Author

#16729 helpded me (ulimit -n 2048). Thank you. I'm closing this ticket

@brada4
Copy link

brada4 commented Jan 5, 2022

It is actually a bug in gcc ld (binutils) https://sourceware.org/bugzilla/show_bug.cgi?id=28138
The diff in the thread is quite simple if you dont add the new testcase.

nxhack added a commit to nxhack/openwrt that referenced this issue Jan 8, 2022
…chive fd

This fixes the following build error:
/home/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/lib/gcc/aarch64-openwrt-linux-musl/11.2.0/../../../../aarch64-openwrt-linux-musl/bin/ld: /home/sergey/openwrt2/build_dir/target-aarch64_cortex-a53_musl/node-v14.18.2/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a: error adding symbols: malformed archive
collect2: error: ld returned 1 exit status

It's a bad error handling related to -EMFILE (too many open files). nodejs is probably just very close to open file limit.

https://sourceware.org/bugzilla/show_bug.cgi?id=28138
nodejs/node#39452

openwrt/packages#17496
openwrt/packages#16729
openwrt/packages#17164

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
jow- pushed a commit to openwrt/openwrt that referenced this issue Jan 8, 2022
…chive fd

This fixes the following build error:
/home/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/lib/gcc/aarch64-openwrt-linux-musl/11.2.0/../../../../aarch64-openwrt-linux-musl/bin/ld: /home/sergey/openwrt2/build_dir/target-aarch64_cortex-a53_musl/node-v14.18.2/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a: error adding symbols: malformed archive
collect2: error: ld returned 1 exit status

It's a bad error handling related to -EMFILE (too many open files). nodejs is probably just very close to open file limit.

https://sourceware.org/bugzilla/show_bug.cgi?id=28138
nodejs/node#39452

openwrt/packages#17496
openwrt/packages#16729
openwrt/packages#17164

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
[Take full patch from 2.37 branch and refresh]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
@nxhack
Copy link
Contributor

nxhack commented Jan 8, 2022

@svlobanov @brada4
A patch has been applied to binutils 2.37. Please check it.
openwrt/openwrt@8c501bf

@brada4
Copy link

brada4 commented Jan 9, 2022

works for me.

coolsnowwolf pushed a commit to coolsnowwolf/lede that referenced this issue Jan 10, 2022
* toolchain/binutils: switch to version 2.36.1 by default

Runtime-tested on:
* ath79
* bcm27xx/bcm2708
* bcm27xx/bcm2709
* bcm27xx/bcm2711
* mvebu/cortexa53
* octeon
* realtek
* x86/64

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>

* toolchain/binutils: switch to version 2.37 by default

Compile tests:
* all

Runtime tests:
* ipq806x/generic
* lantiq/mt7621
* lantiq/xrx200
* x86/64

Signed-off-by: Paul Spooren <mail@aparcar.org>
Tested-by: Paul Spooren <mail@aparcar.org>
Tested-by: Rosen Penev <rosenp@gmail.com>
Tested-by: Andre Heider <a.heider@gmail.com>
Tested-by: Ansuel Smith <ansuelsmth@gmail.com>
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Paul Spooren <mail@aparcar.org>

* toolchain/binutils: v2.37 Close the file descriptor if there is no archive fd

This fixes the following build error:
/home/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/lib/gcc/aarch64-openwrt-linux-musl/11.2.0/../../../../aarch64-openwrt-linux-musl/bin/ld: /home/sergey/openwrt2/build_dir/target-aarch64_cortex-a53_musl/node-v14.18.2/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a: error adding symbols: malformed archive
collect2: error: ld returned 1 exit status

It's a bad error handling related to -EMFILE (too many open files). nodejs is probably just very close to open file limit.

https://sourceware.org/bugzilla/show_bug.cgi?id=28138
nodejs/node#39452

openwrt/packages#17496
openwrt/packages#16729
openwrt/packages#17164

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
[Take full patch from 2.37 branch and refresh]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Co-authored-by: Stijn Tintel <stijn@linux-ipv6.be>
Co-authored-by: Paul Spooren <mail@aparcar.org>
Co-authored-by: Hirokazu MORIKAWA <morikw2@gmail.com>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this issue Jan 10, 2022
…chive fd

This fixes the following build error:
/home/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/lib/gcc/aarch64-openwrt-linux-musl/11.2.0/../../../../aarch64-openwrt-linux-musl/bin/ld: /home/sergey/openwrt2/build_dir/target-aarch64_cortex-a53_musl/node-v14.18.2/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a: error adding symbols: malformed archive
collect2: error: ld returned 1 exit status

It's a bad error handling related to -EMFILE (too many open files). nodejs is probably just very close to open file limit.

https://sourceware.org/bugzilla/show_bug.cgi?id=28138
nodejs/node#39452

openwrt/packages#17496
openwrt/packages#16729
openwrt/packages#17164

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
[Take full patch from 2.37 branch and refresh]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Boos4721 pushed a commit to Boos4721/openwrt that referenced this issue Jan 15, 2022
…chive fd

This fixes the following build error:
/home/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/lib/gcc/aarch64-openwrt-linux-musl/11.2.0/../../../../aarch64-openwrt-linux-musl/bin/ld: /home/sergey/openwrt2/build_dir/target-aarch64_cortex-a53_musl/node-v14.18.2/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a: error adding symbols: malformed archive
collect2: error: ld returned 1 exit status

It's a bad error handling related to -EMFILE (too many open files). nodejs is probably just very close to open file limit.

https://sourceware.org/bugzilla/show_bug.cgi?id=28138
nodejs/node#39452

openwrt/packages#17496
openwrt/packages#16729
openwrt/packages#17164

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
[Take full patch from 2.37 branch and refresh]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: boos4721 <3.1415926535boos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants