[PATCH] D45145: [Driver] Wire up the -f[no-]rtlib-add-rpath flag and tests
This revision was automatically updated to reflect the committed changes. Closed by commit rL329032: [Driver] Wire up the -f[no-]rtlib-add-rpath flag and tests (authored by phosek, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D45145?vs=140668=140708#toc Repository: rL LLVM https://reviews.llvm.org/D45145 Files: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp cfe/trunk/test/Driver/arch-specific-libdir-rpath.c Index: cfe/trunk/test/Driver/arch-specific-libdir-rpath.c === --- cfe/trunk/test/Driver/arch-specific-libdir-rpath.c +++ cfe/trunk/test/Driver/arch-specific-libdir-rpath.c @@ -6,15 +6,14 @@ // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -fsanitize=address -shared-libasan \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ -// RUN: -frtlib-add-rpath \ // RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Test that -rpath is not added under -fno-rtlib-add-rpath even if other // conditions are met. // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -fsanitize=address -shared-libasan \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ -// RUN: -frtlib-add-rpath \ +// RUN: -fno-rtlib-add-rpath \ // RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Test that -rpath is added only under the right circumstance even if @@ -24,13 +23,13 @@ // RUN: %clang %s -### 2>&1 -target x86_64-linux -fsanitize=undefined \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Add LIBPATH but no RPATH for -fsanitizer=address w/o -shared-libasan // RUN: %clang %s -### 2>&1 -target x86_64-linux -fsanitize=undefined \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Add LIBPATH, RPATH for -fsanitize=address -shared-libasan // RUN: %clang %s -### 2>&1 -target x86_64-linux \ @@ -44,7 +43,7 @@ // RUN: -fsanitize=address -shared-libasan \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-AArch64,RPATH-AArch64 %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-AARCH64,RPATH-AARCH64 %s // // Add LIBPATH, RPATH with -fsanitize=address for Android // RUN: %clang %s -### 2>&1 -target x86_64-linux-android -fsanitize=address \ @@ -62,24 +61,30 @@ // RUN: %clang %s -### 2>&1 -fsanitize=undefined -target x86_64-linux \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Add LIBPATH but no RPATH if no sanitizer or runtime is specified // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Do not add LIBPATH or RPATH if arch-specific subdir doesn't exist // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: -frtlib-add-rpath \ // RUN: | FileCheck --check-prefixes=RESDIR,NO-LIBPATH,NO-RPATH %s -// + // RESDIR: "-resource-dir" "[[RESDIR:[^"]*]]" -// LIBPATH-X86_64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}} -// RPATH-X86_64:"-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}}" -// LIBPATH-AArch64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}} -// RPATH-AArch64: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}}" -// NO-LIBPATH-NOT: "-L{{[^"]*Inputs(/|)resource_dir}}" -// NO-RPATH-NOT:"-rpath" {{.*(/|)Inputs(/|)resource_dir}} +// +// LIBPATH-X86_64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}} +// RPATH-X86_64: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}}" +// +// NO-LIBPATH-X86_64-NOT: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}} +// NO-RPATH-X86_64-NOT: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}}" +// +// LIBPATH-AARCH64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}} +// RPATH-AAARCH4: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}}" +// +// NO-LIBPATH-NOT: "-L{{[^"]*Inputs(/|)resource_dir}}" +// NO-RPATH-NOT: "-rpath"
[PATCH] D45145: [Driver] Wire up the -f[no-]rtlib-add-rpath flag and tests
phosek updated this revision to Diff 140668. phosek added a comment. Thanks for the suggestion, I don't think we even need to rename the function since this already matches the pattern other functions use. Repository: rC Clang https://reviews.llvm.org/D45145 Files: clang/lib/Driver/ToolChains/CommonArgs.cpp clang/test/Driver/arch-specific-libdir-rpath.c Index: clang/test/Driver/arch-specific-libdir-rpath.c === --- clang/test/Driver/arch-specific-libdir-rpath.c +++ clang/test/Driver/arch-specific-libdir-rpath.c @@ -6,15 +6,14 @@ // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -fsanitize=address -shared-libasan \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ -// RUN: -frtlib-add-rpath \ // RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Test that -rpath is not added under -fno-rtlib-add-rpath even if other // conditions are met. // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -fsanitize=address -shared-libasan \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ -// RUN: -frtlib-add-rpath \ +// RUN: -fno-rtlib-add-rpath \ // RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Test that -rpath is added only under the right circumstance even if @@ -24,13 +23,13 @@ // RUN: %clang %s -### 2>&1 -target x86_64-linux -fsanitize=undefined \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Add LIBPATH but no RPATH for -fsanitizer=address w/o -shared-libasan // RUN: %clang %s -### 2>&1 -target x86_64-linux -fsanitize=undefined \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Add LIBPATH, RPATH for -fsanitize=address -shared-libasan // RUN: %clang %s -### 2>&1 -target x86_64-linux \ @@ -44,7 +43,7 @@ // RUN: -fsanitize=address -shared-libasan \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-AArch64,RPATH-AArch64 %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-AARCH64,RPATH-AARCH64 %s // // Add LIBPATH, RPATH with -fsanitize=address for Android // RUN: %clang %s -### 2>&1 -target x86_64-linux-android -fsanitize=address \ @@ -62,24 +61,30 @@ // RUN: %clang %s -### 2>&1 -fsanitize=undefined -target x86_64-linux \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Add LIBPATH but no RPATH if no sanitizer or runtime is specified // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Do not add LIBPATH or RPATH if arch-specific subdir doesn't exist // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: -frtlib-add-rpath \ // RUN: | FileCheck --check-prefixes=RESDIR,NO-LIBPATH,NO-RPATH %s -// + // RESDIR: "-resource-dir" "[[RESDIR:[^"]*]]" -// LIBPATH-X86_64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}} -// RPATH-X86_64:"-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}}" -// LIBPATH-AArch64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}} -// RPATH-AArch64: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}}" -// NO-LIBPATH-NOT: "-L{{[^"]*Inputs(/|)resource_dir}}" -// NO-RPATH-NOT:"-rpath" {{.*(/|)Inputs(/|)resource_dir}} +// +// LIBPATH-X86_64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}} +// RPATH-X86_64: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}}" +// +// NO-LIBPATH-X86_64-NOT: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}} +// NO-RPATH-X86_64-NOT: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}}" +// +// LIBPATH-AARCH64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}} +// RPATH-AAARCH4: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}}" +// +// NO-LIBPATH-NOT: "-L{{[^"]*Inputs(/|)resource_dir}}" +// NO-RPATH-NOT: "-rpath" {{.*(/|)Inputs(/|)resource_dir}} Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
[PATCH] D45145: [Driver] Wire up the -f[no-]rtlib-add-rpath flag and tests
pirama added a comment. Hi Petr, thanks for the fix (I dropped the ball on this one :( ). Instead of duplicating the checks, does it make sense to fold check into addArchSpecificRPath and rename it to 'addArchSpecificRPathIfRequested' or something similar? Repository: rC Clang https://reviews.llvm.org/D45145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D45145: [Driver] Wire up the -f[no-]rtlib-add-rpath flag and tests
phosek created this revision. phosek added reviewers: rnk, pirama, bkramer, mgorny. Herald added a subscriber: cfe-commits. https://reviews.llvm.org/D30700 added the -f[no-]rtlib-add-rpath flag, but that flag was never wired up in the driver and tests were updated to check whether it actually does anything. This patch wires up the flag and updates test. Repository: rC Clang https://reviews.llvm.org/D45145 Files: clang/lib/Driver/ToolChains/CommonArgs.cpp clang/test/Driver/arch-specific-libdir-rpath.c Index: clang/test/Driver/arch-specific-libdir-rpath.c === --- clang/test/Driver/arch-specific-libdir-rpath.c +++ clang/test/Driver/arch-specific-libdir-rpath.c @@ -6,15 +6,14 @@ // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -fsanitize=address -shared-libasan \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ -// RUN: -frtlib-add-rpath \ // RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Test that -rpath is not added under -fno-rtlib-add-rpath even if other // conditions are met. // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -fsanitize=address -shared-libasan \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ -// RUN: -frtlib-add-rpath \ +// RUN: -fno-rtlib-add-rpath \ // RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Test that -rpath is added only under the right circumstance even if @@ -24,13 +23,13 @@ // RUN: %clang %s -### 2>&1 -target x86_64-linux -fsanitize=undefined \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Add LIBPATH but no RPATH for -fsanitizer=address w/o -shared-libasan // RUN: %clang %s -### 2>&1 -target x86_64-linux -fsanitize=undefined \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Add LIBPATH, RPATH for -fsanitize=address -shared-libasan // RUN: %clang %s -### 2>&1 -target x86_64-linux \ @@ -44,7 +43,7 @@ // RUN: -fsanitize=address -shared-libasan \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-AArch64,RPATH-AArch64 %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-AARCH64,RPATH-AARCH64 %s // // Add LIBPATH, RPATH with -fsanitize=address for Android // RUN: %clang %s -### 2>&1 -target x86_64-linux-android -fsanitize=address \ @@ -62,24 +61,30 @@ // RUN: %clang %s -### 2>&1 -fsanitize=undefined -target x86_64-linux \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Add LIBPATH but no RPATH if no sanitizer or runtime is specified // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \ // RUN: -frtlib-add-rpath \ -// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH %s +// RUN: | FileCheck --check-prefixes=RESDIR,LIBPATH-X86_64,NO-RPATH-X86_64 %s // // Do not add LIBPATH or RPATH if arch-specific subdir doesn't exist // RUN: %clang %s -### 2>&1 -target x86_64-linux \ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: -frtlib-add-rpath \ // RUN: | FileCheck --check-prefixes=RESDIR,NO-LIBPATH,NO-RPATH %s -// + // RESDIR: "-resource-dir" "[[RESDIR:[^"]*]]" -// LIBPATH-X86_64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}} -// RPATH-X86_64:"-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}}" -// LIBPATH-AArch64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}} -// RPATH-AArch64: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}}" -// NO-LIBPATH-NOT: "-L{{[^"]*Inputs(/|)resource_dir}}" -// NO-RPATH-NOT:"-rpath" {{.*(/|)Inputs(/|)resource_dir}} +// +// LIBPATH-X86_64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}} +// RPATH-X86_64: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}}" +// +// NO-LIBPATH-X86_64-NOT: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}} +// NO-RPATH-X86_64-NOT: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)x86_64}}" +// +// LIBPATH-AARCH64: -L[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}} +// RPATH-AAARCH4: "-rpath" "[[RESDIR]]{{(/|)lib(/|)linux(/|)aarch64}}" +// +// NO-LIBPATH-NOT: "-L{{[^"]*Inputs(/|)resource_dir}}" +//