[PATCH] D100147: [lld-macho] Re-root absolute input file paths if -syslibroot is specified

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 9 16:46:10 PDT 2021


gkm added inline comments.


================
Comment at: lld/test/MachO/reroot-path.s:26-27
+## Test our various file-loading flags to make sure all bases are covered.
+# RUN: %lld -lSystem -syslibroot %t %t/foo.a %t/%:t/bar.a %t/test.o -o /dev/null
+# RUN: %lld -lSystem -syslibroot %t -force_load %t/foo.a -force_load %t/%:t/bar.a %t/test.o -o /dev/null
+# RUN: %lld -lSystem -syslibroot %t %t/libfoo.dylib %t/%:t/libbar.dylib %t/test.o -o /dev/null
----------------
gkm wrote:
> These don't test what you want, since they succeed even without `-syslibroot`:
> * PASS without `-syslibroot %t`, since `%t/%:t/bar.a` is a real path, so the syslibroot is unused
> * PASS with `-syslibroot %t` and s/`%t/%:t/bar.a`/`%t/bar.a`/ for a syslibroot-relative path
> * FAIL (as expected) without `-syslibroot %t` and s/`%t/%:t/bar.a`/`%t/bar.a`/, since syslibroot is needed to reach the syslibroot-relative path
I believe the second case is what you want: with `-syslibroot %t` and s/`%t/%:t/bar.a`/`%t/bar.a`/


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100147



More information about the llvm-commits mailing list