Date: Tuesday, October 8, 2019 @ 12:06:48 Author: foutrelis Revision: 364170
archrelease: copy trunk to testing-x86_64 Added: clang/repos/testing-x86_64/0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch (from rev 364169, clang/trunk/0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch) clang/repos/testing-x86_64/0001-Initialize-all-fields-in-ABIArgInfo.patch (from rev 364169, clang/trunk/0001-Initialize-all-fields-in-ABIArgInfo.patch) clang/repos/testing-x86_64/PKGBUILD (from rev 364169, clang/trunk/PKGBUILD) clang/repos/testing-x86_64/enable-SSP-and-PIE-by-default.patch (from rev 364169, clang/trunk/enable-SSP-and-PIE-by-default.patch) Deleted: clang/repos/testing-x86_64/0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch clang/repos/testing-x86_64/0001-Initialize-all-fields-in-ABIArgInfo.patch clang/repos/testing-x86_64/PKGBUILD clang/repos/testing-x86_64/enable-SSP-and-PIE-by-default.patch -----------------------------------------------------------------+ 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch | 59 0001-Initialize-all-fields-in-ABIArgInfo.patch | 80 - PKGBUILD | 245 ++- enable-SSP-and-PIE-by-default.patch | 618 +++++----- 4 files changed, 505 insertions(+), 497 deletions(-) Deleted: 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch =================================================================== --- 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch 2019-10-08 12:06:42 UTC (rev 364169) +++ 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch 2019-10-08 12:06:48 UTC (rev 364170) @@ -1,27 +0,0 @@ -From 20ffd5bc4e45980dc804c5fa422e5182cbc975b7 Mon Sep 17 00:00:00 2001 -From: Tom Stellard <tstel...@redhat.com> -Date: Tue, 13 Aug 2019 13:38:40 -0700 -Subject: [PATCH] Fix Driver/modules.cpp test to work when build directory name - contains '.s' - ---- - clang/test/Driver/modules.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/clang/test/Driver/modules.cpp b/clang/test/Driver/modules.cpp -index 7c549c1..9e06151 100644 ---- a/clang/test/Driver/modules.cpp -+++ b/clang/test/Driver/modules.cpp -@@ -15,7 +15,8 @@ - // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-COMPILE - // - // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}} --// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}} -+// Check for extra space to avoid failures when the build directory contains '.s' in its path. -+// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}{{ }} - // CHECK-COMPILE-SAME: -x pcm - // CHECK-COMPILE-SAME: {{.*}}.pcm - --- -1.8.3.1 - Copied: clang/repos/testing-x86_64/0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch (from rev 364169, clang/trunk/0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch) =================================================================== --- 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch (rev 0) +++ 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch 2019-10-08 12:06:48 UTC (rev 364170) @@ -0,0 +1,32 @@ +From 8ea70c9ede7ac82d9363c122a9a84aded054984c Mon Sep 17 00:00:00 2001 +From: Tom Stellard <tstel...@redhat.com> +Date: Mon, 30 Sep 2019 23:42:17 +0000 +Subject: [PATCH] Fix Driver/modules.cpp test to work when build directory name + contains '.s' + +Reviewers: dyung, rsmith, hansw + +Subscribers: mati865, mgorny, cfe-commits + +Tags: #clang + +Differential Revision: https://reviews.llvm.org/D66176 + +git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373275 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + test/Driver/modules.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/Driver/modules.cpp b/test/Driver/modules.cpp +index 7c549c1300..4f4e3a4140 100644 +--- a/test/Driver/modules.cpp ++++ b/test/Driver/modules.cpp +@@ -15,7 +15,7 @@ + // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-COMPILE + // + // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}} +-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}} ++// CHECK-COMPILE-SAME: -o {{.*}}module{{2*}}.pcm.o + // CHECK-COMPILE-SAME: -x pcm + // CHECK-COMPILE-SAME: {{.*}}.pcm + Deleted: 0001-Initialize-all-fields-in-ABIArgInfo.patch =================================================================== --- 0001-Initialize-all-fields-in-ABIArgInfo.patch 2019-10-08 12:06:42 UTC (rev 364169) +++ 0001-Initialize-all-fields-in-ABIArgInfo.patch 2019-10-08 12:06:48 UTC (rev 364170) @@ -1,40 +0,0 @@ -From a1445cd0340006d7635101c4c2b27ae51328642c Mon Sep 17 00:00:00 2001 -From: Serge Guelton <sguel...@redhat.com> -Date: Thu, 19 Sep 2019 00:54:40 +0000 -Subject: [PATCH] Initialize all fields in ABIArgInfo. - -Due to usage of an uninitialized fields, we end up with -a Conditional jump or move depends on uninitialised value - -Fixes https://bugs.llvm.org/show_bug.cgi?id=40547 - -Commited on behalf of Martin Liska <mli...@suse.cz> - -git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372281 91177308-0d34-0410-b5e6-96231b3b80d8 ---- - include/clang/CodeGen/CGFunctionInfo.h | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h -index 1f81072e23d0..5069d9af42a3 100644 ---- a/include/clang/CodeGen/CGFunctionInfo.h -+++ b/include/clang/CodeGen/CGFunctionInfo.h -@@ -109,14 +109,12 @@ class ABIArgInfo { - UnpaddedCoerceAndExpandType = T; - } - -- ABIArgInfo(Kind K) -- : TheKind(K), PaddingInReg(false), InReg(false) { -- } -- - public: -- ABIArgInfo() -+ ABIArgInfo(Kind K = Direct) - : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), -- TheKind(Direct), PaddingInReg(false), InReg(false) {} -+ TheKind(K), PaddingInReg(false), InAllocaSRet(false), -+ IndirectByVal(false), IndirectRealign(false), SRetAfterThis(false), -+ InReg(false), CanBeFlattened(false), SignExt(false) {} - - static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, - llvm::Type *Padding = nullptr, Copied: clang/repos/testing-x86_64/0001-Initialize-all-fields-in-ABIArgInfo.patch (from rev 364169, clang/trunk/0001-Initialize-all-fields-in-ABIArgInfo.patch) =================================================================== --- 0001-Initialize-all-fields-in-ABIArgInfo.patch (rev 0) +++ 0001-Initialize-all-fields-in-ABIArgInfo.patch 2019-10-08 12:06:48 UTC (rev 364170) @@ -0,0 +1,40 @@ +From a1445cd0340006d7635101c4c2b27ae51328642c Mon Sep 17 00:00:00 2001 +From: Serge Guelton <sguel...@redhat.com> +Date: Thu, 19 Sep 2019 00:54:40 +0000 +Subject: [PATCH] Initialize all fields in ABIArgInfo. + +Due to usage of an uninitialized fields, we end up with +a Conditional jump or move depends on uninitialised value + +Fixes https://bugs.llvm.org/show_bug.cgi?id=40547 + +Commited on behalf of Martin Liska <mli...@suse.cz> + +git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372281 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + include/clang/CodeGen/CGFunctionInfo.h | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h +index 1f81072e23d0..5069d9af42a3 100644 +--- a/include/clang/CodeGen/CGFunctionInfo.h ++++ b/include/clang/CodeGen/CGFunctionInfo.h +@@ -109,14 +109,12 @@ class ABIArgInfo { + UnpaddedCoerceAndExpandType = T; + } + +- ABIArgInfo(Kind K) +- : TheKind(K), PaddingInReg(false), InReg(false) { +- } +- + public: +- ABIArgInfo() ++ ABIArgInfo(Kind K = Direct) + : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), +- TheKind(Direct), PaddingInReg(false), InReg(false) {} ++ TheKind(K), PaddingInReg(false), InAllocaSRet(false), ++ IndirectByVal(false), IndirectRealign(false), SRetAfterThis(false), ++ InReg(false), CanBeFlattened(false), SignExt(false) {} + + static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, + llvm::Type *Padding = nullptr, Deleted: PKGBUILD =================================================================== --- PKGBUILD 2019-10-08 12:06:42 UTC (rev 364169) +++ PKGBUILD 2019-10-08 12:06:48 UTC (rev 364170) @@ -1,121 +0,0 @@ -# Maintainer: Evangelos Foutras <evange...@foutrelis.com> -# Contributor: Jan "heftig" Steffens <jan.steff...@gmail.com> - -pkgname=clang -pkgver=9.0.0 -pkgrel=1 -pkgdesc="C language family frontend for LLVM" -arch=('x86_64') -url="https://clang.llvm.org/" -license=('custom:Apache 2.0 with LLVM Exception') -depends=('llvm-libs' 'gcc' 'compiler-rt') -makedepends=('llvm' 'cmake' 'ninja' 'python-sphinx' 'python2') -optdepends=('openmp: OpenMP support in clang with -fopenmp' - 'python: for scan-view and git-clang-format' - 'llvm: referenced by some clang headers') -provides=("clang-analyzer=$pkgver" "clang-tools-extra=$pkgver") -conflicts=('clang-analyzer' 'clang-tools-extra') -replaces=('clang-analyzer' 'clang-tools-extra') -source=(https://releases.llvm.org/$pkgver/cfe-$pkgver.src.tar.xz{,.sig} - https://releases.llvm.org/$pkgver/clang-tools-extra-$pkgver.src.tar.xz{,.sig} - https://releases.llvm.org/$pkgver/llvm-$pkgver.src.tar.xz{,.sig} - 0001-Initialize-all-fields-in-ABIArgInfo.patch - 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch - enable-SSP-and-PIE-by-default.patch) -sha256sums=('7ba81eef7c22ca5da688fdf9d88c20934d2d6b40bfe150ffd338900890aa4610' - 'SKIP' - 'ea1c86ce352992d7b6f6649bc622f6a2707b9f8b7153e9f9181a35c76aa3ac10' - 'SKIP' - 'd6a0565cf21f22e9b4353b2eb92622e8365000a9e90a16b09b56f8157eabfe84' - 'SKIP' - '9245955509841e031f4c8169c2207b3029e8af9e30a39e662ac1bfd9d6186a51' - '2e47e305a5d79713160c560c7617411815b1a93d73a7f9d182c96e848fdd011b' - 'fde58a4902bec3715bc3d0c9250fa4c5f241af90bfd1e46f7128fa1435c03026') -validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <h...@chromium.org> -validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstel...@redhat.com> - -prepare() { - cd "$srcdir/cfe-$pkgver.src" - mkdir build - mv "$srcdir/clang-tools-extra-$pkgver.src" tools/extra - patch -Np1 -i ../enable-SSP-and-PIE-by-default.patch - - # https://bugs.llvm.org/show_bug.cgi?id=40547 - patch -Np1 -i ../0001-Initialize-all-fields-in-ABIArgInfo.patch - - # https://reviews.llvm.org/D66176 - patch -Np2 -i ../0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch -} - -build() { - cd "$srcdir/cfe-$pkgver.src/build" - - # Upstream strongly recommends against BUILD_SHARED_LIBS=ON for distro - # builds but CLANG_LINK_CLANG_DYLIB=ON is not yet supported by clang's - # extra tools. Keep building all libraries as shared and revisit this. - - cmake .. -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DPYTHON_EXECUTABLE=/usr/bin/python \ - -DBUILD_SHARED_LIBS=ON \ - -DLLVM_LINK_LLVM_DYLIB=ON \ - -DCLANG_LINK_CLANG_DYLIB=ON \ - -DLLVM_ENABLE_RTTI=ON \ - -DLLVM_BUILD_TESTS=ON \ - -DLLVM_INCLUDE_DOCS=ON \ - -DLLVM_BUILD_DOCS=ON \ - -DLLVM_ENABLE_SPHINX=ON \ - -DSPHINX_WARNINGS_AS_ERRORS=OFF \ - -DLLVM_EXTERNAL_LIT=/usr/bin/lit \ - -DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src" - ninja -} - -check() { - cd "$srcdir/cfe-$pkgver.src/build" - ninja check-clang{,-tools} -} - -_python2_optimize() { - python2 -m compileall "$@" - python2 -O -m compileall "$@" -} - -_python3_optimize() { - python3 -m compileall "$@" - python3 -O -m compileall "$@" - python3 -OO -m compileall "$@" -} - -package() { - cd "$srcdir/cfe-$pkgver.src/build" - - DESTDIR="$pkgdir" ninja install - install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE" - - # Remove documentation sources - rm -r "$pkgdir"/usr/share/doc/clang{,-tools}/html/{_sources,.buildinfo} - - # Move analyzer scripts out of /usr/libexec - mv "$pkgdir"/usr/libexec/{ccc,c++}-analyzer "$pkgdir/usr/lib/clang/" - rmdir "$pkgdir/usr/libexec" - sed -i 's|libexec|lib/clang|' "$pkgdir/usr/bin/scan-build" - - # Install Python bindings - for _py in 2.7 3.7; do - install -d "$pkgdir/usr/lib/python$_py/site-packages" - cp -a ../bindings/python/clang "$pkgdir/usr/lib/python$_py/site-packages/" - _python${_py%%.*}_optimize "$pkgdir/usr/lib/python$_py" - done - - # Fix shebang in Python 2 script - sed -i '1s|/usr/bin/env python$|&2|' \ - "$pkgdir"/usr/share/$pkgname/run-find-all-symbols.py - - # Compile Python scripts - _python2_optimize "$pkgdir/usr/share/clang" - _python3_optimize "$pkgdir/usr/share" -x 'clang-include-fixer|run-find-all-symbols' -} - -# vim:set ts=2 sw=2 et: Copied: clang/repos/testing-x86_64/PKGBUILD (from rev 364169, clang/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2019-10-08 12:06:48 UTC (rev 364170) @@ -0,0 +1,124 @@ +# Maintainer: Evangelos Foutras <evange...@foutrelis.com> +# Contributor: Jan "heftig" Steffens <jan.steff...@gmail.com> + +pkgname=clang +pkgver=9.0.0 +pkgrel=2 +pkgdesc="C language family frontend for LLVM" +arch=('x86_64') +url="https://clang.llvm.org/" +license=('custom:Apache 2.0 with LLVM Exception') +depends=('llvm-libs' 'gcc' 'compiler-rt') +makedepends=('llvm' 'cmake' 'ninja' 'python-sphinx' 'python2') +optdepends=('openmp: OpenMP support in clang with -fopenmp' + 'python: for scan-view and git-clang-format' + 'llvm: referenced by some clang headers') +provides=("clang-analyzer=$pkgver" "clang-tools-extra=$pkgver") +conflicts=('clang-analyzer' 'clang-tools-extra') +replaces=('clang-analyzer' 'clang-tools-extra') +source=(https://releases.llvm.org/$pkgver/cfe-$pkgver.src.tar.xz{,.sig} + https://releases.llvm.org/$pkgver/clang-tools-extra-$pkgver.src.tar.xz{,.sig} + https://releases.llvm.org/$pkgver/llvm-$pkgver.src.tar.xz{,.sig} + 0001-Initialize-all-fields-in-ABIArgInfo.patch + 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch + enable-SSP-and-PIE-by-default.patch) +sha256sums=('7ba81eef7c22ca5da688fdf9d88c20934d2d6b40bfe150ffd338900890aa4610' + 'SKIP' + 'ea1c86ce352992d7b6f6649bc622f6a2707b9f8b7153e9f9181a35c76aa3ac10' + 'SKIP' + 'd6a0565cf21f22e9b4353b2eb92622e8365000a9e90a16b09b56f8157eabfe84' + 'SKIP' + '9245955509841e031f4c8169c2207b3029e8af9e30a39e662ac1bfd9d6186a51' + '72a15c9825a1f5c73cc4f04c831bf3a12620db90922af299599f029aab0d27f0' + 'fde58a4902bec3715bc3d0c9250fa4c5f241af90bfd1e46f7128fa1435c03026') +validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <h...@chromium.org> +validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstel...@redhat.com> + +prepare() { + cd "$srcdir/cfe-$pkgver.src" + mkdir build + mv "$srcdir/clang-tools-extra-$pkgver.src" tools/extra + patch -Np1 -i ../enable-SSP-and-PIE-by-default.patch + + # https://bugs.llvm.org/show_bug.cgi?id=40547 + patch -Np1 -i ../0001-Initialize-all-fields-in-ABIArgInfo.patch + + # https://reviews.llvm.org/D66176 + patch -Np1 -i ../0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch + + # Avoid shipping libclang-cpp before removing BUILD_SHARED_LIBS=ON + sed -i '/add_clang_subdirectory(clang-shlib)/d' tools/CMakeLists.txt +} + +build() { + cd "$srcdir/cfe-$pkgver.src/build" + + # Upstream strongly recommends against BUILD_SHARED_LIBS=ON for distro + # builds but CLANG_LINK_CLANG_DYLIB=ON is not yet supported by clang's + # extra tools. Keep building all libraries as shared and revisit this. + + cmake .. -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DPYTHON_EXECUTABLE=/usr/bin/python \ + -DBUILD_SHARED_LIBS=ON \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DCLANG_LINK_CLANG_DYLIB=OFF \ + -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_BUILD_TESTS=ON \ + -DLLVM_INCLUDE_DOCS=ON \ + -DLLVM_BUILD_DOCS=ON \ + -DLLVM_ENABLE_SPHINX=ON \ + -DSPHINX_WARNINGS_AS_ERRORS=OFF \ + -DLLVM_EXTERNAL_LIT=/usr/bin/lit \ + -DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src" + ninja +} + +check() { + cd "$srcdir/cfe-$pkgver.src/build" + ninja check-clang{,-tools} +} + +_python2_optimize() { + python2 -m compileall "$@" + python2 -O -m compileall "$@" +} + +_python3_optimize() { + python3 -m compileall "$@" + python3 -O -m compileall "$@" + python3 -OO -m compileall "$@" +} + +package() { + cd "$srcdir/cfe-$pkgver.src/build" + + DESTDIR="$pkgdir" ninja install + install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + + # Remove documentation sources + rm -r "$pkgdir"/usr/share/doc/clang{,-tools}/html/{_sources,.buildinfo} + + # Move analyzer scripts out of /usr/libexec + mv "$pkgdir"/usr/libexec/{ccc,c++}-analyzer "$pkgdir/usr/lib/clang/" + rmdir "$pkgdir/usr/libexec" + sed -i 's|libexec|lib/clang|' "$pkgdir/usr/bin/scan-build" + + # Install Python bindings + for _py in 2.7 3.7; do + install -d "$pkgdir/usr/lib/python$_py/site-packages" + cp -a ../bindings/python/clang "$pkgdir/usr/lib/python$_py/site-packages/" + _python${_py%%.*}_optimize "$pkgdir/usr/lib/python$_py" + done + + # Fix shebang in Python 2 script + sed -i '1s|/usr/bin/env python$|&2|' \ + "$pkgdir"/usr/share/$pkgname/run-find-all-symbols.py + + # Compile Python scripts + _python2_optimize "$pkgdir/usr/share/clang" + _python3_optimize "$pkgdir/usr/share" -x 'clang-include-fixer|run-find-all-symbols' +} + +# vim:set ts=2 sw=2 et: Deleted: enable-SSP-and-PIE-by-default.patch =================================================================== --- enable-SSP-and-PIE-by-default.patch 2019-10-08 12:06:42 UTC (rev 364169) +++ enable-SSP-and-PIE-by-default.patch 2019-10-08 12:06:48 UTC (rev 364170) @@ -1,309 +0,0 @@ -From 6a5a1f705fe44ab47ad8b52c1096451caa951b5c Mon Sep 17 00:00:00 2001 -From: Evangelos Foutras <evange...@foutrelis.com> -Date: Sat, 21 Sep 2019 02:36:46 +0300 -Subject: [PATCH] Enable SSP and PIE by default - -This is a minimal set of changes needed to make clang use SSP and PIE by -default on Arch Linux. Tests that were easy to adjust have been changed -accordingly; only test/Driver/linux-ld.c has been marked as "expected -failure" due to the number of changes it would require (mostly replacing -crtbegin.o with crtbeginS.o). - -Doing so is needed in order to align clang with the new default GCC -behavior in Arch which generates PIE executables by default and also -defaults to -fstack-protector-strong. It is not meant to be a long term -solution, but a simple temporary fix. - -Hopefully these changes will be obsoleted by the introduction upstream -of a compile-time option (https://bugs.llvm.org/show_bug.cgi?id=13410) ---- - lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- - lib/Driver/ToolChains/Linux.h | 1 + - test/Driver/cross-linux.c | 16 ++++++++-------- - test/Driver/env.c | 2 +- - test/Driver/fsanitize.c | 14 +++++++------- - test/Driver/gcc-toolchain.cpp | 2 +- - test/Driver/hexagon-toolchain-elf.c | 2 +- - test/Driver/linux-as.c | 4 ++-- - test/Driver/linux-ld.c | 2 ++ - test/Driver/ppc-abi.c | 4 ++-- - test/Driver/riscv32-toolchain.c | 4 ++-- - test/Driver/riscv64-toolchain.c | 4 ++-- - test/Driver/stack-protector.c | 4 ++-- - 13 files changed, 43 insertions(+), 30 deletions(-) - -diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp -index d900508ad9..3e68d50dac 100644 ---- a/lib/Driver/ToolChains/Linux.cpp -+++ b/lib/Driver/ToolChains/Linux.cpp -@@ -972,8 +972,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, - } - - bool Linux::isPIEDefault() const { -- return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || -- getTriple().isMusl() || getSanitizerArgs().requiresPIE(); -+ const bool IsMips = getTriple().isMIPS(); -+ const bool IsAndroid = getTriple().isAndroid(); -+ -+ if (IsMips || IsAndroid) -+ return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || -+ getTriple().isMusl() || getSanitizerArgs().requiresPIE(); -+ -+ return true; -+} -+ -+unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const { -+ return 2; - } - - bool Linux::isNoExecStackDefault() const { -diff --git a/lib/Driver/ToolChains/Linux.h b/lib/Driver/ToolChains/Linux.h -index 4c61994691..c60a50cb27 100644 ---- a/lib/Driver/ToolChains/Linux.h -+++ b/lib/Driver/ToolChains/Linux.h -@@ -40,6 +40,7 @@ public: - bool isPIEDefault() const override; - bool isNoExecStackDefault() const override; - bool IsMathErrnoDefault() const override; -+ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; - SanitizerMask getSupportedSanitizers() const override; - void addProfileRTLibs(const llvm::opt::ArgList &Args, - llvm::opt::ArgStringList &CmdArgs) const override; -diff --git a/test/Driver/cross-linux.c b/test/Driver/cross-linux.c -index a5ea832e77..1949c05a60 100644 ---- a/test/Driver/cross-linux.c -+++ b/test/Driver/cross-linux.c -@@ -42,8 +42,8 @@ - // CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI32-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI32-I386: "-m" "elf_i386" --// CHECK-MULTI32-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" --// CHECK-MULTI32-I386: "-L[[gcc_install]]" -+// CHECK-MULTI32-I386: "crti.o" "crtbeginS.o" -+// CHECK-MULTI32-I386: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]" - // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib32" - // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" - // CHECK-MULTI32-I386: "-L[[sysroot]]/lib" -@@ -59,8 +59,8 @@ - // CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI32-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI32-X86-64: "-m" "elf_x86_64" --// 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" --// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/64" -+// CHECK-MULTI32-X86-64: "crti.o" "crtbeginS.o" -+// CHECK-MULTI32-X86-64: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib64" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" -@@ -77,8 +77,8 @@ - // CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI64-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI64-I386: "-m" "elf_i386" --// 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" --// CHECK-MULTI64-I386: "-L[[gcc_install]]/32" -+// CHECK-MULTI64-I386: "crti.o" "crtbeginS.o" -+// CHECK-MULTI64-I386: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32" - // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib32" - // CHECK-MULTI64-I386: "-L[[gcc_install]]" - // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" -@@ -95,8 +95,8 @@ - // 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" - // CHECK-MULTI64-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI64-X86-64: "-m" "elf_x86_64" --// 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" --// CHECK-MULTI64-X86-64: "-L[[gcc_install]]" -+// CHECK-MULTI64-X86-64: "crti.o" "crtbeginS.o" -+// CHECK-MULTI64-X86-64: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]" - // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib64" - // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" - // CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib" -diff --git a/test/Driver/env.c b/test/Driver/env.c -index 0371bc91c4..ea89f52512 100644 ---- a/test/Driver/env.c -+++ b/test/Driver/env.c -@@ -20,7 +20,7 @@ - // - // CHECK-LD-32-NOT: warning: - // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" --// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" -+// CHECK-LD-32: "crtbeginS.o" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." -diff --git a/test/Driver/fsanitize.c b/test/Driver/fsanitize.c -index 2896eda5aa..45a1873ace 100644 ---- a/test/Driver/fsanitize.c -+++ b/test/Driver/fsanitize.c -@@ -318,15 +318,15 @@ - // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 - // OK - --// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE --// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target x86_64-unknown-freebsd -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target aarch64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-NO-PIE - // RUN: %clang -target arm-linux-androideabi24 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target aarch64-linux-android -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE --// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE --// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE -+// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - - // CHECK-NO-PIE-NOT: "-pie" - // CHECK-NO-PIE: "-mrelocation-model" "static" -@@ -645,12 +645,12 @@ - // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP - // NOSP-NOT: "-fsanitize=safe-stack" - --// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP - // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP-ASAN - // RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP - // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP --// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP --// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP -+// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP -+// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP - // RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP - // NO-SP-NOT: stack-protector - // NO-SP: "-fsanitize=safe-stack" -diff --git a/test/Driver/gcc-toolchain.cpp b/test/Driver/gcc-toolchain.cpp -index ca96757a2b..ae1c25e989 100644 ---- a/test/Driver/gcc-toolchain.cpp -+++ b/test/Driver/gcc-toolchain.cpp -@@ -24,6 +24,6 @@ - // the same precise formatting of the path as the '-internal-system' flags - // above, so we just blanket wildcard match the 'crtbegin.o'. - // CHECK: "{{[^"]*}}ld{{(.exe)?}}" --// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" -+// CHECK: "crtbeginS.o" - // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" - // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." -diff --git a/test/Driver/hexagon-toolchain-elf.c b/test/Driver/hexagon-toolchain-elf.c -index a7eeca0fdb..32f648372e 100644 ---- a/test/Driver/hexagon-toolchain-elf.c -+++ b/test/Driver/hexagon-toolchain-elf.c -@@ -457,7 +457,7 @@ - // RUN: %s 2>&1 \ - // RUN: | FileCheck -check-prefix=CHECK042 %s - // CHECK042: "-cc1" --// CHECK042: "-mrelocation-model" "static" -+// CHECK042: "-mrelocation-model" "pic" - // CHECK042: "-mllvm" "-hexagon-small-data-threshold=8" - // CHECK042-NEXT: llvm-mc - // CHECK042: "-gpsize=8" -diff --git a/test/Driver/linux-as.c b/test/Driver/linux-as.c -index 77ac05f309..cb474f3289 100644 ---- a/test/Driver/linux-as.c -+++ b/test/Driver/linux-as.c -@@ -164,7 +164,7 @@ - // CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu" - // - // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ --// RUN: -no-integrated-as -c %s 2>&1 \ -+// RUN: -no-integrated-as -fno-pic -c %s 2>&1 \ - // RUN: | FileCheck -check-prefix=CHECK-SPARCV9 %s - // CHECK-SPARCV9: as - // CHECK-SPARCV9: -64 -@@ -173,7 +173,7 @@ - // CHECK-SPARCV9: -o - // - // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ --// RUN: -no-integrated-as -fpic -c %s 2>&1 \ -+// RUN: -no-integrated-as -c %s 2>&1 \ - // RUN: | FileCheck -check-prefix=CHECK-SPARCV9PIC %s - // CHECK-SPARCV9PIC: as - // CHECK-SPARCV9PIC: -64 -diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c -index 70fc178c56..b52c84ce85 100644 ---- a/test/Driver/linux-ld.c -+++ b/test/Driver/linux-ld.c -@@ -1,3 +1,5 @@ -+// XFAIL: linux -+ - // General tests that ld invocations on Linux targets sane. Note that we use - // sysroot to make these tests independent of the host system. - // -diff --git a/test/Driver/ppc-abi.c b/test/Driver/ppc-abi.c -index fdcf45da29..cbd1106b7d 100644 ---- a/test/Driver/ppc-abi.c -+++ b/test/Driver/ppc-abi.c -@@ -26,11 +26,11 @@ - - // CHECK-ELFv1: "-mrelocation-model" "pic" "-pic-level" "2" - // CHECK-ELFv1: "-target-abi" "elfv1" --// CHECK-ELFv1-LE: "-mrelocation-model" "static" -+// CHECK-ELFv1-LE: "-mrelocation-model" "pic" "-pic-level" "2" - // CHECK-ELFv1-LE: "-target-abi" "elfv1" - // CHECK-ELFv1-QPX: "-mrelocation-model" "pic" "-pic-level" "2" - // CHECK-ELFv1-QPX: "-target-abi" "elfv1-qpx" --// CHECK-ELFv2: "-mrelocation-model" "static" -+// CHECK-ELFv2: "-mrelocation-model" "pic" "-pic-level" "2" - // CHECK-ELFv2: "-target-abi" "elfv2" - // CHECK-ELFv2-BE: "-mrelocation-model" "pic" "-pic-level" "2" - // CHECK-ELFv2-BE: "-target-abi" "elfv2" -diff --git a/test/Driver/riscv32-toolchain.c b/test/Driver/riscv32-toolchain.c -index 117c773ec9..9fffbf2aaf 100644 ---- a/test/Driver/riscv32-toolchain.c -+++ b/test/Driver/riscv32-toolchain.c -@@ -78,7 +78,7 @@ - // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv" - // C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1" --// C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32{{/|\\\\}}crtbegin.o" -+// C-RV32-LINUX-MULTI-ILP32: "crtbeginS.o" - // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32" - // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32" - // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32" -@@ -94,7 +94,7 @@ - // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv" - // C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1" --// C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d{{/|\\\\}}crtbegin.o" -+// C-RV32-LINUX-MULTI-ILP32D: "crtbeginS.o" - // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d" - // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d" - // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d" -diff --git a/test/Driver/riscv64-toolchain.c b/test/Driver/riscv64-toolchain.c -index 3d574947c6..20e3dc1556 100644 ---- a/test/Driver/riscv64-toolchain.c -+++ b/test/Driver/riscv64-toolchain.c -@@ -78,7 +78,7 @@ - // C-RV64-LINUX-MULTI-LP64: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV64-LINUX-MULTI-LP64: "-m" "elf64lriscv" - // C-RV64-LINUX-MULTI-LP64: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64.so.1" --// C-RV64-LINUX-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64{{/|\\\\}}crtbegin.o" -+// C-RV64-LINUX-MULTI-LP64: "crtbeginS.o" - // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64" - // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64" - // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64" -@@ -94,7 +94,7 @@ - // C-RV64-LINUX-MULTI-LP64D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV64-LINUX-MULTI-LP64D: "-m" "elf64lriscv" - // C-RV64-LINUX-MULTI-LP64D: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64d.so.1" --// C-RV64-LINUX-MULTI-LP64D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d{{/|\\\\}}crtbegin.o" -+// C-RV64-LINUX-MULTI-LP64D: "crtbeginS.o" - // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d" - // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64d" - // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64d" -diff --git a/test/Driver/stack-protector.c b/test/Driver/stack-protector.c -index a3e40b50ee..dfffe0d6cf 100644 ---- a/test/Driver/stack-protector.c -+++ b/test/Driver/stack-protector.c -@@ -3,11 +3,11 @@ - // NOSSP-NOT: "-stack-protector-buffer-size" - - // RUN: %clang -target i386-unknown-linux -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP --// SSP: "-stack-protector" "1" -+// SSP: "-stack-protector" "2" - // SSP-NOT: "-stack-protector-buffer-size" - - // RUN: %clang -target i386-unknown-linux -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF --// SSP-BUF: "-stack-protector" "1" -+// SSP-BUF: "-stack-protector" "2" - // SSP-BUF: "-stack-protector-buffer-size" "16" - - // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD Copied: clang/repos/testing-x86_64/enable-SSP-and-PIE-by-default.patch (from rev 364169, clang/trunk/enable-SSP-and-PIE-by-default.patch) =================================================================== --- enable-SSP-and-PIE-by-default.patch (rev 0) +++ enable-SSP-and-PIE-by-default.patch 2019-10-08 12:06:48 UTC (rev 364170) @@ -0,0 +1,309 @@ +From 6a5a1f705fe44ab47ad8b52c1096451caa951b5c Mon Sep 17 00:00:00 2001 +From: Evangelos Foutras <evange...@foutrelis.com> +Date: Sat, 21 Sep 2019 02:36:46 +0300 +Subject: [PATCH] Enable SSP and PIE by default + +This is a minimal set of changes needed to make clang use SSP and PIE by +default on Arch Linux. Tests that were easy to adjust have been changed +accordingly; only test/Driver/linux-ld.c has been marked as "expected +failure" due to the number of changes it would require (mostly replacing +crtbegin.o with crtbeginS.o). + +Doing so is needed in order to align clang with the new default GCC +behavior in Arch which generates PIE executables by default and also +defaults to -fstack-protector-strong. It is not meant to be a long term +solution, but a simple temporary fix. + +Hopefully these changes will be obsoleted by the introduction upstream +of a compile-time option (https://bugs.llvm.org/show_bug.cgi?id=13410) +--- + lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- + lib/Driver/ToolChains/Linux.h | 1 + + test/Driver/cross-linux.c | 16 ++++++++-------- + test/Driver/env.c | 2 +- + test/Driver/fsanitize.c | 14 +++++++------- + test/Driver/gcc-toolchain.cpp | 2 +- + test/Driver/hexagon-toolchain-elf.c | 2 +- + test/Driver/linux-as.c | 4 ++-- + test/Driver/linux-ld.c | 2 ++ + test/Driver/ppc-abi.c | 4 ++-- + test/Driver/riscv32-toolchain.c | 4 ++-- + test/Driver/riscv64-toolchain.c | 4 ++-- + test/Driver/stack-protector.c | 4 ++-- + 13 files changed, 43 insertions(+), 30 deletions(-) + +diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp +index d900508ad9..3e68d50dac 100644 +--- a/lib/Driver/ToolChains/Linux.cpp ++++ b/lib/Driver/ToolChains/Linux.cpp +@@ -972,8 +972,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, + } + + bool Linux::isPIEDefault() const { +- return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || +- getTriple().isMusl() || getSanitizerArgs().requiresPIE(); ++ const bool IsMips = getTriple().isMIPS(); ++ const bool IsAndroid = getTriple().isAndroid(); ++ ++ if (IsMips || IsAndroid) ++ return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || ++ getTriple().isMusl() || getSanitizerArgs().requiresPIE(); ++ ++ return true; ++} ++ ++unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const { ++ return 2; + } + + bool Linux::isNoExecStackDefault() const { +diff --git a/lib/Driver/ToolChains/Linux.h b/lib/Driver/ToolChains/Linux.h +index 4c61994691..c60a50cb27 100644 +--- a/lib/Driver/ToolChains/Linux.h ++++ b/lib/Driver/ToolChains/Linux.h +@@ -40,6 +40,7 @@ public: + bool isPIEDefault() const override; + bool isNoExecStackDefault() const override; + bool IsMathErrnoDefault() const override; ++ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; + SanitizerMask getSupportedSanitizers() const override; + void addProfileRTLibs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const override; +diff --git a/test/Driver/cross-linux.c b/test/Driver/cross-linux.c +index a5ea832e77..1949c05a60 100644 +--- a/test/Driver/cross-linux.c ++++ b/test/Driver/cross-linux.c +@@ -42,8 +42,8 @@ + // CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" + // CHECK-MULTI32-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" + // CHECK-MULTI32-I386: "-m" "elf_i386" +-// CHECK-MULTI32-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" +-// CHECK-MULTI32-I386: "-L[[gcc_install]]" ++// CHECK-MULTI32-I386: "crti.o" "crtbeginS.o" ++// CHECK-MULTI32-I386: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]" + // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib32" + // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" + // CHECK-MULTI32-I386: "-L[[sysroot]]/lib" +@@ -59,8 +59,8 @@ + // CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" + // CHECK-MULTI32-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" + // CHECK-MULTI32-X86-64: "-m" "elf_x86_64" +-// 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" +-// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/64" ++// CHECK-MULTI32-X86-64: "crti.o" "crtbeginS.o" ++// CHECK-MULTI32-X86-64: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64" + // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib64" + // CHECK-MULTI32-X86-64: "-L[[gcc_install]]" + // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" +@@ -77,8 +77,8 @@ + // CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" + // CHECK-MULTI64-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" + // CHECK-MULTI64-I386: "-m" "elf_i386" +-// 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" +-// CHECK-MULTI64-I386: "-L[[gcc_install]]/32" ++// CHECK-MULTI64-I386: "crti.o" "crtbeginS.o" ++// CHECK-MULTI64-I386: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32" + // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib32" + // CHECK-MULTI64-I386: "-L[[gcc_install]]" + // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" +@@ -95,8 +95,8 @@ + // 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" + // CHECK-MULTI64-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" + // CHECK-MULTI64-X86-64: "-m" "elf_x86_64" +-// 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" +-// CHECK-MULTI64-X86-64: "-L[[gcc_install]]" ++// CHECK-MULTI64-X86-64: "crti.o" "crtbeginS.o" ++// CHECK-MULTI64-X86-64: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]" + // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib64" + // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" + // CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib" +diff --git a/test/Driver/env.c b/test/Driver/env.c +index 0371bc91c4..ea89f52512 100644 +--- a/test/Driver/env.c ++++ b/test/Driver/env.c +@@ -20,7 +20,7 @@ + // + // CHECK-LD-32-NOT: warning: + // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" ++// CHECK-LD-32: "crtbeginS.o" + // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" + // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" + // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." +diff --git a/test/Driver/fsanitize.c b/test/Driver/fsanitize.c +index 2896eda5aa..45a1873ace 100644 +--- a/test/Driver/fsanitize.c ++++ b/test/Driver/fsanitize.c +@@ -318,15 +318,15 @@ + // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 + // OK + +-// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE +-// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE ++// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE ++// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + // RUN: %clang -target x86_64-unknown-freebsd -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + // RUN: %clang -target aarch64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-NO-PIE + // RUN: %clang -target arm-linux-androideabi24 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + // RUN: %clang -target aarch64-linux-android -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE +-// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE +-// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE ++// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE ++// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + + // CHECK-NO-PIE-NOT: "-pie" + // CHECK-NO-PIE: "-mrelocation-model" "static" +@@ -645,12 +645,12 @@ + // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP + // NOSP-NOT: "-fsanitize=safe-stack" + +-// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP ++// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP + // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP-ASAN + // RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP + // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP +-// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP +-// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP ++// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP ++// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP + // RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP + // NO-SP-NOT: stack-protector + // NO-SP: "-fsanitize=safe-stack" +diff --git a/test/Driver/gcc-toolchain.cpp b/test/Driver/gcc-toolchain.cpp +index ca96757a2b..ae1c25e989 100644 +--- a/test/Driver/gcc-toolchain.cpp ++++ b/test/Driver/gcc-toolchain.cpp +@@ -24,6 +24,6 @@ + // the same precise formatting of the path as the '-internal-system' flags + // above, so we just blanket wildcard match the 'crtbegin.o'. + // CHECK: "{{[^"]*}}ld{{(.exe)?}}" +-// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" ++// CHECK: "crtbeginS.o" + // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" + // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." +diff --git a/test/Driver/hexagon-toolchain-elf.c b/test/Driver/hexagon-toolchain-elf.c +index a7eeca0fdb..32f648372e 100644 +--- a/test/Driver/hexagon-toolchain-elf.c ++++ b/test/Driver/hexagon-toolchain-elf.c +@@ -457,7 +457,7 @@ + // RUN: %s 2>&1 \ + // RUN: | FileCheck -check-prefix=CHECK042 %s + // CHECK042: "-cc1" +-// CHECK042: "-mrelocation-model" "static" ++// CHECK042: "-mrelocation-model" "pic" + // CHECK042: "-mllvm" "-hexagon-small-data-threshold=8" + // CHECK042-NEXT: llvm-mc + // CHECK042: "-gpsize=8" +diff --git a/test/Driver/linux-as.c b/test/Driver/linux-as.c +index 77ac05f309..cb474f3289 100644 +--- a/test/Driver/linux-as.c ++++ b/test/Driver/linux-as.c +@@ -164,7 +164,7 @@ + // CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu" + // + // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ +-// RUN: -no-integrated-as -c %s 2>&1 \ ++// RUN: -no-integrated-as -fno-pic -c %s 2>&1 \ + // RUN: | FileCheck -check-prefix=CHECK-SPARCV9 %s + // CHECK-SPARCV9: as + // CHECK-SPARCV9: -64 +@@ -173,7 +173,7 @@ + // CHECK-SPARCV9: -o + // + // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ +-// RUN: -no-integrated-as -fpic -c %s 2>&1 \ ++// RUN: -no-integrated-as -c %s 2>&1 \ + // RUN: | FileCheck -check-prefix=CHECK-SPARCV9PIC %s + // CHECK-SPARCV9PIC: as + // CHECK-SPARCV9PIC: -64 +diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c +index 70fc178c56..b52c84ce85 100644 +--- a/test/Driver/linux-ld.c ++++ b/test/Driver/linux-ld.c +@@ -1,3 +1,5 @@ ++// XFAIL: linux ++ + // General tests that ld invocations on Linux targets sane. Note that we use + // sysroot to make these tests independent of the host system. + // +diff --git a/test/Driver/ppc-abi.c b/test/Driver/ppc-abi.c +index fdcf45da29..cbd1106b7d 100644 +--- a/test/Driver/ppc-abi.c ++++ b/test/Driver/ppc-abi.c +@@ -26,11 +26,11 @@ + + // CHECK-ELFv1: "-mrelocation-model" "pic" "-pic-level" "2" + // CHECK-ELFv1: "-target-abi" "elfv1" +-// CHECK-ELFv1-LE: "-mrelocation-model" "static" ++// CHECK-ELFv1-LE: "-mrelocation-model" "pic" "-pic-level" "2" + // CHECK-ELFv1-LE: "-target-abi" "elfv1" + // CHECK-ELFv1-QPX: "-mrelocation-model" "pic" "-pic-level" "2" + // CHECK-ELFv1-QPX: "-target-abi" "elfv1-qpx" +-// CHECK-ELFv2: "-mrelocation-model" "static" ++// CHECK-ELFv2: "-mrelocation-model" "pic" "-pic-level" "2" + // CHECK-ELFv2: "-target-abi" "elfv2" + // CHECK-ELFv2-BE: "-mrelocation-model" "pic" "-pic-level" "2" + // CHECK-ELFv2-BE: "-target-abi" "elfv2" +diff --git a/test/Driver/riscv32-toolchain.c b/test/Driver/riscv32-toolchain.c +index 117c773ec9..9fffbf2aaf 100644 +--- a/test/Driver/riscv32-toolchain.c ++++ b/test/Driver/riscv32-toolchain.c +@@ -78,7 +78,7 @@ + // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" + // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv" + // C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1" +-// C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32{{/|\\\\}}crtbegin.o" ++// C-RV32-LINUX-MULTI-ILP32: "crtbeginS.o" + // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32" + // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32" + // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32" +@@ -94,7 +94,7 @@ + // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" + // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv" + // C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1" +-// C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d{{/|\\\\}}crtbegin.o" ++// C-RV32-LINUX-MULTI-ILP32D: "crtbeginS.o" + // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d" + // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d" + // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d" +diff --git a/test/Driver/riscv64-toolchain.c b/test/Driver/riscv64-toolchain.c +index 3d574947c6..20e3dc1556 100644 +--- a/test/Driver/riscv64-toolchain.c ++++ b/test/Driver/riscv64-toolchain.c +@@ -78,7 +78,7 @@ + // C-RV64-LINUX-MULTI-LP64: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" + // C-RV64-LINUX-MULTI-LP64: "-m" "elf64lriscv" + // C-RV64-LINUX-MULTI-LP64: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64.so.1" +-// C-RV64-LINUX-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64{{/|\\\\}}crtbegin.o" ++// C-RV64-LINUX-MULTI-LP64: "crtbeginS.o" + // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64" + // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64" + // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64" +@@ -94,7 +94,7 @@ + // C-RV64-LINUX-MULTI-LP64D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" + // C-RV64-LINUX-MULTI-LP64D: "-m" "elf64lriscv" + // C-RV64-LINUX-MULTI-LP64D: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64d.so.1" +-// C-RV64-LINUX-MULTI-LP64D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d{{/|\\\\}}crtbegin.o" ++// C-RV64-LINUX-MULTI-LP64D: "crtbeginS.o" + // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d" + // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64d" + // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64d" +diff --git a/test/Driver/stack-protector.c b/test/Driver/stack-protector.c +index a3e40b50ee..dfffe0d6cf 100644 +--- a/test/Driver/stack-protector.c ++++ b/test/Driver/stack-protector.c +@@ -3,11 +3,11 @@ + // NOSSP-NOT: "-stack-protector-buffer-size" + + // RUN: %clang -target i386-unknown-linux -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP +-// SSP: "-stack-protector" "1" ++// SSP: "-stack-protector" "2" + // SSP-NOT: "-stack-protector-buffer-size" + + // RUN: %clang -target i386-unknown-linux -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF +-// SSP-BUF: "-stack-protector" "1" ++// SSP-BUF: "-stack-protector" "2" + // SSP-BUF: "-stack-protector-buffer-size" "16" + + // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD