This fixes libcxxabi bootstrap on FreeBSD for me. Ed, can you please confirm? Thanks.
Details
Diff Detail
Event Timeline
This does fix libcxxabi build / testrun for me.
Note that linking with gnu ld leaves a local absolute symbol for _GLOBAL_OFFSET_TABLE_ in libc++abi.so:
% nm build-nodebug/lib/libc++abi.so | grep 'GLOBAL_OFFSET' 00000000002592e0 a _GLOBAL_OFFSET_TABLE_
While with this patch lld produces none:
% nm build-lld-selfhost2/lib/libc++abi.so | grep 'GLOBAL_OFFSET' %
but I don't know that it matters.
Whether we should submit this or not depends on whether it will fix the issue or not, but in case if we do.
ELF/Driver.cpp | ||
---|---|---|
345–351 | Reorder the conditions in if so that the most important stuff comes first. // Add default entry symbol. Note that AMDGPU executables has no entry. if (Config->Entry.empty() && !Config->Shared && !Config->Relocatable && Config->EMachine != EM_AMDGPU) Config->Entry = (Config->EMachine == EM_MIPS) ? "__start" : "_start"; |
Whether we should submit this or not depends on whether it will fix the issue or not
It does fix the issue for me.
(I had one failure in a lld-with-lld test at first, because llvm-dis didn't get built as a dependency. In check-libcxxabi for me two libunwind-related failures and one other unrelated failure remain with this patch.)
Reorder the conditions in if so that the most important stuff comes first.