[lld-macho] Implement -force_load_swift_libs
authorJez Ng <jezng@fb.com>
Tue, 8 Jun 2021 03:48:16 +0000 (23:48 -0400)
committerJez Ng <jezng@fb.com>
Tue, 8 Jun 2021 03:48:35 +0000 (23:48 -0400)
commit447dfbe005a7884766c7d073566eae710aa9ed5b
treee60316c50f10673d34f3c6a032d689b4ec7335d0
parent04259cde15a9fad31421e9161f160ee23f84ebdd
[lld-macho] Implement -force_load_swift_libs

It causes libraries whose names start with "swift" to be force-loaded.
Note that unlike the more general `-force_load`, this flag only applies
to libraries specified via LC_LINKER_OPTIONS, and not those passed on
the command-line. This is what ld64 does.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D103709
lld/MachO/Config.h
lld/MachO/Driver.cpp
lld/MachO/Options.td
lld/test/MachO/force-load-swift-libs.ll [new file with mode: 0644]