This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Ignore -platform_version and -syslibroot flags.
ClosedPublic

Authored by thakis on May 12 2020, 11:04 AM.

Details

Summary

clang passes these flags; this makes it easier to try clang -v
output with ld -flavor darwinnew.

Diff Detail

Event Timeline

thakis created this revision.May 12 2020, 11:04 AM
int3 accepted this revision.May 12 2020, 2:08 PM

Thanks for putting this up!

lld/test/MachO/platform-version.test
11–12

not sure this test really fits into this file, but not a big deal I guess

15

I've written other flag tests (specifically silent-ignore.test) using -v instead so that the lack of an input file doesn't result in an error.

Speaking of which, could you add -syslibroot to the silent-ignore.test? Thanks!

This revision is now accepted and ready to land.May 12 2020, 2:08 PM
thakis marked 2 inline comments as done.May 12 2020, 4:16 PM

Thanks! Submitting.

lld/test/MachO/platform-version.test
11–12

The idea is to test that the 4th parameter after -platform_version isn't ignored. Passing a non-existent input was the best thing I could think of. I guess I could try a -l flag instead and then pass an existing input that needs the -l to successfully link, but it's a bit more boilerplate. Let me know if you prefer that and I'll change it in a follow-up.

15

For the other ignored flags that works because they don't need any code. But -v makes lld exit before the option parsing loop modified in this change runs, so it doesn't work for -platform_version.

I added a test for -syslibroot, thanks.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2020, 4:43 PM
int3 marked an inline comment as done.May 12 2020, 5:32 PM
int3 added inline comments.
lld/test/MachO/platform-version.test
11–12

Ah got it. It's fine this way, thanks!