This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Reject -no_pie for unsupported archs
ClosedPublic

Authored by keith on Nov 28 2022, 5:46 PM.

Details

Reviewers
MaskRay
phosek
int3
Group Reviewers
Restricted Project
Commits
rGc702bf1400fb: [lld-macho] Reject -no_pie for unsupported archs
Summary

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

Diff Detail

Event Timeline

keith created this revision.Nov 28 2022, 5:46 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 28 2022, 5:46 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
keith requested review of this revision.Nov 28 2022, 5:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 5:46 PM
MaskRay accepted this revision as: MaskRay.Nov 28 2022, 6:30 PM
MaskRay added a subscriber: MaskRay.
MaskRay added inline comments.
lld/test/MachO/no-pie.s
6

A non-arm64 example is useful as well.

This revision is now accepted and ready to land.Nov 28 2022, 6:30 PM
phosek accepted this revision.Nov 28 2022, 10:29 PM
phosek added a subscriber: phosek.

LGTM thanks for the quick fix.

int3 accepted this revision.Nov 29 2022, 7:08 AM
keith updated this revision to Diff 478653.Nov 29 2022, 11:13 AM
keith marked an inline comment as done.

Add x86_64 example showing -no_pie isn't rejected in that case

This revision was landed with ongoing or failed builds.Nov 29 2022, 11:17 AM
This revision was automatically updated to reflect the committed changes.