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

6.4.0 is linking against GLIBCXX_3.4.18 (libstdc++6 >=4.8) #8172

Closed
narqo opened this issue Aug 18, 2016 · 5 comments
Closed

6.4.0 is linking against GLIBCXX_3.4.18 (libstdc++6 >=4.8) #8172

narqo opened this issue Aug 18, 2016 · 5 comments
Labels
invalid Issues and PRs that are invalid.

Comments

@narqo
Copy link

narqo commented Aug 18, 2016

In our company, we build separate Debian packages from Node.js sources, for every major branch (e.g. we have packages nodejs-0.10, nodejs-4, nodejs-6 and so on). We've been maintaining packages for Ubuntu LTSs 12.04 to 16.04.

Recently I've noticed that Node.js 6.4.0 was linked against GLIBCXX_3.4.18. It means that 6.4.0 requires libstdc++6 >=4.8 to present in the system's runtime, so it makes impossible to use the release on Ubuntu 12.04, which ships libstdc++ 4.6.

$ uname -a 
Linux var01f.vsfront.yandex.net 3.19.0-58-generic #64~14.04.1-Ubuntu SMP Fri Mar 18 19:05:43 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ curl "https://nodejs.org/dist/v6.4.0/node-v6.4.0.tar.gz" -O && tar xvf node-v6.4.0.tar.gz
$ cd node-v6.4.0
$ ./configure && make
...
$ objdump -p out/Release/node
...
Dynamic Section:
  NEEDED               libdl.so.2
  NEEDED               librt.so.1
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libpthread.so.0
  NEEDED               libc.so.6
  INIT                 0x000000000079e088
  FINI                 0x000000000131633c
  INIT_ARRAY           0x0000000001cc5ca0
  INIT_ARRAYSZ         0x0000000000000108
  FINI_ARRAY           0x0000000001cc5da8
  FINI_ARRAYSZ         0x0000000000000018
  GNU_HASH             0x0000000000400298
  STRTAB               0x000000000053f548
  SYMTAB               0x000000000044fba8
  STRSZ                0x00000000002481c6
  SYMENT               0x0000000000000018
  DEBUG                0x0000000000000000
  PLTGOT               0x0000000001cc6000
  PLTRELSZ             0x0000000000002628
  PLTREL               0x0000000000000007
  JMPREL               0x000000000079ba60
  RELA                 0x000000000079b838
  RELASZ               0x0000000000000228
  RELAENT              0x0000000000000018
  VERNEED              0x000000000079b688
  VERNEEDNUM           0x0000000000000007
  VERSYM               0x000000000078770e

Version References:
  required from librt.so.1:
    0x09691a75 0x00 21 GLIBC_2.2.5
  required from libgcc_s.so.1:
    0x0b792654 0x00 18 GCC_3.4
  required from libm.so.6:
    0x09691a75 0x00 08 GLIBC_2.2.5
  required from libpthread.so.0:
    0x09691973 0x00 19 GLIBC_2.3.3
    0x09691972 0x00 15 GLIBC_2.3.2
    0x09691a75 0x00 06 GLIBC_2.2.5
  required from libc.so.6:
    0x06969195 0x00 17 GLIBC_2.15
    0x0d696914 0x00 14 GLIBC_2.4
    0x0d696913 0x00 11 GLIBC_2.3
    0x09691974 0x00 10 GLIBC_2.3.4
    0x0d696917 0x00 07 GLIBC_2.7
    0x06969194 0x00 05 GLIBC_2.14
    0x09691a75 0x00 04 GLIBC_2.2.5
  required from libstdc++.so.6:
    0x0297f868 0x00 20 GLIBCXX_3.4.18 // ☚ libstdc++ >=4.8.0
    0x0297f861 0x00 16 GLIBCXX_3.4.11
    0x056bafd3 0x00 13 CXXABI_1.3
    0x0297f865 0x00 12 GLIBCXX_3.4.15
    0x02297f89 0x00 09 GLIBCXX_3.4.9
    0x08922974 0x00 03 GLIBCXX_3.4
  required from libdl.so.2:
    0x09691a75 0x00 02 GLIBC_2.2.5

I believe there wasn't such requirement for Node.js 6.3.1, and the release built from sources within the same environment was linked to GLIBCXX_3.4.15.

$ curl "https://nodejs.org/dist/v6.3.1/node-v6.3.1.tar.gz" -O && tar xvf node-v6.3.1.tar.gz
$ cd node-v6.3.1
$ ./configure && make
...
$ objdump -p out/Release/node
out/Release/node:     file format elf64-x86-64
...

Dynamic Section:
  NEEDED               libdl.so.2
  NEEDED               librt.so.1
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libpthread.so.0
  NEEDED               libc.so.6
  INIT                 0x00000000007991a0
  FINI                 0x00000000013108cc
  INIT_ARRAY           0x0000000001cbaca0
  INIT_ARRAYSZ         0x0000000000000108
  FINI_ARRAY           0x0000000001cbada8
  FINI_ARRAYSZ         0x0000000000000018
  GNU_HASH             0x0000000000400298
  STRTAB               0x000000000053e5d8
  SYMTAB               0x000000000044f988
  STRSZ                0x000000000024440a
  SYMENT               0x0000000000000018
  DEBUG                0x0000000000000000
  PLTGOT               0x0000000001cbb000
  PLTRELSZ             0x0000000000002598
  PLTREL               0x0000000000000007
  JMPREL               0x0000000000796c08
  RELA                 0x00000000007969e0
  RELASZ               0x0000000000000228
  RELAENT              0x0000000000000018
  VERNEED              0x0000000000796840
  VERNEEDNUM           0x0000000000000007
  VERSYM               0x00000000007829e2

Version References:
  required from librt.so.1:
    0x09691a75 0x00 20 GLIBC_2.2.5
  required from libgcc_s.so.1:
    0x0b792654 0x00 18 GCC_3.4
  required from libm.so.6:
    0x09691a75 0x00 08 GLIBC_2.2.5
  required from libpthread.so.0:
    0x09691973 0x00 19 GLIBC_2.3.3
    0x09691972 0x00 15 GLIBC_2.3.2
    0x09691a75 0x00 06 GLIBC_2.2.5
  required from libc.so.6:
    0x06969195 0x00 17 GLIBC_2.15
    0x0d696914 0x00 14 GLIBC_2.4
    0x0d696913 0x00 11 GLIBC_2.3
    0x09691974 0x00 10 GLIBC_2.3.4
    0x0d696917 0x00 07 GLIBC_2.7
    0x06969194 0x00 05 GLIBC_2.14
    0x09691a75 0x00 04 GLIBC_2.2.5
  required from libstdc++.so.6:
    0x0297f861 0x00 16 GLIBCXX_3.4.11
    0x056bafd3 0x00 13 CXXABI_1.3
    0x0297f865 0x00 12 GLIBCXX_3.4.15 // ☚ libstdc++ >=4.6.0
    0x02297f89 0x00 09 GLIBCXX_3.4.9
    0x08922974 0x00 03 GLIBCXX_3.4
  required from libdl.so.2:
    0x09691a75 0x00 02 GLIBC_2.2.5

Should these changes be considered as minor? Or is there a way to build the binary, that will be linked to an older version glibc?

/cc @indutny

@bnoordhuis
Copy link
Member

Or is there a way to build the binary, that will be linked to an older version glibc?

You can, by ensuring that the host and the target are the same system. What you are doing is building against a newer version of libstdc++, then trying to run it against an older version.

I'll close the issue, this is not a node.js bug.

@bnoordhuis bnoordhuis added the invalid Issues and PRs that are invalid. label Aug 18, 2016
@narqo
Copy link
Author

narqo commented Aug 18, 2016

You can, by ensuring that the host and the target are the same system. What you are doing is building against a newer version of libstdc++, then trying to run it against an older version.

So is it true that Node.js>=4 doesn't support Ubuntu 12.04 which doesn't have g++ 4.8? What I mean is that technically I can build Node.js 4.x (or even <6.4.0) on Ubuntu 12.04 with g++-4.8 installed from ppa, and then use the binary on a stock Ubuntu with g++-4.6, because Node.js was linked with GLIBCXX_3.4.15. But there are no guarantees for such use cases.

@bnoordhuis
Copy link
Member

Correct.

@narqo
Copy link
Author

narqo commented Aug 23, 2016

@bnoordhuis Sorry for bothering. Where can I look at how current node6's Linux binaries are built? I'm interested in the environment you're using, as well as the compiler flags. It seems that those binaries are not statically built, but they work perfectly on the clean Ubuntu 12.04, while my binaries require new libgcc to be installed.

@bnoordhuis
Copy link
Member

bnoordhuis commented Aug 23, 2016

There is no magic, we basically run make tar on a centos5 box.

EDIT: I mean make binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid.
Projects
None yet
Development

No branches or pull requests

2 participants