This way we will compile the test program with `-Xlinker
-headerpad_max_install_names`, which will allow
`swift-darwin-postprocess.py` to amend the install names without errors.
Take the chance to remove the `-target` parameter -- that is already
provided by %target-swiftc_driver, and we have no need to enforce it to
be at least `macosx10.11` (since by virtue of build-script defaults and
Xcode in CI we don't support anything lower than `macosx10.13`)
Addresses rdar://119907089
There's no reason to use -m${platform}-version-min as of clang-11/Xcode 11. Clang is now smart enough to parse -target and provide Apple's ld with the appropriate -platform_version argument string.
Most of the changes fall into a few categories:
* Replace explicit "x86_64" with %target-cpu in lit tests
* Cope with architecture differences in IR/asm/etc. macOS-specific tests
Without %target-run, DYLD_LIBRARY_PATH won’t apply and the target will try to load OS-supplied libraries rather than the ones we just built even if use_os_stdlib isn’t enabled.
This reverts commit 8247525471. While
correct, it has uncovered several issues in existing code bases that
need to be sorted out before we can land it again.
Fixes rdar://problem/57846390.
Today in far more cases we are using mangled strings to look up metadata at
runtime. If we do this for an objc class but for whatever reason we do not have
any other references to the class, the static linker will fail to link in the
relevant framework. The reason why this happens is that autolinking is treated
by the static linker as a hint that a framework may be needed rather than as a
"one must link against the framework". If there aren't any undefined symbols
needed by the app from that framework, the linker just will ignore the hint. Of
course this then causes the class lookup to fail at runtime when we use our
mangled name to try to lookup the class.
I included an Interpreter test as well as IRGen tests to make sure that we do
not regress here in the future.
NOTE: The test modifications here are due to my moving the ObjCClasses framework
out of ./test/Interpreters/Inputs => test/Inputs since I am using it in the
IRGen test along side the interpreter test.
rdar://56136123
The ObjC runtime on OS X 10.10 and older and iOS 9 and older can't
handle them, so for these targets, emit nil for all class property
lists.
It's a little unfortunate that this is target-dependent, but there's
not much we can do about it.
rdar://problem/25605427