enable-SSP-and-PIE-by-default.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. From a076711d030ca5777465dab9f11c0639478a5cc8 Mon Sep 17 00:00:00 2001
  2. From: Evangelos Foutras <evangelos@foutrelis.com>
  3. Date: Tue, 26 Mar 2019 01:35:50 +0200
  4. Subject: [PATCH] Enable SSP and PIE by default
  5. This is a minimal set of changes needed to make clang use SSP and PIE by
  6. default on Arch Linux. Tests that were easy to adjust have been changed
  7. accordingly; only test/Driver/linux-ld.c has been marked as "expected
  8. failure" due to the number of changes it would require (mostly replacing
  9. crtbegin.o with crtbeginS.o).
  10. Doing so is needed in order to align clang with the new default GCC
  11. behavior in Arch which generates PIE executables by default and also
  12. defaults to -fstack-protector-strong. It is not meant to be a long term
  13. solution, but a simple temporary fix.
  14. Hopefully these changes will be obsoleted by the introduction upstream
  15. of a compile-time option (https://bugs.llvm.org/show_bug.cgi?id=13410)
  16. ---
  17. lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++--
  18. lib/Driver/ToolChains/Linux.h | 1 +
  19. test/Driver/cross-linux.c | 16 ++++++++--------
  20. test/Driver/env.c | 2 +-
  21. test/Driver/fsanitize.c | 14 +++++++-------
  22. test/Driver/gcc-toolchain.cpp | 2 +-
  23. test/Driver/hexagon-toolchain-elf.c | 2 +-
  24. test/Driver/linux-as.c | 4 ++--
  25. test/Driver/linux-ld.c | 2 ++
  26. test/Driver/ppc-abi.c | 4 ++--
  27. test/Driver/riscv32-toolchain.c | 4 ++--
  28. test/Driver/stack-protector.c | 4 ++--
  29. 12 files changed, 41 insertions(+), 28 deletions(-)
  30. diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
  31. index 65ab9b2daf..5b757b8028 100644
  32. --- a/lib/Driver/ToolChains/Linux.cpp
  33. +++ b/lib/Driver/ToolChains/Linux.cpp
  34. @@ -968,8 +968,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs,
  35. }
  36. bool Linux::isPIEDefault() const {
  37. - return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) ||
  38. - getTriple().isMusl() || getSanitizerArgs().requiresPIE();
  39. + const bool IsMips = getTriple().isMIPS();
  40. + const bool IsAndroid = getTriple().isAndroid();
  41. +
  42. + if (IsMips || IsAndroid)
  43. + return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) ||
  44. + getTriple().isMusl() || getSanitizerArgs().requiresPIE();
  45. +
  46. + return true;
  47. +}
  48. +
  49. +unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const {
  50. + return 2;
  51. }
  52. bool Linux::IsMathErrnoDefault() const {
  53. diff --git a/lib/Driver/ToolChains/Linux.h b/lib/Driver/ToolChains/Linux.h
  54. index 4a662cb4b4..4f369c6090 100644
  55. --- a/lib/Driver/ToolChains/Linux.h
  56. +++ b/lib/Driver/ToolChains/Linux.h
  57. @@ -40,6 +40,7 @@ public:
  58. CXXStdlibType GetDefaultCXXStdlibType() const override;
  59. bool isPIEDefault() const override;
  60. bool IsMathErrnoDefault() const override;
  61. + unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override;
  62. SanitizerMask getSupportedSanitizers() const override;
  63. void addProfileRTLibs(const llvm::opt::ArgList &Args,
  64. llvm::opt::ArgStringList &CmdArgs) const override;
  65. diff --git a/test/Driver/cross-linux.c b/test/Driver/cross-linux.c
  66. index a5ea832e77..1949c05a60 100644
  67. --- a/test/Driver/cross-linux.c
  68. +++ b/test/Driver/cross-linux.c
  69. @@ -42,8 +42,8 @@
  70. // CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld"
  71. // CHECK-MULTI32-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
  72. // CHECK-MULTI32-I386: "-m" "elf_i386"
  73. -// CHECK-MULTI32-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o"
  74. -// CHECK-MULTI32-I386: "-L[[gcc_install]]"
  75. +// CHECK-MULTI32-I386: "crti.o" "crtbeginS.o"
  76. +// CHECK-MULTI32-I386: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]"
  77. // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib32"
  78. // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib"
  79. // CHECK-MULTI32-I386: "-L[[sysroot]]/lib"
  80. @@ -59,8 +59,8 @@
  81. // CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld"
  82. // CHECK-MULTI32-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
  83. // CHECK-MULTI32-X86-64: "-m" "elf_x86_64"
  84. -// CHECK-MULTI32-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64{{/|\\\\}}crtbegin.o"
  85. -// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/64"
  86. +// CHECK-MULTI32-X86-64: "crti.o" "crtbeginS.o"
  87. +// CHECK-MULTI32-X86-64: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64"
  88. // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib64"
  89. // CHECK-MULTI32-X86-64: "-L[[gcc_install]]"
  90. // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib"
  91. @@ -77,8 +77,8 @@
  92. // CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld"
  93. // CHECK-MULTI64-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
  94. // CHECK-MULTI64-I386: "-m" "elf_i386"
  95. -// CHECK-MULTI64-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32{{/|\\\\}}crtbegin.o"
  96. -// CHECK-MULTI64-I386: "-L[[gcc_install]]/32"
  97. +// CHECK-MULTI64-I386: "crti.o" "crtbeginS.o"
  98. +// CHECK-MULTI64-I386: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32"
  99. // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib32"
  100. // CHECK-MULTI64-I386: "-L[[gcc_install]]"
  101. // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib"
  102. @@ -95,8 +95,8 @@
  103. // CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld"
  104. // CHECK-MULTI64-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
  105. // CHECK-MULTI64-X86-64: "-m" "elf_x86_64"
  106. -// CHECK-MULTI64-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o"
  107. -// CHECK-MULTI64-X86-64: "-L[[gcc_install]]"
  108. +// CHECK-MULTI64-X86-64: "crti.o" "crtbeginS.o"
  109. +// CHECK-MULTI64-X86-64: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]"
  110. // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib64"
  111. // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib"
  112. // CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib"
  113. diff --git a/test/Driver/env.c b/test/Driver/env.c
  114. index 0371bc91c4..ea89f52512 100644
  115. --- a/test/Driver/env.c
  116. +++ b/test/Driver/env.c
  117. @@ -20,7 +20,7 @@
  118. //
  119. // CHECK-LD-32-NOT: warning:
  120. // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
  121. -// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
  122. +// CHECK-LD-32: "crtbeginS.o"
  123. // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
  124. // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
  125. // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
  126. diff --git a/test/Driver/fsanitize.c b/test/Driver/fsanitize.c
  127. index db88872399..76af9bd8fe 100644
  128. --- a/test/Driver/fsanitize.c
  129. +++ b/test/Driver/fsanitize.c
  130. @@ -331,15 +331,15 @@
  131. // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1
  132. // OK
  133. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE
  134. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE
  135. +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE
  136. +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE
  137. // RUN: %clang -target x86_64-unknown-freebsd -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE
  138. // RUN: %clang -target aarch64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE
  139. // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-NO-PIE
  140. // RUN: %clang -target arm-linux-androideabi24 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE
  141. // RUN: %clang -target aarch64-linux-android -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE
  142. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE
  143. -// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE
  144. +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE
  145. +// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE
  146. // CHECK-NO-PIE-NOT: "-pie"
  147. // CHECK-NO-PIE: "-mrelocation-model" "static"
  148. @@ -687,12 +687,12 @@
  149. // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP
  150. // NOSP-NOT: "-fsanitize=safe-stack"
  151. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP
  152. +// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP
  153. // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP-ASAN
  154. // RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP
  155. // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP
  156. -// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP
  157. -// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP
  158. +// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP
  159. +// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP
  160. // RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP
  161. // NO-SP-NOT: stack-protector
  162. // NO-SP: "-fsanitize=safe-stack"
  163. diff --git a/test/Driver/gcc-toolchain.cpp b/test/Driver/gcc-toolchain.cpp
  164. index ca96757a2b..ae1c25e989 100644
  165. --- a/test/Driver/gcc-toolchain.cpp
  166. +++ b/test/Driver/gcc-toolchain.cpp
  167. @@ -24,6 +24,6 @@
  168. // the same precise formatting of the path as the '-internal-system' flags
  169. // above, so we just blanket wildcard match the 'crtbegin.o'.
  170. // CHECK: "{{[^"]*}}ld{{(.exe)?}}"
  171. -// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
  172. +// CHECK: "crtbeginS.o"
  173. // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
  174. // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.."
  175. diff --git a/test/Driver/hexagon-toolchain-elf.c b/test/Driver/hexagon-toolchain-elf.c
  176. index a7eeca0fdb..32f648372e 100644
  177. --- a/test/Driver/hexagon-toolchain-elf.c
  178. +++ b/test/Driver/hexagon-toolchain-elf.c
  179. @@ -457,7 +457,7 @@
  180. // RUN: %s 2>&1 \
  181. // RUN: | FileCheck -check-prefix=CHECK042 %s
  182. // CHECK042: "-cc1"
  183. -// CHECK042: "-mrelocation-model" "static"
  184. +// CHECK042: "-mrelocation-model" "pic"
  185. // CHECK042: "-mllvm" "-hexagon-small-data-threshold=8"
  186. // CHECK042-NEXT: llvm-mc
  187. // CHECK042: "-gpsize=8"
  188. diff --git a/test/Driver/linux-as.c b/test/Driver/linux-as.c
  189. index a9335ebf71..a72041865b 100644
  190. --- a/test/Driver/linux-as.c
  191. +++ b/test/Driver/linux-as.c
  192. @@ -164,7 +164,7 @@
  193. // CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu"
  194. //
  195. // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \
  196. -// RUN: -no-integrated-as -c %s 2>&1 \
  197. +// RUN: -no-integrated-as -fno-pic -c %s 2>&1 \
  198. // RUN: | FileCheck -check-prefix=CHECK-SPARCV9 %s
  199. // CHECK-SPARCV9: as
  200. // CHECK-SPARCV9: -64
  201. @@ -173,7 +173,7 @@
  202. // CHECK-SPARCV9: -o
  203. //
  204. // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \
  205. -// RUN: -no-integrated-as -fpic -c %s 2>&1 \
  206. +// RUN: -no-integrated-as -c %s 2>&1 \
  207. // RUN: | FileCheck -check-prefix=CHECK-SPARCV9PIC %s
  208. // CHECK-SPARCV9PIC: as
  209. // CHECK-SPARCV9PIC: -64
  210. diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c
  211. index 3ab81be490..fd6b67dd9a 100644
  212. --- a/test/Driver/linux-ld.c
  213. +++ b/test/Driver/linux-ld.c
  214. @@ -1,3 +1,5 @@
  215. +// XFAIL: linux
  216. +
  217. // General tests that ld invocations on Linux targets sane. Note that we use
  218. // sysroot to make these tests independent of the host system.
  219. //
  220. diff --git a/test/Driver/ppc-abi.c b/test/Driver/ppc-abi.c
  221. index a82a01de27..35de94a4ad 100644
  222. --- a/test/Driver/ppc-abi.c
  223. +++ b/test/Driver/ppc-abi.c
  224. @@ -26,11 +26,11 @@
  225. // CHECK-ELFv1: "-mrelocation-model" "pic" "-pic-level" "2"
  226. // CHECK-ELFv1: "-target-abi" "elfv1"
  227. -// CHECK-ELFv1-LE: "-mrelocation-model" "static"
  228. +// CHECK-ELFv1-LE: "-mrelocation-model" "pic" "-pic-level" "2"
  229. // CHECK-ELFv1-LE: "-target-abi" "elfv1"
  230. // CHECK-ELFv1-QPX: "-mrelocation-model" "pic" "-pic-level" "2"
  231. // CHECK-ELFv1-QPX: "-target-abi" "elfv1-qpx"
  232. -// CHECK-ELFv2: "-mrelocation-model" "static"
  233. +// CHECK-ELFv2: "-mrelocation-model" "pic" "-pic-level" "2"
  234. // CHECK-ELFv2: "-target-abi" "elfv2"
  235. // CHECK-ELFv2-BE: "-mrelocation-model" "pic" "-pic-level" "2"
  236. // CHECK-ELFv2-BE: "-target-abi" "elfv2"
  237. diff --git a/test/Driver/riscv32-toolchain.c b/test/Driver/riscv32-toolchain.c
  238. index 9e8af3a8ff..171392d172 100644
  239. --- a/test/Driver/riscv32-toolchain.c
  240. +++ b/test/Driver/riscv32-toolchain.c
  241. @@ -78,7 +78,7 @@
  242. // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
  243. // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv"
  244. // C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1"
  245. -// C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32{{/|\\\\}}crtbegin.o"
  246. +// C-RV32-LINUX-MULTI-ILP32: "crtbeginS.o"
  247. // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32"
  248. // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32"
  249. // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32"
  250. @@ -94,7 +94,7 @@
  251. // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
  252. // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv"
  253. // C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1"
  254. -// C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d{{/|\\\\}}crtbegin.o"
  255. +// C-RV32-LINUX-MULTI-ILP32D: "crtbeginS.o"
  256. // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d"
  257. // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d"
  258. // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d"
  259. diff --git a/test/Driver/stack-protector.c b/test/Driver/stack-protector.c
  260. index a3e40b50ee..dfffe0d6cf 100644
  261. --- a/test/Driver/stack-protector.c
  262. +++ b/test/Driver/stack-protector.c
  263. @@ -3,11 +3,11 @@
  264. // NOSSP-NOT: "-stack-protector-buffer-size"
  265. // RUN: %clang -target i386-unknown-linux -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP
  266. -// SSP: "-stack-protector" "1"
  267. +// SSP: "-stack-protector" "2"
  268. // SSP-NOT: "-stack-protector-buffer-size"
  269. // RUN: %clang -target i386-unknown-linux -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF
  270. -// SSP-BUF: "-stack-protector" "1"
  271. +// SSP-BUF: "-stack-protector" "2"
  272. // SSP-BUF: "-stack-protector-buffer-size" "16"
  273. // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD
  274. --
  275. 2.21.0