[arch-commits] Commit in lib32-clang/trunk (2 files)
Evangelos Foutras
foutrelis at archlinux.org
Mon Apr 13 04:42:22 UTC 2020
Date: Monday, April 13, 2020 @ 04:42:22
Author: foutrelis
Revision: 613609
upgpkg: lib32-clang 10.0.0-1: new upstream release
Modified:
lib32-clang/trunk/PKGBUILD
lib32-clang/trunk/enable-SSP-and-PIE-by-default.patch
-------------------------------------+
PKGBUILD | 86 +++++++++-----
enable-SSP-and-PIE-by-default.patch | 197 +++++++++++++++++++---------------
2 files changed, 169 insertions(+), 114 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-04-13 04:24:11 UTC (rev 613608)
+++ PKGBUILD 2020-04-13 04:42:22 UTC (rev 613609)
@@ -2,7 +2,7 @@
# Contributor: Jan "heftig" Steffens <jan.steffens at gmail.com>
pkgname=lib32-clang
-pkgver=9.0.1
+pkgver=10.0.0
pkgrel=1
pkgdesc="C language family frontend for LLVM (32-bit)"
arch=('x86_64')
@@ -10,30 +10,50 @@
license=('custom:University of Illinois/NCSA Open Source License')
depends=('lib32-llvm-libs' 'gcc-multilib')
makedepends=('lib32-llvm' 'cmake' 'ninja' 'python')
-
-_source_base=https://releases.llvm.org/$pkgver
-if [[ ${pkgver##*.} != 0 ]]; then
- _source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
-fi
-
+_source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
source=($_source_base/clang-$pkgver.src.tar.xz{,.sig}
$_source_base/llvm-$pkgver.src.tar.xz{,.sig}
enable-SSP-and-PIE-by-default.patch)
-sha256sums=('5778512b2e065c204010f88777d44b95250671103e434f9dc7363ab2e3804253'
+sha256sums=('885b062b00e903df72631c5f98b9579ed1ed2790f74e5646b4234fa084eacb21'
'SKIP'
- '00a1ee1f389f81e9979f3a640a01c431b3021de0d42278f6508391a2f0b81c9a'
+ 'df83a44b3a9a71029049ec101fb0077ecbbdf5fe41e395215025779099a98fdf'
'SKIP'
- 'fde58a4902bec3715bc3d0c9250fa4c5f241af90bfd1e46f7128fa1435c03026')
+ '9e557a18f3ca96cc5cc9b62d2e308b993025523b2aca0735248118a928c8c3ff')
validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans at chromium.org>
validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar at redhat.com>
+# Utilizing LLVM_DISTRIBUTION_COMPONENTS to avoid
+# installing static libraries; inspired by Gentoo
+_get_distribution_components() {
+ local target
+ ninja -t targets | grep -Po 'install-\K.*(?=-stripped:)' | while read -r target; do
+ case $target in
+ clang-libraries|distribution)
+ continue
+ ;;
+ clang|clangd|clang-*)
+ ;;
+ clang*|findAllSymbols)
+ continue
+ ;;
+ esac
+ echo $target
+ done
+}
+
prepare() {
cd "$srcdir/clang-$pkgver.src"
mkdir build
- patch -Np1 -i ../enable-SSP-and-PIE-by-default.patch
+ patch -Np2 -i ../enable-SSP-and-PIE-by-default.patch
- # Avoid shipping libclang-cpp before removing BUILD_SHARED_LIBS=ON
- sed -i '/add_clang_subdirectory(clang-shlib)/d' tools/CMakeLists.txt
+ if [[ $pkgver != 10.* ]]; then
+ echo "Remove libclangHandleLLVM hack!"
+ return 1
+ fi
+ # Remove libclangHandleLLVM; breaks zig (https://reviews.llvm.org/D75579)
+ # (copied from extra/clang; might not apply here but better safe than sorry)
+ sed -i '/add_clang_subdirectory(handle-llvm)/d' \
+ tools/clang-fuzzer/CMakeLists.txt
}
build() {
@@ -45,21 +65,29 @@
# 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 \
- -DLLVM_LIBDIR_SUFFIX=32 \
- -DCMAKE_C_FLAGS:STRING=-m32 \
- -DCMAKE_CXX_FLAGS:STRING=-m32 \
- -DLLVM_CONFIG="/usr/bin/llvm-config32" \
- -DBUILD_SHARED_LIBS=ON \
- -DLLVM_LINK_LLVM_DYLIB=ON \
- -DCLANG_LINK_CLANG_DYLIB=OFF \
- -DLLVM_ENABLE_RTTI=ON \
- -DLLVM_BUILD_TESTS=OFF \
- -DLLVM_INCLUDE_DOCS=OFF \
- -DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src"
+ local cmake_args=(
+ -G Ninja
+ -DCMAKE_BUILD_TYPE=Release
+ -DCMAKE_INSTALL_PREFIX=/usr
+ -DPYTHON_EXECUTABLE=/usr/bin/python
+ -DLLVM_LIBDIR_SUFFIX=32
+ -DCMAKE_C_FLAGS:STRING=-m32
+ -DCMAKE_CXX_FLAGS:STRING=-m32
+ -DLLVM_CONFIG="/usr/bin/llvm-config32"
+ -DLLVM_LINK_LLVM_DYLIB=ON
+ -DCLANG_LINK_CLANG_DYLIB=ON
+ -DLLVM_ENABLE_RTTI=ON
+ -DLLVM_BUILD_TESTS=OFF
+ -DLLVM_INCLUDE_DOCS=OFF
+ -DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src"
+ )
+
+ cmake .. "${cmake_args[@]}"
+ local distribution_components=$(_get_distribution_components | paste -sd\;)
+ test -n "$distribution_components"
+ cmake_args+=(-DLLVM_DISTRIBUTION_COMPONENTS="$distribution_components")
+
+ cmake .. "${cmake_args[@]}"
ninja
}
@@ -66,7 +94,7 @@
package() {
cd "$srcdir/clang-$pkgver.src/build"
- DESTDIR="$pkgdir" ninja install
+ DESTDIR="$pkgdir" ninja install-distribution
rm -rf "$pkgdir"/usr/{bin,include,libexec,share}
install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
Modified: enable-SSP-and-PIE-by-default.patch
===================================================================
--- enable-SSP-and-PIE-by-default.patch 2020-04-13 04:24:11 UTC (rev 613608)
+++ enable-SSP-and-PIE-by-default.patch 2020-04-13 04:42:22 UTC (rev 613609)
@@ -1,6 +1,6 @@
-From 6a5a1f705fe44ab47ad8b52c1096451caa951b5c Mon Sep 17 00:00:00 2001
+From 9641fc2459b07c806c1e4d2a2345213ee6c2bafd Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos at foutrelis.com>
-Date: Sat, 21 Sep 2019 02:36:46 +0300
+Date: Sat, 11 Apr 2020 06:52:09 +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
@@ -17,26 +17,26 @@
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(-)
+ clang/lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++--
+ clang/lib/Driver/ToolChains/Linux.h | 1 +
+ clang/test/Driver/cross-linux.c | 16 ++++++++--------
+ clang/test/Driver/env.c | 2 +-
+ clang/test/Driver/fsanitize.c | 14 +++++++-------
+ clang/test/Driver/gcc-toolchain.cpp | 2 +-
+ clang/test/Driver/hexagon-toolchain-elf.c | 2 +-
+ clang/test/Driver/linux-as.c | 4 ++--
+ clang/test/Driver/linux-ld.c | 2 ++
+ clang/test/Driver/ppc-abi.c | 16 +++++++++-------
+ clang/test/Driver/riscv32-toolchain.c | 4 ++--
+ clang/test/Driver/riscv64-toolchain.c | 4 ++--
+ clang/test/Driver/stack-protector.c | 4 ++--
+ 13 files changed, 50 insertions(+), 35 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,
+diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
+index bff1ab1009b..da54a08657d 100644
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -917,8 +917,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs,
}
bool Linux::isPIEDefault() const {
@@ -57,11 +57,11 @@
}
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:
+diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h
+index f5518eac218..2d4973cf40c 100644
+--- a/clang/lib/Driver/ToolChains/Linux.h
++++ b/clang/lib/Driver/ToolChains/Linux.h
+@@ -37,6 +37,7 @@ public:
bool isPIEDefault() const override;
bool isNoExecStackDefault() const override;
bool IsMathErrnoDefault() const override;
@@ -69,10 +69,10 @@
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
+diff --git a/clang/test/Driver/cross-linux.c b/clang/test/Driver/cross-linux.c
+index 6c2dab26069..c28c5653e34 100644
+--- a/clang/test/Driver/cross-linux.c
++++ b/clang/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]]"
@@ -84,7 +84,7 @@
// 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 @@
+@@ -60,8 +60,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"
@@ -95,7 +95,7 @@
// 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 @@
+@@ -79,8 +79,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"
@@ -106,7 +106,7 @@
// 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 @@
+@@ -98,8 +98,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"
@@ -117,10 +117,10 @@
// 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
+diff --git a/clang/test/Driver/env.c b/clang/test/Driver/env.c
+index 0371bc91c4a..ea89f525121 100644
+--- a/clang/test/Driver/env.c
++++ b/clang/test/Driver/env.c
@@ -20,7 +20,7 @@
//
// CHECK-LD-32-NOT: warning:
@@ -130,11 +130,11 @@
// 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 @@
+diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
+index f02f94d8c5a..358917588c7 100644
+--- a/clang/test/Driver/fsanitize.c
++++ b/clang/test/Driver/fsanitize.c
+@@ -328,15 +328,15 @@
// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1
// OK
@@ -154,7 +154,7 @@
// CHECK-NO-PIE-NOT: "-pie"
// CHECK-NO-PIE: "-mrelocation-model" "static"
-@@ -645,12 +645,12 @@
+@@ -661,12 +661,12 @@
// RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP
// NOSP-NOT: "-fsanitize=safe-stack"
@@ -170,11 +170,11 @@
// 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 @@
+diff --git a/clang/test/Driver/gcc-toolchain.cpp b/clang/test/Driver/gcc-toolchain.cpp
+index 6c872f4255c..f5006d1dd9a 100644
+--- a/clang/test/Driver/gcc-toolchain.cpp
++++ b/clang/test/Driver/gcc-toolchain.cpp
+@@ -26,6 +26,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)?}}"
@@ -182,11 +182,11 @@
+// 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 @@
+diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c
+index 44bff6f703a..6575d032f5d 100644
+--- a/clang/test/Driver/hexagon-toolchain-elf.c
++++ b/clang/test/Driver/hexagon-toolchain-elf.c
+@@ -470,7 +470,7 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK042 %s
// CHECK042: "-cc1"
@@ -195,10 +195,10 @@
// 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
+diff --git a/clang/test/Driver/linux-as.c b/clang/test/Driver/linux-as.c
+index 77ac05f3094..cb474f32898 100644
+--- a/clang/test/Driver/linux-as.c
++++ b/clang/test/Driver/linux-as.c
@@ -164,7 +164,7 @@
// CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu"
//
@@ -217,10 +217,10 @@
// 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
+diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
+index 51227550b52..d01d6627131 100644
+--- a/clang/test/Driver/linux-ld.c
++++ b/clang/test/Driver/linux-ld.c
@@ -1,3 +1,5 @@
+// XFAIL: linux
+
@@ -227,29 +227,56 @@
// 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 @@
+diff --git a/clang/test/Driver/ppc-abi.c b/clang/test/Driver/ppc-abi.c
+index acc4981a2ee..50c798912d3 100644
+--- a/clang/test/Driver/ppc-abi.c
++++ b/clang/test/Driver/ppc-abi.c
+@@ -1,9 +1,9 @@
+ // Check passing PowerPC ABI options to the backend.
- // CHECK-ELFv1: "-mrelocation-model" "pic" "-pic-level" "2"
+ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+-// RUN: | FileCheck -check-prefix=CHECK-ELFv1 %s
++// RUN: | FileCheck -check-prefix=CHECK-ELFv1-PIE %s
+ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+-// RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1 %s
++// RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-PIE %s
+ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+ // RUN: -mabi=elfv1-qpx | FileCheck -check-prefix=CHECK-ELFv1-QPX %s
+ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+@@ -11,9 +11,9 @@
+ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+ // RUN: -mcpu=a2 -mqpx | FileCheck -check-prefix=CHECK-ELFv1-QPX %s
+ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+-// RUN: -mcpu=a2q -mno-qpx | FileCheck -check-prefix=CHECK-ELFv1 %s
++// RUN: -mcpu=a2q -mno-qpx | FileCheck -check-prefix=CHECK-ELFv1-PIE %s
+ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+-// RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-BE %s
++// RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-BE-PIE %s
+
+ // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+ // RUN: | FileCheck -check-prefix=CHECK-ELFv2 %s
+@@ -32,11 +32,13 @@
+
+ // CHECK-ELFv1: "-mrelocation-model" "static"
// CHECK-ELFv1: "-target-abi" "elfv1"
-// CHECK-ELFv1-LE: "-mrelocation-model" "static"
++// CHECK-ELFv1-PIE: "-mrelocation-model" "pic" "-pic-level" "2"
++// CHECK-ELFv1-PIE: "-target-abi" "elfv1"
+// 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: "-mrelocation-model" "static"
++// 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: "-mrelocation-model" "static"
// 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 @@
+diff --git a/clang/test/Driver/riscv32-toolchain.c b/clang/test/Driver/riscv32-toolchain.c
+index 2ff3a585bda..f923b728c0f 100644
+--- a/clang/test/Driver/riscv32-toolchain.c
++++ b/clang/test/Driver/riscv32-toolchain.c
+@@ -76,7 +76,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"
@@ -258,7 +285,7 @@
// 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 @@
+@@ -91,7 +91,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"
@@ -267,11 +294,11 @@
// 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 @@
+diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c
+index 42cac51de59..42a05e02fcc 100644
+--- a/clang/test/Driver/riscv64-toolchain.c
++++ b/clang/test/Driver/riscv64-toolchain.c
+@@ -76,7 +76,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"
@@ -280,7 +307,7 @@
// 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 @@
+@@ -91,7 +91,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"
@@ -289,10 +316,10 @@
// 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
+diff --git a/clang/test/Driver/stack-protector.c b/clang/test/Driver/stack-protector.c
+index a3e40b50eed..dfffe0d6cf8 100644
+--- a/clang/test/Driver/stack-protector.c
++++ b/clang/test/Driver/stack-protector.c
@@ -3,11 +3,11 @@
// NOSSP-NOT: "-stack-protector-buffer-size"
More information about the arch-commits
mailing list