[clang] [Driver] Also respect SysRoot for the system library paths on DragonFly (PR #66056)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 10:08:07 PDT 2023


================
@@ -4,6 +4,27 @@
 // CHECK: "-cc1" "-triple" "x86_64-pc-dragonfly"
 // CHECK: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/usr/libexec/ld-elf.so.{{.*}}" "--hash-style=gnu" "--enable-new-dtags" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-L{{.*}}gcc{{.*}}" "-rpath" "{{.*}}gcc{{.*}}" "-lc" "-lgcc" "{{.*}}crtend.o" "{{.*}}crtn.o"
 
+// Check x86_64-unknown-dragonfly, X86_64
+// RUN: %clang -### %s 2>&1 --target=x86_64-unknown-dragonfly \
+// RUN:     --gcc-toolchain="" \
+// RUN:     --sysroot=%S/Inputs/basic_dragonfly_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-X86_64 %s
+// CHECK-LD-X86_64: "-cc1" "-triple" "x86_64-unknown-dragonfly"
+// CHECK-LD-X86_64-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD-X86_64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD-X86_64-SAME: "[[SYSROOT]]/usr/lib/crt1.o"
+// CHECK-LD-X86_64-SAME: "[[SYSROOT]]/usr/lib/crti.o"
+// CHECK-LD-X86_64-SAME: "[[SYSROOT]]/usr/lib/gcc80/crtbegin.o"
+// CHECK-LD-X86_64-SAME: "-L[[SYSROOT]]/usr/lib/gcc80"
+// CHECK-LD-X86_64-SAME: "-rpath" "/usr/lib/gcc80"
+// CHECK-LD-X86_64-SAME: "-lc"
----------------
MaskRay wrote:

We can pack some options on one line to additionally test that they are adjacent.

https://github.com/llvm/llvm-project/pull/66056


More information about the cfe-commits mailing list