|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5 |
|
| #
08c239e2 |
| 09-Jun-2022 |
Nico Weber <[email protected]> |
[lld/mac] Add support for $ld$previous symbols with explicit symbol name
A symbol `$ld$previous$/Another$1.2.3$1$3.0$14.0$_xxx$` means "pretend symbol `_xxx` is in dylib `/Another` with version `1.2
[lld/mac] Add support for $ld$previous symbols with explicit symbol name
A symbol `$ld$previous$/Another$1.2.3$1$3.0$14.0$_xxx$` means "pretend symbol `_xxx` is in dylib `/Another` with version `1.2.3` if the deployment target is between `3.0` and `14.0` and we're targeting platform `1` (ie macOS)".
This means dylibs can now inject synthetic dylibs into the link, so DylibFile needs to grow a 3rd constructor.
The only other interesting thing is that such an injected dylib counts as a use of the original dylib. This patch gets this mostly right (if _only_ `$ld$previous` symbols are used from a dylib, we don't add a dep on the dylib itself, matching ld64), but one case where we don't match ld64 yet is that ld64 even omits the original dylib when linking it with `-needed-l`. Lld currently still adds a load command for the original dylib in that case. (That's for a future patch.)
Fixes #56074.
Differential Revision: https://reviews.llvm.org/D130725
(cherry picked from commit 241f0e8b76d544a4a07a7f775b8421632539be19)
show more ...
|
| #
595fc59f |
| 25-Jul-2022 |
Daniel Bertalan <[email protected]> |
Reland "[lld-macho] Implement -load_hidden"
This flag was introduced in ld64-609. It instructs the linker to link to a static library while treating its symbols as if they had hidden visibility. Thi
Reland "[lld-macho] Implement -load_hidden"
This flag was introduced in ld64-609. It instructs the linker to link to a static library while treating its symbols as if they had hidden visibility. This is useful when building a dylib that links to static libraries but we don't want the symbols from those to be exported.
Closes #51505
This reland adds bitcode file handling, so we won't get any compile errors due to BitcodeFile::forceHidden being unused.
Differential Revision: https://reviews.llvm.org/D130473
show more ...
|
| #
9bf1c6da |
| 25-Jul-2022 |
Daniel Bertalan <[email protected]> |
Revert "[lld-macho] Implement -load_hidden"
This reverts commit 4c79e1a3f4eb790f40239833ae237e828ce07386.
Broke this bot: https://lab.llvm.org/buildbot/#builders/57/builds/20319
|
| #
4c79e1a3 |
| 25-Jul-2022 |
Daniel Bertalan <[email protected]> |
[lld-macho] Implement -load_hidden
This flag was introduced in ld64-609. It instructs the linker to link to a static library while treating its symbols as if they had hidden visibility. This is usef
[lld-macho] Implement -load_hidden
This flag was introduced in ld64-609. It instructs the linker to link to a static library while treating its symbols as if they had hidden visibility. This is useful when building a dylib that links to static libraries but we don't want the symbols from those to be exported.
Closes #51505
Differential Revision: https://reviews.llvm.org/D130473
show more ...
|
| #
7d57c698 |
| 11-Jun-2022 |
Keith Smiley <[email protected]> |
[lld-macho] Add support for -w
This flag suppresses warnings produced by the linker. In ld64 this has an interesting interaction with -fatal_warnings, it silences the warnings but the link still fai
[lld-macho] Add support for -w
This flag suppresses warnings produced by the linker. In ld64 this has an interesting interaction with -fatal_warnings, it silences the warnings but the link still fails. Instead of doing that here we still print the warning and eagerly fail the link in case both are passed, this seems more reasonable so users can understand why the link fails.
Differential Revision: https://reviews.llvm.org/D127564
show more ...
|
|
Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2 |
|
| #
3254f468 |
| 22-Apr-2022 |
Nico Weber <[email protected]> |
[lld/mac] For catalyst outputs, tolerate implicitly linking against mac-only tbd files
Before this,
clang empty.cc -target x86_64-apple-ios13.1-macabi \ -framework CoreServices -fuse-ld=lld
[lld/mac] For catalyst outputs, tolerate implicitly linking against mac-only tbd files
Before this,
clang empty.cc -target x86_64-apple-ios13.1-macabi \ -framework CoreServices -fuse-ld=lld
would error out with
ld64.lld: error: path/to/MacOSX.sdk/System/Library/Frameworks/ CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/ Versions/A/CarbonCore.tbd( /System/Library/Frameworks/ CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/ Versions/A/CarbonCore) is incompatible with x86_64 (macCatalyst)
Now it works, like with ld64.
Differential Revision: https://reviews.llvm.org/D124336
show more ...
|
|
Revision tags: llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3 |
|
| #
83d59e05 |
| 20-Jan-2022 |
Alexandre Ganea <[email protected]> |
Re-land [LLD] Remove global state in lldCommon
Move all variables at file-scope or function-static-scope into a hosting structure (lld::CommonLinkerContext) that lives at lldMain()-scope. Drivers wi
Re-land [LLD] Remove global state in lldCommon
Move all variables at file-scope or function-static-scope into a hosting structure (lld::CommonLinkerContext) that lives at lldMain()-scope. Drivers will inherit from this structure and add their own global state, in the same way as for the existing COFFLinkerContext.
See discussion in https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html
The previous land f860fe362282ed69b9d4503a20e5d20b9a041189 caused issues in https://lab.llvm.org/buildbot/#/builders/123/builds/8383, fixed by 22ee510dac9440a74b2e5b3fe3ff13ccdbf55af3.
Differential Revision: https://reviews.llvm.org/D108850
show more ...
|
| #
e6b15394 |
| 16-Jan-2022 |
Alexandre Ganea <[email protected]> |
Revert [LLD] Remove global state in lldCommon
It seems to be causing issues on https://lab.llvm.org/buildbot/#/builders/123/builds/8383
|
| #
f860fe36 |
| 16-Jan-2022 |
Alexandre Ganea <[email protected]> |
[LLD] Remove global state in lldCommon
Move all variables at file-scope or function-static-scope into a hosting structure (lld::CommonLinkerContext) that lives at lldMain()-scope. Drivers will inher
[LLD] Remove global state in lldCommon
Move all variables at file-scope or function-static-scope into a hosting structure (lld::CommonLinkerContext) that lives at lldMain()-scope. Drivers will inherit from this structure and add their own global state, in the same way as for the existing COFFLinkerContext.
See discussion in https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html
Differential Revision: https://reviews.llvm.org/D108850
show more ...
|
|
Revision tags: llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
| #
0f6d720f |
| 30-Oct-2021 |
Shoaib Meenai <[email protected]> |
[MachO] Properly reset global state
We need to reset global state between runs, similar to the other ports. There's some file-static state which needs to be reset as well and we need to add some new
[MachO] Properly reset global state
We need to reset global state between runs, similar to the other ports. There's some file-static state which needs to be reset as well and we need to add some new helpers for that.
With this change, most LLD Mach-O tests pass with `LLD_IN_TEST=2` (which runs the linker twice on each test). Some tests will be fixed by the remainder of this stack, and the rest are fundamentally incompatible with that mode (e.g. they intentionally throw fatal errors).
Fixes PR52070.
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D112878
show more ...
|
| #
aab0f226 |
| 20-Oct-2021 |
Kaining Zhong <[email protected]> |
[lld-macho] Fix dangling string reference when adding frameworks
In Driver.cpp, addFramework used std::string instance to represent the path of a framework, which will be freed after the function re
[lld-macho] Fix dangling string reference when adding frameworks
In Driver.cpp, addFramework used std::string instance to represent the path of a framework, which will be freed after the function returns. However, this string is stored in loadedArchive, which will be used later to compare with path of newly added frameworks. This caused https://bugs.llvm.org/show_bug.cgi?id=52133. A test is included in this commit to reproduce this bug.
Now resolveDylibPath returns a StringRef instance, and it uses StringSaver to save its data, then returns it to functions on the top. This ensures the resolved framework path is still valid after LC_LINKER_OPTION is parsed.
Reviewed By: int3, #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D111706
show more ...
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4 |
|
| #
ed2f0ad3 |
| 14-Sep-2021 |
Nico Weber <[email protected]> |
[lld/mac] Search .tbd before binary for framework files too
This matters for example for the iPhoneSimulator14.0.sdk, which has a System/Library/Frameworks/UIKit.framework/UIKit that has LC_BUILD_VE
[lld/mac] Search .tbd before binary for framework files too
This matters for example for the iPhoneSimulator14.0.sdk, which has a System/Library/Frameworks/UIKit.framework/UIKit that has LC_BUILD_VERSION with minos of 14.0, so linking against that file will produce warnings like:
.../iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit has version 14.0.0, which is newer than target minimum of 12.0.0
when targeting x86_64-apple-ios12.0-simulator. That doens't happen when linking against UIKit.tbd instead, obviously.
Linking with RC_TRACE_DYLIB_SEARCHING=1 shows that ld64 also searches the tbd file first, and we already get that right for non-framework dylibs.
Fixes crbug.com/1249456.
Differential Revision: https://reviews.llvm.org/D109768
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2 |
|
| #
9065fe55 |
| 26-Aug-2021 |
Jez Ng <[email protected]> |
[lld-macho] Refactor archive loading
The previous logic was duplicated between symbol-initiated archive loads versus flag-initiated loads (i.e. `-force_load` and `-ObjC`). This resulted in code dupl
[lld-macho] Refactor archive loading
The previous logic was duplicated between symbol-initiated archive loads versus flag-initiated loads (i.e. `-force_load` and `-ObjC`). This resulted in code duplication as well as redundant work -- we would create Archive instances twice whenever we had one of those flags; once in `getArchiveMembers` and again when we constructed the ArchiveFile.
This was motivated by an upcoming diff where we load archive members containing ObjC-related symbols before loading those containing ObjC-related sections, as well as before performing symbol resolution. Without this refactor, it would be difficult to do that while avoiding loading the same archive member twice.
Differential Revision: https://reviews.llvm.org/D108780
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init |
|
| #
5acc6d45 |
| 23-Jul-2021 |
Leonard Grey <[email protected]> |
[lld-macho] Disambiguate bitcode files with the same name by archive name/offset in archive
Ported from COFF/ELF; test is adapted from test/COFF/thinlto-archivecollision.ll
LTO expects every bitcod
[lld-macho] Disambiguate bitcode files with the same name by archive name/offset in archive
Ported from COFF/ELF; test is adapted from test/COFF/thinlto-archivecollision.ll
LTO expects every bitcode file to have a unique name. If given multiple bitcode files with the same name, it errors with "Expected at most one ThinLTO module per bitcode file".
This change incorporates the archive name, to disambiguate members with the same name in different archives and the offset in archive to disambiguate members with the same name in the same archive.
Differential Revision: https://reviews.llvm.org/D106179
show more ...
|
| #
28a2102e |
| 11-Jul-2021 |
Jez Ng <[email protected]> |
[lld-macho][nfc] Remove unnecessary llvm:: namespace prefixes
|
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3 |
|
| #
f1e2d585 |
| 24-Jun-2021 |
Fangrui Song <[email protected]> |
[OptTable] Rename PrintHelp to printHelp
To be consistent with other member functions and match the coding standard.
|
| #
a79c0183 |
| 19-Jun-2021 |
Jez Ng <[email protected]> |
Revert "[lld-macho] Have path-related functions return std::string, not StringRef"
This reverts commit 1d31fb8d122b1117cf20a9edc09812db8472e930.
Making `rerootPath` return a temporary std::string c
Revert "[lld-macho] Have path-related functions return std::string, not StringRef"
This reverts commit 1d31fb8d122b1117cf20a9edc09812db8472e930.
Making `rerootPath` return a temporary std::string caused a use-after-free:
https://ci.chromium.org/ui/p/chromium/builders/try/win_upload_clang/1608/overview
show more ...
|
| #
1d31fb8d |
| 18-Jun-2021 |
Jez Ng <[email protected]> |
[lld-macho] Have path-related functions return std::string, not StringRef
findLibrary() returned a StringRef while findFramework & other helper functions returned std::strings. Standardize on std::s
[lld-macho] Have path-related functions return std::string, not StringRef
findLibrary() returned a StringRef while findFramework & other helper functions returned std::strings. Standardize on std::string.
(I initially tried making the helper functions all return StringRefs, but I realized we shouldn't return input StringRefs since their lifetimes would not be obvious from the calling code.)
show more ...
|
|
Revision tags: llvmorg-12.0.1-rc2 |
|
| #
e87c095a |
| 09-Jun-2021 |
Nico Weber <[email protected]> |
[lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING
For debugging dylib loading, it's useful to have some insight into what the linker is doing.
ld64 has the
[lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING
For debugging dylib loading, it's useful to have some insight into what the linker is doing.
ld64 has the undocumented RC_TRACE_DYLIB_SEARCHING env var for this printing dylib search candidates.
This adds a flag --print-dylib-search to make lld print the seame information. It's useful for users, but also for writing tests. The output is formatted slightly differently than ld64, but we still support RC_TRACE_DYLIB_SEARCHING to offer at least a compatible way to trigger this.
ld64 has both `-print_statistics` and `-trace_symbol_output` to enable diagnostics output. I went with "print" since that seems like a more straightforward name.
Differential Revision: https://reviews.llvm.org/D103985
show more ...
|
| #
c5ffe979 |
| 07-Jun-2021 |
Nico Weber <[email protected]> |
[lld/mac] Implement support for searching dylibs with @rpath/ in install name
Also adjust a few comments, and move the DylibFile comment talking about umbrella next to the parameter again.
Differen
[lld/mac] Implement support for searching dylibs with @rpath/ in install name
Also adjust a few comments, and move the DylibFile comment talking about umbrella next to the parameter again.
Differential Revision: https://reviews.llvm.org/D103783
show more ...
|
| #
6881f29a |
| 03-Jun-2021 |
Jez Ng <[email protected]> |
[lld-macho] Parse re-exports of nested TAPI documents
D103423 neglected to call `parseReexports()` for nested TBD documents, leading to symbol resolution failures when trying to look up a symbol nes
[lld-macho] Parse re-exports of nested TAPI documents
D103423 neglected to call `parseReexports()` for nested TBD documents, leading to symbol resolution failures when trying to look up a symbol nested more than one level deep in a TBD file. This fixes the regression and adds a test.
It also appears that `umbrella` wasn't being set properly when calling `parseLoadCommands` -- it's supposed to resolve to `this` if `nullptr` is passed. I didn't write a failing test case for this but I've made `umbrella` a member so the previous behavior should be preserved.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D103586
show more ...
|
| #
476e4d65 |
| 02-Jun-2021 |
Nico Weber <[email protected]> |
[lld/mac] Address review feedback and improve a comment
I forgot to move the message() call around as requested in D103428 before committing that change. Move it now.
Also, improve the ordinal uniq
[lld/mac] Address review feedback and improve a comment
I forgot to move the message() call around as requested in D103428 before committing that change. Move it now.
Also, improve the ordinal uniq'ing comment. I hadn't realized that the distinct-but-identical files happen with --reproduce and not in general.
No behavior change.
Differential Revision: https://reviews.llvm.org/D103522
show more ...
|
| #
222a88a2 |
| 31-May-2021 |
Nico Weber <[email protected]> |
[lld/mac] Make -t work correctly with -flat_namespace
We used to not print dylibs referenced by other dylibs in `-t` mode. This affected reexports, and with `-flat_namespace` also just dylibs loaded
[lld/mac] Make -t work correctly with -flat_namespace
We used to not print dylibs referenced by other dylibs in `-t` mode. This affected reexports, and with `-flat_namespace` also just dylibs loaded by dylibs. Now we print them.
Fixes PR49514.
Differential Revision: https://reviews.llvm.org/D103428
show more ...
|
| #
8f89c054 |
| 01-Jun-2021 |
Vy Nguyen <[email protected]> |
[lld-macho][nfc] Remove unnecessary use of Optional<T*>
In all of these cases, the functions could simply return a nullptr instead of {}. There is no case where Optional<nullptr> has a special meani
[lld-macho][nfc] Remove unnecessary use of Optional<T*>
In all of these cases, the functions could simply return a nullptr instead of {}. There is no case where Optional<nullptr> has a special meaning.
Differential Revision: https://reviews.llvm.org/D103489
show more ...
|
| #
8d80139c |
| 01-Jun-2021 |
Nico Weber <[email protected]> |
[lld/mac] fix test failure after 24979e111
If there is an error reading the dylib, we shouldn't try to load its reexports.
Caught e.g. by https://lab.llvm.org/buildbot/#/builders/36/builds/8946
|