This is a largely untested work in progress as an alternative to
https://reviews.llvm.org/D76452. If we decide to go this route I'll
add the missing tests :)
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/tools/lld/lld.cpp | ||
---|---|---|
134 | This checks -m for lld-link, wasm-ld and ld64 which not be great. We can place the check inside: #if __APPLE__ // Use Darwin driver for "ld" on Darwin. if (progname == "ld") return Darwin; #endif |
Comment Actions
@ruiu @int3 If we can't really get rid of the #if __APPLE__ block, I would hope we can use
#if __APPLE__ // Use Darwin driver for "ld" on Darwin. if (progname == "ld") { if (targetMatches(v, [](StringRef s) { ... }) return Gnu; return Darwin; } #endif
This should address the Android folks' problem that ld on Darwin acts as a Mach-O linker (instead of an ELF linker). The approach seems cleaner than D76452.
-m is an ld64 obsoleted option.
-m Don't treat multiple definitions as an error. This is no longer supported. This option is obsolete.
lld/tools/lld/lld.cpp | ||
---|---|---|
134 | Okay, if we don't want this behavior to affect non-Android targets I think the Clang patch is the right answer. Although removing the Darwin case also SGTM. |
This checks -m for lld-link, wasm-ld and ld64 which not be great.
We can place the check inside: