Skip to content

Commit

Permalink
[lld-macho] Don't rewrite -rpath arguments in response file
Browse files Browse the repository at this point in the history
We only want to rewrite paths to files that the linker looks up. Files
under RPATH are looked up at runtime by dyld.

Reviewed By: #lld-macho, keith

Differential Revision: https://reviews.llvm.org/D140167
  • Loading branch information
int3 committed Dec 16, 2022
1 parent 5a06334 commit b6772e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion lld/MachO/DriverUtils.cpp
Expand Up @@ -159,7 +159,6 @@ std::string macho::createResponseFile(const InputArgList &args) {
case OPT_bundle_loader:
case OPT_exported_symbols_list:
case OPT_order_file:
case OPT_rpath:
case OPT_syslibroot:
case OPT_unexported_symbols_list:
os << arg->getSpelling() << " " << quote(rewritePath(arg->getValue()))
Expand Down
2 changes: 2 additions & 0 deletions lld/test/MachO/reproduce.s
Expand Up @@ -11,6 +11,7 @@
# RUN: -exported_symbols_list main.exports \
# RUN: -order_file main.order \
# RUN: -sectcreate __COMPLETELY __legit sectdata.txt \
# RUN: -rpath /usr/lib/swift \
# RUN: build1/foo.o -o bar --reproduce repro1.tar

# RUN: tar tf repro1.tar | FileCheck -DPATH='%:t.dir' --check-prefix=LIST %s
Expand All @@ -30,6 +31,7 @@
# RSP1-NEXT: -exported_symbols_list [[BASEDIR:.+]]/main.exports
# RSP1-NEXT: -order_file [[BASEDIR]]/main.order
# RSP1-NEXT: -sectcreate __COMPLETELY __legit [[BASEDIR]]/sectdata.txt
# RSP1-NEXT: -rpath /usr/lib/swift
# RSP1-NOT: {{^}}repro1{{[/\\]}}
# RSP1-NEXT: [[BASEDIR]]/build1/foo.o
# RSP1-NEXT: -o bar
Expand Down

0 comments on commit b6772e6

Please sign in to comment.