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

12.11.0 on PPCLE requires libatomic.so.1 #29718

Closed
Flarna opened this issue Sep 26, 2019 · 13 comments
Closed

12.11.0 on PPCLE requires libatomic.so.1 #29718

Flarna opened this issue Sep 26, 2019 · 13 comments
Labels
ppc Issues and PRs related to the Power architecture.

Comments

@Flarna
Copy link
Member

Flarna commented Sep 26, 2019

  • Version: 12.11.0
  • Platform: PPCLE, Linux 3149024480ec 5.0.0-25-generic GitHub issue management #26~18.04.1-Ubuntu SMP Thu Aug 1 13:50:51 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux
  • Subsystem: build, deps

node.js 12.11.0 is not starting up on my PPCLE machine where 12.10.0 was running fine.

Error seen: node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory

It seems that 12.11.0 has new dependencies to libatomic.so.1 and librt.so.1:

$ ldd ./v12.11.0/bin/node
linux-vdso64.so.1 =>  (0x00007535a5f60000)
libatomic.so.1 => not found
libdl.so.2 => /lib/powerpc64le-linux-gnu/libdl.so.2 (0x00007535a5f20000)
librt.so.1 => /lib/powerpc64le-linux-gnu/librt.so.1 (0x00007535a5ef0000)
libstdc++.so.6 => /usr/lib/powerpc64le-linux-gnu/libstdc++.so.6 (0x00007535a5ce0000)
libm.so.6 => /lib/powerpc64le-linux-gnu/libm.so.6 (0x00007535a5bf0000)
libgcc_s.so.1 => /lib/powerpc64le-linux-gnu/libgcc_s.so.1 (0x00007535a5bc0000)
libpthread.so.0 => /lib/powerpc64le-linux-gnu/libpthread.so.0 (0x00007535a5b80000)
libc.so.6 => /lib/powerpc64le-linux-gnu/libc.so.6 (0x00007535a59b0000)
/lib64/ld64.so.2 (0x00007535a5f80000)
	
$ ldd ./v12.10.0/bin/node
linux-vdso64.so.1 =>  (0x000073b7b24d0000)
libdl.so.2 => /lib/powerpc64le-linux-gnu/libdl.so.2 (0x000073b7b2490000)
libstdc++.so.6 => /usr/lib/powerpc64le-linux-gnu/libstdc++.so.6 (0x000073b7b2280000)
libm.so.6 => /lib/powerpc64le-linux-gnu/libm.so.6 (0x000073b7b2190000)
libgcc_s.so.1 => /lib/powerpc64le-linux-gnu/libgcc_s.so.1 (0x000073b7b2160000)
libpthread.so.0 => /lib/powerpc64le-linux-gnu/libpthread.so.0 (0x000073b7b2120000)
libc.so.6 => /lib/powerpc64le-linux-gnu/libc.so.6 (0x000073b7b1f50000)
/lib64/ld64.so.2 (0x000073b7b24f0000)

Is this an intended change?

@Flarna Flarna changed the title Node 12.11.0 is not running on PPCLE Ubuntu 18.04 12.11.0 is not running on PPCLE Ubuntu 18.04 - missing libatomic.so.1 Sep 26, 2019
@Flarna Flarna changed the title 12.11.0 is not running on PPCLE Ubuntu 18.04 - missing libatomic.so.1 12.11.0 on PPCLE Ubuntu 18.04 required libatomic.so.1 Sep 26, 2019
@Flarna Flarna changed the title 12.11.0 on PPCLE Ubuntu 18.04 required libatomic.so.1 12.11.0 on PPCLE Ubuntu 18.04 requires libatomic.so.1 Sep 26, 2019
@addaleax addaleax added the ppc Issues and PRs related to the Power architecture. label Sep 26, 2019
@richardlau
Copy link
Member

I think 12.11.0 is the first PPCLE 12.x release we've done on Centos 7 (nodejs/build#1885) instead of the End-of-Life Ubuntu 14.04.

cc @nodejs/platform-ppc @sam-github

@Flarna
Copy link
Member Author

Flarna commented Sep 26, 2019

I can confirm that a simple apt-get install libatomic1 results in a working 12.11.0 on my PPCLE machine.

@Flarna Flarna changed the title 12.11.0 on PPCLE Ubuntu 18.04 requires libatomic.so.1 12.11.0 on PPCLE requires libatomic.so.1 Sep 26, 2019
@Flarna
Copy link
Member Author

Flarna commented Sep 26, 2019

Just found that my description regarding the used platform is incomplete.
I run node in a docker container using ubuntu:16.04 as base image; 18.04.1 is the version of the docker host.

@mhdawson
Copy link
Member

mhdawson commented Sep 26, 2019

FYI @sam-github

@sam-github
Copy link
Contributor

It was my observation and intention that devtoolset builds on centos7 would statically link in more of the lib dependencies, avoiding this problem. I'm looking into why that didn't happen, but rebuilds are bit slow because of nodejs/build#1927

@mhdawson
Copy link
Member

I don't think the toolset handles libraries other that libc++

@sam-github
Copy link
Contributor

So far I have confirmed that linking on ubuntu14.04 with g++-6 uses ...tools/v8_gypfiles/libv8_initializers.a -latomic -ldl -lrt -lm ..., and the identical linker command line is
used on centos7 with devtoolset-6.

On ubuntu/gcc-6 the linked executable has no dependency on libatomic, and on centos/devtoolset-6 it does.

So the open question might be not why centos7 does depend on the specified libs, but why ubuntu doesn't.

I'll keep poking at this.

@sam-github
Copy link
Contributor

@Flarna I removed the part of your description where it listed the dependency on libdl.so.2 as new, in your output you can it is present in both, it must have been a typo.

What I've found so far is:

  1. Neither of -latomic -lrt are required to link node on ubuntu/gcc or centos7/devtoolset
  2. ubuntu gcc seems to ignore unused link libs, devtoolset seems to generate executables with a reference to them.

As to why that is, or what can be done about it, still looking.

On our side, the obvious fix would be to not specify unnecessary libraries on the node link lines. I tried removing ppc64le from the platforms that need -latomic and got a working binary on ubuntu and centos7. I'd have to add a conditional to do the same for -lrt (it looks to be the POSIX.4 realtime APIs).

@targos any comment on that? The link libs seem to have been added with V8 7.5, #28005 from #27375, but since v8 doesn't build on ppc64le (to my knowlege), they might just have added them to be safe, on the assumption they'd be unused if they weren't needed.

@sam-github
Copy link
Contributor

@nodejs/v8 see above, any comment on what I asked targos?

@targos
Copy link
Member

targos commented Sep 26, 2019

This is the relevant config in V8's BUILD.gn: https://github.com/v8/v8/blob/318d66d95f94487cdac2322795a63ea613ef943b/BUILD.gn#L3381-L3388

We own v8.gyp so we could deviate from upstream here, if libatomic is really never needed (it might depend on certain build options).

sam-github referenced this issue in v8/v8 Sep 26, 2019
MIPS architecture doesn't have support for 64-bit atomics.
It is possible to implement them using 32-bit atomics,
but the process is involved and takes time. For the time
being support 64-bit atomics using runtime.

Bug: v8:8100
Change-Id: I8c732ea9975c46be70643a1e722d78938c8a70de
Reviewed-on: https://chromium-review.googlesource.com/1251521
Commit-Queue: Ivica Bogosavljevic <ibogosavljevic@wavecomp.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56331}
@sam-github
Copy link
Contributor

I asked about its purpose in v8/v8@408896a#r35254481

sam-github added a commit to sam-github/node that referenced this issue Sep 26, 2019
It is not needed, and causes an unnecessary runtime dependency with some
linkers, such as devtoolset-6 on centos7-ppc64le.

See: nodejs#29718
@sam-github
Copy link
Contributor

@nodejs/releasers note that 10.x is also switching to centos7 ppcle. I doesn't depend on libatomic, but it does depend on librt.so.1, and that is new i n10.16.4

root@test-osuosl-ubuntu1404-ppc64--le-1:/tmp/node-v10.16.4-nightly20190923859d47593e9fd97e6a9eae6eeb8b6e910acfe434-linux-ppc64le/bin# ldd node
        linux-vdso64.so.1 =>  (0x00003fff9cba0000)
        libdl.so.2 => /lib/powerpc64le-linux-gnu/libdl.so.2 (0x00003fff9cb60000)
        librt.so.1 => /lib/powerpc64le-linux-gnu/librt.so.1 (0x00003fff9cb30000)
        libstdc++.so.6 => /usr/lib/powerpc64le-linux-gnu/libstdc++.so.6 (0x00003fff9c9a0000)
        libm.so.6 => /lib/powerpc64le-linux-gnu/libm.so.6 (0x00003fff9c8b0000)
        libgcc_s.so.1 => /lib/powerpc64le-linux-gnu/libgcc_s.so.1 (0x00003fff9c870000)
        libpthread.so.0 => /lib/powerpc64le-linux-gnu/libpthread.so.0 (0x00003fff9c830000)
        libc.so.6 => /lib/powerpc64le-linux-gnu/libc.so.6 (0x00003fff9c660000)
        /lib64/ld64.so.2 (0x00000000517d0000)
root@test-osuosl-ubuntu1404-ppc64--le-1:/tmp/node-v10.16.4-nightly20190923859d47593e9fd97e6a9eae6eeb8b6e910acfe434-linux-ppc64le/bin#

Speculative fix: #29729

sam-github added a commit to sam-github/node that referenced this issue Oct 1, 2019
The library is not necessary for ppc64 or s390x. It does no harm with
some linkers, but devtoolset-6 creates runtime dependencies on all link
libraries, even unused ones.

Fixes: nodejs#27377
Fixes: nodejs#29718
BethGriggs pushed a commit that referenced this issue Oct 1, 2019
It is not needed, and causes an unnecessary runtime dependency with some
linkers, such as devtoolset-6 on centos7-ppc64le.

See: #29718

PR-URL: #29729
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
sam-github added a commit that referenced this issue Oct 1, 2019
PR-URL: #29727
Fixes: #27377
Fixes: #29718
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR pushed a commit that referenced this issue Oct 9, 2019
The library is not necessary for ppc64 or s390x. It does no harm with
some linkers, but devtoolset-6 creates runtime dependencies on all link
libraries, even unused ones.

Fixes: #27377
Fixes: #29718

PR-URL: #29727
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR pushed a commit that referenced this issue Oct 9, 2019
PR-URL: #29727
Fixes: #27377
Fixes: #29718
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MichaIng
Copy link

@sam-github
We observed this shared lib dependency on Node 14 armv7l builds as well. If this is finally intended for Linux builds in general of for most architectures, it would be good to add it to the docs: https://github.com/nodejs/help/wiki/Installation#how-to-install-nodejs-via-binary-archive-on-linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ppc Issues and PRs related to the Power architecture.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants