[PATCH] D79797: [lld-macho] Ignore -platform_version and -syslibroot flags.

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 16:43:02 PDT 2020


thakis marked 2 inline comments as done.
thakis added a comment.

Thanks! Submitting.



================
Comment at: lld/test/MachO/platform-version.test:11-12
+# RUN:     | FileCheck --check-prefix=GOOD %s
+# RUN: not lld -flavor darwinnew -platform_version macos 10.15 10.15.4 foobar 2>&1 \
+# RUN:     | FileCheck --check-prefix=FAIL_FILE %s
+
----------------
int3 wrote:
> not sure this test really fits into this file, but not a big deal I guess
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.


================
Comment at: lld/test/MachO/platform-version.test:15
+FAIL: usage: -platform_version platform min_version sdk_version
+GOOD: undefined symbol: _main
+FAIL_FILE: cannot open foobar
----------------
int3 wrote:
> 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!
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.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79797/new/

https://reviews.llvm.org/D79797





More information about the llvm-commits mailing list