With the change in http://reviews.llvm.org/D19928, linking FreeBSD/mips64 libc fails with: Assertion failed: ((!this->Sec || this->Sec == Sec) && "multiple .eh_frame sections not supported for .eh_frame_hdr"), function assignEhFrame, file ../tools/lld/ELF/OutputSections.cpp, line 850. (lldb) bt * thread #1: tid = 0, 0x00000008058a6aaa libc.so.7`__sys_thr_kill + 10 at thr_kill.S:3, name = 'lld', stop reason = signal SIGABRT * frame #0: 0x00000008058a6aaa libc.so.7`__sys_thr_kill + 10 at thr_kill.S:3 frame #1: 0x00000008058a6a96 libc.so.7`__raise(s=<unavailable>) + 38 at raise.c:51 frame #2: 0x00000008058a6a66 libc.so.7`abort + 150 at abort.c:77 frame #3: 0x000000080590d3c1 libc.so.7`__assert(func=<unavailable>, file=<unavailable>, line=<unavailable>, failedexpr=<unavailable>) + 81 at assert.c:54 frame #4: 0x000000000060390c lld`lld::elf::EhFrameHeader<llvm::object::ELFType<(this=0x00007fffffff5a58, Sec=0x0000000808890c00)0, true> >::assignEhFrame(lld::elf::EHOutputSection<llvm::object::ELFType<(llvm::support::endianness)0, true> >*) + 92 at OutputSections.h:849 frame #5: 0x000000000063831c lld`EHOutputSection(this=0x0000000808890c00, Name=StringRef at 0x00007fffffff3be8, Type=1, Flags=2) + 492 at OutputSections.cpp:1022 frame #6: 0x0000000000638363 lld`EHOutputSection(this=0x0000000808890c00, Name=StringRef at 0x00007fffffff3cc8, Type=1, Flags=2) + 51 at OutputSections.h:1023 frame #7: 0x0000000000743792 lld`(anonymous namespace)::OutputSectionFactory<llvm::object::ELFType<(this=0x00007fffffff4188, C=0x0000000808974000, OutsecName=StringRef at 0x00007fffffff3dc0)0, true> >::create(lld::elf::InputSectionBase<llvm::object::ELFType<(llvm::support::endianness)0, true> >*, llvm::StringRef) + 514 at Writer.cpp:1201 frame #8: 0x000000000073a92f lld`(anonymous namespace)::Writer<llvm::object::ELFType<(this=0x00007fffffff5268)0, true> >::createSections() + 2287 at Writer.cpp:1342 frame #9: 0x00000000007391d6 lld`(anonymous namespace)::Writer<llvm::object::ELFType<(this=0x00007fffffff5268)0, true> >::run() + 70 at Writer.cpp:219 frame #10: 0x00000000007ab015 lld`void lld::elf::writeResult<llvm::object::ELFType<(Symtab=0x00007fffffff6708)0, true> >(lld::elf::SymbolTable<llvm::object::ELFType<(llvm::support::endianness)0, true> >*) + 6293 at Writer.cpp:211 frame #11: 0x0000000000548d8b lld`void lld::elf::LinkerDriver::link<llvm::object::ELFType<(this=0x00007fffffff7138, Args=0x00007fffffff6c38)0, true> >(llvm::opt::InputArgList&) + 2411 at Driver.cpp:501 frame #12: 0x000000000053b613 lld`lld::elf::LinkerDriver::main(this=0x00007fffffff7138, ArgsArr=ArrayRef<const char *> at 0x00007fffffff6e70) + 1683 at Driver.cpp:279 frame #13: 0x000000000053af16 lld`lld::elf::link(Args=ArrayRef<const char *> at 0x00007fffffff73a0, Error=0x00000000046a7278) + 182 at Driver.cpp:48 frame #14: 0x0000000000448827 lld`main(Argc=1257, Argv=0x00007fffffff74e8) + 231 at lld.cpp:107 frame #15: 0x000000000044865f lld`_start(ap=<unavailable>, cleanup=<unavailable>) + 367 at crt1.c:78 (I don't expect lld to produce a working FreeBSD/mips64 build yet, of course, but will keep track of the individual issues I find while investigating.)
Reproduction .cpio file available at https://people.freebsd.org/~emaste/lld/mips-libc.cpio
Is this bug still reproducible?
> Is this bug still reproducible? Will re-test again soon.
No longer reproducible: lld now links FreeBSD's libc.so. No comment on whether it works, and the build fails later on for other reasons.