rui314/mold

mold: fatal: lto-wrapper failed

Opened this issue · 3 comments

I was previously having an issue with
mold: error: undefined symbol: OPENSSL_ia32cap_P
#1315

This issue has been resolved currently.

My compilation goes through smoothly until the end, but it fails in lto-wrapper:

during IPA pass: icf
lto1: internal compiler error: Segmentation fault
0xbb2b1f crash_signal
../.././gcc/toplev.cc:322
0xe690f8 varpool_node::get_constructor()
../.././gcc/varpool.cc:300
0x182274f ipa_icf::sem_variable::equals(ipa_icf::sem_item*, hash_map<symtab_node*, ipa_icf::sem_item*, simple_hashmap_traits<default_hash_traits<symtab_node*>, ipa_icf::sem_item*> >&)
../.././gcc/ipa-icf.cc:1695
0x18237ce ipa_icf::sem_item_optimizer::subdivide_classes_by_equality(bool)
../.././gcc/ipa-icf.cc:2732
0x182b57e ipa_icf::sem_item_optimizer::execute()
../.././gcc/ipa-icf.cc:2464
0x182cd76 ipa_icf_driver
../.././gcc/ipa-icf.cc:3600
0x182cd76 ipa_icf::pass_ipa_icf::execute(function*)
../.././gcc/ipa-icf.cc:3647
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See https://gcc.gnu.org/bugs/ for instructions.
lto-wrapper: fatal error: /path/to/gnu64/gcc/12.1/bin/g++ returned 1 exit status
compilation terminated.
mold: fatal: lto-wrapper failed
collect2: error: ld returned 1 exit status
src/cpp/CMakeFiles/services.dir/build.make:197: recipe for target 'src/cpp/services.cpython-38-x86_64-linux-gnu.so' failed
make[2]: *** [src/cpp/services.cpython-38-x86_64-linux-gnu.so] Error 1
CMakeFiles/Makefile2:446: recipe for target 'src/cpp/CMakeFiles/services.dir/all' failed
make[1]: *** [src/cpp/CMakeFiles/services.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

My initial suspicion is something to do with link time optimization, but not sure.

rui314 commented

How did you configure your openssl? I cannot reproduce the issue.

I statically linked to an openssl that I compiled:
openssl/openssl-1.1.1g/openssl-64bit-release-static-gcc-8.2.0

Is there an OpenSSL version dependency for this?

rui314 commented

How did you compile? Please share your command line options so that I can reproduce exactly how you build it. Also please share your Linux distro name and compiler version.