Skip to content
New issue

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

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

Already on GitHub? # to your account

lto build failed with gcc 9.3 #38570

Closed
gengjiawen opened this issue May 6, 2021 · 8 comments
Closed

lto build failed with gcc 9.3 #38570

gengjiawen opened this issue May 6, 2021 · 8 comments
Labels
build Issues and PRs related to build files or the CI.

Comments

@gengjiawen
Copy link
Member

https://github.com/nodejs/node/pull/38567/checks?check_run_id=2518010690

[2765/3170] LINK mksnapshot
FAILED: mksnapshot 
c++ -pthread -rdynamic -m64 -m64  -flto=4 -fuse-linker-plugin -ffat-lto-objects  -o mksnapshot -Wl,--start-group obj/deps/v8/src/snapshot/embedded/mksnapshot.embedded-empty.o obj/deps/v8/src/snapshot/embedded/mksnapshot.embedded-file-writer.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-aix.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-base.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-generic.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-mac.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-win.o obj/deps/v8/src/snapshot/mksnapshot.mksnapshot.o obj/deps/v8/src/snapshot/mksnapshot.snapshot-empty.o obj/tools/v8_gypfiles/libv8_base_without_compiler.a obj/tools/v8_gypfiles/libv8_init.a obj/tools/v8_gypfiles/libv8_libbase.a obj/tools/v8_gypfiles/libv8_libplatform.a obj/tools/icu/libicui18n.a obj/tools/icu/libicuucx.a obj/tools/icu/libicudata.a obj/tools/v8_gypfiles/libv8_libsampler.a obj/tools/v8_gypfiles/libv8_zlib.a obj/tools/v8_gypfiles/libv8_compiler.a obj/tools/v8_gypfiles/libv8_initializers.a  -ldl -lrt -Wl,--end-group
lto1: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:153
Please submit a full bug report,
with preprocessed source if appropriate.
@Ayase-252 Ayase-252 added the build Issues and PRs related to build files or the CI. label May 7, 2021
@gengjiawen
Copy link
Member Author

cc @joyeecheung

@joyeecheung
Copy link
Member

It looks like a bug within gcc, can you get the CI to just do python configure.py --gdb --ninja --enable-lto && ninja -C out/Release v8_snapshot?

@joyeecheung
Copy link
Member

(or just python configure.py --enable-lto && make -C out/Release v8_snapshot)

@gengjiawen gengjiawen linked a pull request May 16, 2021 that will close this issue
@gengjiawen
Copy link
Member Author

Looks the same from my local

  AR(target) /opt/data/node/out/Release/obj.target/tools/v8_gypfiles/libv8_initializers.a
  CXX(target) /opt/data/node/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/embedded/embedded-empty.o
  CXX(target) /opt/data/node/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/embedded/embedded-file-writer.o
  CXX(target) /opt/data/node/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-aix.o
  CXX(target) /opt/data/node/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-base.o
  CXX(target) /opt/data/node/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-generic.o
  CXX(target) /opt/data/node/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-mac.o
  CXX(target) /opt/data/node/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-win.o
  CXX(target) /opt/data/node/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/mksnapshot.o
  CXX(target) /opt/data/node/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/snapshot-empty.o
  LINK(target) /opt/data/node/out/Release/mksnapshot
lto1: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:153
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
lto-wrapper: fatal error: /usr/bin/g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [tools/v8_gypfiles/mksnapshot.target.mk:188: /opt/data/node/out/Release/mksnapshot] Error 1
rm 726a4c78149a083dc96a47ae98aadf2d439ab78e.intermediate 5e71280aa95022d3204eca791e97c0d0fd7e94b4.intermediate
make: Leaving directory '/opt/data/node/out'

@jesec
Copy link
Member

jesec commented May 21, 2021

Most likely a rare compiler bug. I am not able to reproduce with:

  • gcc (GCC) 10.2.1 2020080 (Red Hat 10.2.1-2) / RHEL 7.9 / devtoolset-10-toolchain-rhel7
  • aarch64-linux-gnu-gcc-8 (Ubuntu/Linaro 8.4.0-1ubuntu1~18.04) 8.4.0 / Ubuntu 18.04.5 LTS

Nonetheless, the issue is indeed reproducible with:

  • gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) / Ubuntu 20.04.2 LTS

@gengjiawen
Copy link
Member Author

Failed with gcc 8.5 too https://github.com/nodejs/node/pull/38567/checks?check_run_id=2649989513.

Also failed on 8.3, 8.4 from what I test on local machine (using gcc docker image).

@gengjiawen
Copy link
Member Author

Gcc 11 works.

@gengjiawen
Copy link
Member Author

Since it's a gcc bug. I will close this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@gengjiawen @joyeecheung @Ayase-252 @jesec and others