Repository navigation
building nodejs from source partially used export CC, ... #26877
Copy link
Copy link
Closed
Labels
buildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.
Description
Hello,
I have two gcc versions installed. However, I'm building node 8.15.1 with gcc-5. To achieve this, I'm using environment variables with CC,CXX,AR,... It works but at some point environment variables are not used. I noticed it when building process is using mksnapshot.
below failed make step:
g++-5 '-DV8_GYP_BUILD' '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT' '-Dv8_promise_internal_field_count' '-DV8_INTL_SUPPORT' '-DUCONFIG_NO_SERVICE=1' '-DUCONFIG_NO_REGULAR_EXPRESSIONS=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=0' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/v8 -I../. -I../deps/v8/include -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fno-strict-aliasing -m64 -fdata-sections -ffunction-sections -O3 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /tmp/node-v8.15.1/out/Release/.deps//tmp/node-v8.15.1/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/mksnapshot.o.d.raw -O2 -fPIC -c -o /tmp/node-v8.15.1/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/mksnapshot.o ../deps/v8/src/snapshot/mksnapshot.cc
g++-5 -pthread -rdynamic -m64 -m64 -o /tmp/node-v8.15.1/out/Release/mksnapshot -Wl,--start-group /tmp/node-v8.15.1/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/mksnapshot.o /tmp/node-v8.15.1/out/Release/obj.target/deps/v8/src/libv8_base.a /tmp/node-v8.15.1/out/Release/obj.target/deps/v8/src/libv8_builtins_setup.a /tmp/node-v8.15.1/out/Release/obj.target/deps/v8/src/libv8_libbase.a /tmp/node-v8.15.1/out/Release/obj.target/deps/v8/src/libv8_libplatform.a /tmp/node-v8.15.1/out/Release/obj.target/deps/v8/src/libv8_nosnapshot.a /tmp/node-v8.15.1/out/Release/obj.target/tools/icu/libicui18n.a /tmp/node-v8.15.1/out/Release/obj.target/deps/v8/src/libv8_libsampler.a /tmp/node-v8.15.1/out/Release/obj.target/tools/icu/libicuucx.a /tmp/node-v8.15.1/out/Release/obj.target/tools/icu/libicudata.a /tmp/node-v8.15.1/out/Release/obj.target/tools/icu/libicustubdata.a /tmp/node-v8.15.1/out/Release/obj.target/deps/v8/src/libv8_builtins_generators.a -lz -lcrypto -lssl -ldl -lrt -Wl,--end-group
LD_LIBRARY_PATH=/tmp/node-v8.15.1/out/Release/lib.host:/tmp/node-v8.15.1/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src; mkdir -p /tmp/node-v8.15.1/out/Release/obj.target/v8_snapshot/geni; "/tmp/node-v8.15.1/out/Release/mksnapshot" --startup_src "/tmp/node-v8.15.1/out/Release/obj.target/v8_snapshot/geni/snapshot.cc" ""
/tmp/node-v8.15.1/out/Release/mksnapshot: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /tmp/node-v8.15.1/out/Release/mksnapshot)
make[1]: *** [/tmp/node-v8.15.1/out/Release/obj.target/v8_snapshot/geni/snapshot.cc] Error 1
rm 98682b60ad7e40c6592e0a7d2cd9f4fab62dbc00.intermediate
make[1]: Leaving directory `/tmp/node-v8.15.1/out'
make: *** [node] Error 2
So it seems, mksnapshot is not built using the gcc version I set with export.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
buildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.
Activity
refack commentedon Mar 23, 2019
I believe it's more subtle.
This line would indicate
mksnapshotis being linked usingg++-5.This would also indicate it was built by GCC >= 4.9.
But the runtime loader can't find the right
libstdc++.so.6version. Trylocate libstdc++.so.6to search for the version ones. For example:We are currently investigating the optimal way to solve this, but so your case I can suggest three options:
./configure --partly-static. That will statically link libstdc++ into binarieslibstdc++.so.6on your system, and symlink it to/usr/lib/libstdc++.so.6LD_LIBRARY_PATHto where the newer lib isjanemba commentedon Mar 23, 2019
@refack
I used the second options and it works. Thank you.
refack commentedon Mar 23, 2019
Happy to help 🎩