[lld-macho] Require -arch and -platform_version to always be specified
authorJez Ng <jezng@fb.com>
Wed, 3 Mar 2021 20:52:10 +0000 (15:52 -0500)
committerJez Ng <jezng@fb.com>
Wed, 3 Mar 2021 20:52:10 +0000 (15:52 -0500)
commitb63919e18001500c1b549ae0ce2440944e1df8e7
treed5fea60fbc86db43aab3b14441a415e7e36dbcbf
parent1168736c668872d7e0000a64daf63dff1c242f80
[lld-macho] Require -arch and -platform_version to always be specified

We previously defaulted to x86_64 and an unknown platform, which was fine when
we only supported one arch and did no platform checks, but that will no longer
be true going ahead. Therefore, we should require those flags to be specified
whenever the linker is invoked.

Note that LLD-ELF and ld64 both infer the arch from their input object files,
but the usefulness of that is questionable since clang will always specify these
flags, and most of the time `lld` will be invoked via clang.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D97799
lld/MachO/Driver.cpp
lld/MachO/InputFiles.cpp
lld/test/MachO/lit.local.cfg
lld/test/MachO/syslibroot.test