2020-09-19 12:40:12 +08:00
|
|
|
# -*- Python -*-
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
2021-04-16 09:14:32 +08:00
|
|
|
# We specify the most commonly-used archs and platform versions in our tests
|
|
|
|
# here. Tests which need different settings can just append to this, as only
|
|
|
|
# the last value will be used.
|
2021-03-04 04:52:10 +08:00
|
|
|
#
|
|
|
|
# Note however that this does not apply to `-syslibroot`: each instance of that
|
2021-04-16 09:14:32 +08:00
|
|
|
# flag will append to the set of library roots. As such, we define a separate
|
|
|
|
# alias for each platform.
|
|
|
|
|
|
|
|
config.substitutions.append(('%lld-watchos',
|
|
|
|
'ld64.lld -fatal_warnings -arch arm64_32 -platform_version watchos 7.0 8.0 -syslibroot ' +
|
|
|
|
os.path.join(config.test_source_root, "MachO", "Inputs", "WatchOS.sdk")))
|
|
|
|
|
|
|
|
# Since most of our tests are written around x86_64, we give this platform the
|
|
|
|
# shortest substitution of "%lld".
|
[lld-macho] Have tests default to targeting macos 10.15
D101114 enforced proper version checks, which exposed a variety of version
mismatch issues in our tests. We previously changed the test inputs to
target 10.0, which was the simpler thing to do, but we should really
just have our lit.local.cfg default to targeting 10.15, which is what is done
here. We're not likely to ever have proper support for the older versions
anyway, as that would require more work for unclear benefit; for instance,
llvm-mc seems to generate a different compact unwind format for older macOS
versions, which would cause our compact-unwind.s test to fail.
Targeting 10.15 by default causes the following behavioral changes:
* `__mh_execute_header` is now a section symbol instead of an absolute symbol
* LC_BUILD_VERSION gets emitted instead of LC_VERSION_MIN_MACOSX. The former is
32 bytes in size whereas the latter is 16 bytes, so a bunch of hardcoded
address offsets in our tests had to be updated.
* >= 10.6 executables are PIE by default
Note that this diff was stacked atop of a local revert of most of the test
changes in rG8c17a875150f8e736e8f9061ddf084397f45f4c5, to make review easier.
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D101119
2021-04-23 07:37:47 +08:00
|
|
|
lld = ('ld64.lld -arch x86_64 -platform_version macos 10.15 11.0 -syslibroot ' +
|
2020-12-03 22:35:25 +08:00
|
|
|
os.path.join(config.test_source_root, "MachO", "Inputs", "MacOSX.sdk"))
|
|
|
|
config.substitutions.append(('%lld', lld + ' -fatal_warnings'))
|
|
|
|
config.substitutions.append(('%no_fatal_warnings_lld', lld))
|