[lld-macho] Reject -no_pie for unsupported archs
authorKeith Smiley <keithbsmiley@gmail.com>
Tue, 29 Nov 2022 01:44:53 +0000 (17:44 -0800)
committerKeith Smiley <keithbsmiley@gmail.com>
Tue, 29 Nov 2022 19:17:08 +0000 (11:17 -0800)
commitc702bf1400fbc7fc1e54b0efc8cd934291fd81a2
tree17cccdaddf73b086d8469427e4cee7bdfbc37d89
parentb42cb2d60171dc402e7ad999f20b93b76dfa6c42
[lld-macho] Reject -no_pie for unsupported archs

ld64 rejects `-no_pie` when targeting arm64, this mirrors that behavior.
Newer versions of ld64 also reject it based on minimum OS versions, but
that logic isn't in an open source dump yet so it isn't implemented
here.

Fixes https://github.com/llvm/llvm-project/issues/59115

Differential Revision: https://reviews.llvm.org/D138884
lld/MachO/Driver.cpp
lld/test/MachO/no-pie.s [new file with mode: 0644]