Summary: | www/node: Fails to link: ld: error: undefined symbol: __atomic_is_lock_free | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Bedreddin Sahbaz <bedreddinsahbaz> | ||||
Component: | Individual Port(s) | Assignee: | Bradley T. Hughes <bhughes> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | jcfyecrayz, zirias | ||||
Priority: | --- | Keywords: | needs-qa | ||||
Version: | Latest | Flags: | bhughes:
maintainer-feedback+
|
||||
Hardware: | i386 | ||||||
OS: | Any | ||||||
Attachments: |
|
* What FreeBSD version? (uname -a) * Contents of /etc/make.conf (as an attachment, if not empty) # uname -a FreeBSD baki.xxxxxxxxxx.web.tr 12.2-RELEASE-p7 FreeBSD 12.2-RELEASE-p7 GENERIC i386 # cat /etc/make.conf DEFAULT_VERSIONS=python2=2.7 python3=3.8 Created attachment 229076 [details] 0001-www-node-fix-build-of-bundled-ssl-on-i386 This only happens on i386, not on amd64. And I assume it only happens with BUNDLED_SSL set, because the "offending" code is in the bundled OpenSSL. As to *why* it happens, I'm currently at a loss, as this should be a compiler builtin, right? Is it somehow related to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230888 ? For now, I added a patch just disabling these atomic operations on i386, which is probably less then ideal. My test build is still running, but linking openssl-cli (which failed before) now worked. I can now confirm that www/node and some dependent ports like chromium and firefox build find on i386 with BUNDLED_SSL after adding the patch above and the one from https://bugs.freebsd.org/259377 Same here on 12.x/i386. See also upstream bug with fix applied for mac & linux: https://github.com/nodejs/node/issues/28231 I will try building with BUNDLED_SSL=off and DEFAULT_VERSIONS=ssl=openssl. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=8de43db2771a9534f9a9d67c48c46152f2843128 commit 8de43db2771a9534f9a9d67c48c46152f2843128 Author: Bradley T. Hughes <bhughes@FreeBSD.org> AuthorDate: 2021-10-24 18:09:51 +0000 Commit: Bradley T. Hughes <bhughes@FreeBSD.org> CommitDate: 2021-10-29 13:40:45 +0000 www/node: Update 17.0.0_1 -> 17.0.1 https://nodejs.org/en/blog/release/v17.0.1/ While here, update pkg-plist to allow building with the BUNDLED_SSL option enabled, and add the patch from PR 259454 to fix the build on i386. PR: 259454, 259377 MFH: 2021Q4 Sponsored by: Miles AS www/node/Makefile | 3 +- www/node/distinfo | 6 +- ...openssl_openssl_crypto_threads__pthread.c (new) | 29 + www/node/pkg-plist | 2446 +++++++++++++++++++- 4 files changed, 2461 insertions(+), 23 deletions(-) Thanks Bradley for including my patch! But it still remains a mystery to me why this code doesn't work on i386… Do you want to analyze this further or just live with the workaround and close this PR? I tried install node 17.0.1 and installed without any error. Thank you.. # make install ===> Installing for node-17.0.1 ===> Checking if node is already installed ===> Registering installation for node-17.0.1 Installing node-17.0.1... Note: If you need npm (Node Package Manager), please install www/npm. ===> SECURITY REPORT: This port has installed the following files which may act as network servers and may therefore pose a remote security risk to the system. /usr/local/bin/node If there are vulnerabilities in these programs there may be a security risk to the system. FreeBSD makes no guarantee about the security of ports included in the Ports Collection. Please type 'make deinstall' to deinstall the port if this is a concern. For more information, and contact details about the security status of this software, see the following webpage: https://nodejs.org/ |
I can't install www/node port. Error message; ld: error: undefined symbol: __atomic_is_lock_free >>> referenced by threads_pthread.c >>> threads_pthread:(CRYPTO_atomic_or) in archive /usr/ports/www/node/work/node-v17.0.0/out/Release/obj.target/deps/openssl/libopenssl.a >>> referenced by threads_pthread.c >>> threads_pthread:(CRYPTO_atomic_load) in archive /usr/ports/www/node/work/node-v17.0.0/out/Release/obj.target/deps/openssl/libopenssl.a c++: error: linker command failed with exit code 1 (use -v to see invocation) gmake[3]: *** [deps/openssl/openssl-cli.target.mk:258: /usr/ports/www/node/work/node-v17.0.0/out/Release/openssl-cli] Error 1 gmake[3]: *** Waiting for unfinished jobs.... rm 45ea5d9210d9659c03236a4207678eddae27dc3a.intermediate gmake[2]: *** [Makefile:110: node] Error 2 gmake[2]: Leaving directory '/usr/ports/www/node/work/node-v17.0.0' ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make[1]: stopped in /usr/ports/www/node *** Error code 1 Stop. make: stopped in /usr/ports/www/node # uname -a FreeBSD baki.xxxxxxxxxx.web.tr 12.2-RELEASE-p7 FreeBSD 12.2-RELEASE-p7 GENERIC i386 Thank you..