[arch-commits] Commit in clang/trunk (4 files)

Evangelos Foutras foutrelis at gemini.archlinux.org
Sat Oct 23 03:27:39 UTC 2021


    Date: Saturday, October 23, 2021 @ 03:27:39
  Author: foutrelis
Revision: 426452

upgpkg: clang 13.0.0-1: new upstream release + drop Python 2

Added:
  clang/trunk/fix-scan-build-py-executable-lookup-path.patch
Modified:
  clang/trunk/PKGBUILD
  clang/trunk/enable-SSP-and-PIE-by-default.patch
Deleted:
  clang/trunk/clang-link-with-Bsymbolic-functions.patch

------------------------------------------------+
 PKGBUILD                                       |   61 ++++++--------
 clang-link-with-Bsymbolic-functions.patch      |   63 --------------
 enable-SSP-and-PIE-by-default.patch            |   98 ++++++++++++-----------
 fix-scan-build-py-executable-lookup-path.patch |   31 +++++++
 4 files changed, 111 insertions(+), 142 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-10-23 03:16:31 UTC (rev 426451)
+++ PKGBUILD	2021-10-23 03:27:39 UTC (rev 426452)
@@ -2,7 +2,7 @@
 # Contributor: Jan "heftig" Steffens <jan.steffens at gmail.com>
 
 pkgname=clang
-pkgver=12.0.1
+pkgver=13.0.0
 pkgrel=1
 pkgdesc="C language family frontend for LLVM"
 arch=('x86_64')
@@ -9,7 +9,7 @@
 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')
+makedepends=('llvm' 'cmake' 'ninja' 'python-sphinx')
 optdepends=('openmp: OpenMP support in clang with -fopenmp'
             'python: for scan-view and git-clang-format'
             'llvm: referenced by some clang headers')
@@ -20,16 +20,16 @@
 source=($_source_base/$pkgname-$pkgver.src.tar.xz{,.sig}
         $_source_base/clang-tools-extra-$pkgver.src.tar.xz{,.sig}
         $_source_base/llvm-$pkgver.src.tar.xz{,.sig}
-        clang-link-with-Bsymbolic-functions.patch
+        fix-scan-build-py-executable-lookup-path.patch
         enable-SSP-and-PIE-by-default.patch)
-sha256sums=('6e912133bcf56e9cfe6a346fa7e5c52c2cde3e4e48b7a6cc6fcc7c75047da45f'
+sha256sums=('5d611cbb06cfb6626be46eb2f23d003b2b80f40182898daa54b1c4e8b5b9e17e'
             'SKIP'
-            '65659efdf97dbed70ae0caee989936b731f249dddc46f1cb4225b2f49b232ae5'
+            '428b6060a28b22adf0cdf5d827abbc2ba81809f4661ede3d02b1d3fedaa3ead5'
             'SKIP'
-            '7d9a8405f557cefc5a21bf5672af73903b64749d9bc3a50322239f56f34ffddf'
+            '408d11708643ea826f519ff79761fcdfc12d641a2510229eec459e72f8163020'
             'SKIP'
-            '5bc0b47c70990bb8dd0cf4138a8ab9e15cf6b008b7c0cf2c7aac3736b559e0e6'
-            'a877fa5cf1c1cca3bd55f9a36cf8c1bdd061ff398aeace90fe3cbd9e82550da3')
+            '578b960121c42b8db80566dcb51558409d04455b618cdd608e41b35ded36c13e'
+            '67706047fc93a2e79185d344bdac48219ce042c55ddb9b9397bc98db2153ba58')
 validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans at chromium.org>
 validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar at redhat.com>
 
@@ -61,8 +61,11 @@
   mv "$srcdir/clang-tools-extra-$pkgver.src" tools/extra
   patch -Np2 -i ../enable-SSP-and-PIE-by-default.patch
 
-  # https://bugs.archlinux.org/task/70697
-  patch -Np2 -i ../clang-link-with-Bsymbolic-functions.patch
+  patch -Np2 -i ../fix-scan-build-py-executable-lookup-path.patch
+
+  # Attempt to convert script to Python 3
+  2to3 -wn --no-diffs \
+    tools/extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
 }
 
 build() {
@@ -98,17 +101,12 @@
   ninja check-clang{,-tools}
 }
 
-_python2_optimize() {
-  python2 -m compileall "$@"
-  python2 -O -m compileall "$@"
+_python_optimize() {
+  python -m compileall "$@"
+  python -O -m compileall "$@"
+  python -OO -m compileall "$@"
 }
 
-_python3_optimize() {
-  python3 -m compileall "$@"
-  python3 -O -m compileall "$@"
-  python3 -OO -m compileall "$@"
-}
-
 package() {
   cd "$srcdir/$pkgname-$pkgver.src/build"
 
@@ -118,26 +116,19 @@
   # Remove documentation sources
   rm -r "$pkgdir"/usr/share/doc/clang{,-tools}/html/{_sources,.buildinfo}
 
+  # Move scanbuild-py into site-packages and install Python bindings
+  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+  install -d "$pkgdir/$site_packages"
+  mv "$pkgdir"/usr/lib/{libear,libscanbuild} "$pkgdir/$site_packages/"
+  cp -a ../bindings/python/clang "$pkgdir/$site_packages/"
+
   # Move analyzer scripts out of /usr/libexec
-  mv "$pkgdir"/usr/libexec/{ccc,c++}-analyzer "$pkgdir/usr/lib/clang/"
+  mv "$pkgdir"/usr/libexec/* "$pkgdir/usr/lib/clang/"
   rmdir "$pkgdir/usr/libexec"
-  sed -i 's|libexec|lib/clang|' "$pkgdir/usr/bin/scan-build"
+  sed -i 's|libexec|lib/clang|' "$pkgdir/$site_packages/libscanbuild/analyze.py"
 
-  # Install Python bindings
-  for _py in 2.7 3.9; 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
-  touch -d @$SOURCE_DATE_EPOCH "$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'
+  _python_optimize "$pkgdir/usr/share" "$pkgdir/$site_packages"
 }
 
 # vim:set ts=2 sw=2 et:

Deleted: clang-link-with-Bsymbolic-functions.patch
===================================================================
--- clang-link-with-Bsymbolic-functions.patch	2021-10-23 03:16:31 UTC (rev 426451)
+++ clang-link-with-Bsymbolic-functions.patch	2021-10-23 03:27:39 UTC (rev 426452)
@@ -1,63 +0,0 @@
-From 4f05f4c8e66bc76b1d94f5283494404382e3bacd Mon Sep 17 00:00:00 2001
-From: Fangrui Song <i at maskray.me>
-Date: Thu, 13 May 2021 13:44:57 -0700
-Subject: [PATCH] [CMake][ELF] Link libLLVM.so and libclang-cpp.so with
- -Bsymbolic-functions
-
-llvm-dev message: https://lists.llvm.org/pipermail/llvm-dev/2021-May/150465.html
-
-In an ELF shared object, a default visibility defined symbol is preemptible by
-default. This creates some missed optimization opportunities.
--Bsymbolic-functions is more aggressive than our current -fvisibility-inlines-hidden
-(present since 2012) as it applies to all function definitions.  It can
-
-* avoid PLT for cross-TU function calls && reduce dynamic symbol lookup
-* reduce dynamic symbol lookup for taking function addresses and optimize out GOT/TOC on x86-64/ppc64
-
-In a -DLLVM_TARGETS_TO_BUILD=X86 build, the number of JUMP_SLOT decreases from 12716 to 1628, and the number of GLOB_DAT decreases from 1918 to 1313
-The built clang with `-DLLVM_LINK_LLVM_DYLIB=on -DCLANG_LINK_CLANG_DYLIB=on` is significantly faster.
-See the Linux kernel build result https://bugs.archlinux.org/task/70697
-
-Note: the performance of -fno-semantic-interposition -Bsymbolic-functions
-libLLVM.so and libclang-cpp.so is close to a PIE binary linking against
-`libLLVM*.a` and `libclang*.a`. When the host compiler is Clang,
--Bsymbolic-functions is the major contributor.  On x86-64 (with GOTPCRELX) and
-ppc64 ELFv2, the GOT/TOC relocations can be optimized.
-
-Some implication:
-
-Interposing a subset of functions is no longer supported.
-(This is fragile on ELF and unsupported on Mach-O at all. For Mach-O we don't
-use `ld -interpose` or `-flat_namespace`)
-
-Compiling a program which takes the address of any LLVM function with
-`{gcc,clang} -fno-pic` and expects the address to equal to the address taken
-from libLLVM.so or libclang-cpp.so is unsupported. I am fairly confident that
-llvm-project shouldn't have different behaviors depending on such pointer
-equality (as we've been using -fvisibility-inlines-hidden which applies to
-inline functions for a long time), but if we accidentally do, users should be
-aware that they should not make assumption on pointer equality in `-fno-pic`
-mode.
-
-See more on https://maskray.me/blog/2021-05-09-fno-semantic-interposition
-
-Reviewed By: phosek
-
-Differential Revision: https://reviews.llvm.org/D102090
----
- clang/tools/clang-shlib/CMakeLists.txt | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/clang/tools/clang-shlib/CMakeLists.txt b/clang/tools/clang-shlib/CMakeLists.txt
-index 5949223fc8e3..d08cf8938328 100644
---- a/clang/tools/clang-shlib/CMakeLists.txt
-+++ b/clang/tools/clang-shlib/CMakeLists.txt
-@@ -48,3 +48,8 @@ add_clang_library(clang-cpp
-                   ${_OBJECTS}
-                   LINK_LIBS
-                   ${_DEPS})
-+# Optimize function calls for default visibility definitions to avoid PLT and
-+# reduce dynamic relocations.
-+if (NOT APPLE)
-+  target_link_options(clang-cpp PRIVATE LINKER:-Bsymbolic-functions)
-+endif()

Modified: enable-SSP-and-PIE-by-default.patch
===================================================================
--- enable-SSP-and-PIE-by-default.patch	2021-10-23 03:16:31 UTC (rev 426451)
+++ enable-SSP-and-PIE-by-default.patch	2021-10-23 03:27:39 UTC (rev 426452)
@@ -1,6 +1,6 @@
-From 6878f5376dec0a3d75674d5a2076d4af911f7c7c Mon Sep 17 00:00:00 2001
+From 683787b5c5c075f53a95f4d85f76302111c89914 Mon Sep 17 00:00:00 2001
 From: Evangelos Foutras <evangelos at foutrelis.com>
-Date: Wed, 12 May 2021 08:55:14 +0300
+Date: Sat, 23 Oct 2021 05:08:48 +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
@@ -22,7 +22,7 @@
  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/gcc-toolchain.cpp       |  6 +++---
  clang/test/Driver/hexagon-toolchain-elf.c |  2 +-
  clang/test/Driver/hip-fpie-option.hip     |  4 ++--
  clang/test/Driver/linux-as.c              |  4 ++--
@@ -31,13 +31,13 @@
  clang/test/Driver/riscv32-toolchain.c     |  4 ++--
  clang/test/Driver/riscv64-toolchain.c     |  4 ++--
  clang/test/Driver/stack-protector.c       |  4 ++--
- 14 files changed, 54 insertions(+), 37 deletions(-)
+ 14 files changed, 56 insertions(+), 39 deletions(-)
 
 diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
-index 9663a7390ada..2f8d01092557 100644
+index c9360fc67165..2b60460e6604 100644
 --- a/clang/lib/Driver/ToolChains/Linux.cpp
 +++ b/clang/lib/Driver/ToolChains/Linux.cpp
-@@ -832,8 +832,14 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs,
+@@ -652,8 +652,14 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs,
  }
  
  bool Linux::isPIEDefault() const {
@@ -53,9 +53,9 @@
 +  return true;
  }
  
- bool Linux::isNoExecStackDefault() const {
+ bool Linux::IsAArch64OutlineAtomicsDefault(const ArgList &Args) const {
 diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h
-index 6b16b0e64990..04c4d176ca71 100644
+index 169a37c44072..a6458092462e 100644
 --- a/clang/lib/Driver/ToolChains/Linux.h
 +++ b/clang/lib/Driver/ToolChains/Linux.h
 @@ -10,6 +10,7 @@
@@ -66,7 +66,7 @@
  #include "clang/Driver/ToolChain.h"
  
  namespace clang {
-@@ -39,6 +40,10 @@ public:
+@@ -46,6 +47,10 @@ public:
    bool isPIEDefault() const override;
    bool isNoExecStackDefault() const override;
    bool IsMathErrnoDefault() const override;
@@ -78,71 +78,71 @@
    void addProfileRTLibs(const llvm::opt::ArgList &Args,
                          llvm::opt::ArgStringList &CmdArgs) const override;
 diff --git a/clang/test/Driver/cross-linux.c b/clang/test/Driver/cross-linux.c
-index 6c2dab260695..c28c5653e348 100644
+index 59f5a97d2d9d..8d0e9e724aa0 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"
+@@ -43,8 +43,8 @@
+ // CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/10.2.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: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/10.2.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:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/10.2.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"
-@@ -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"
+@@ -61,8 +61,8 @@
+ // CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/10.2.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: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/10.2.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:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/10.2.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"
+ // CHECK-MULTI32-X86-64: "-L[[sysroot]]/lib"
 @@ -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: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/10.2.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: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/10.2.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:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/10.2.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"
-@@ -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-I386: "-L[[sysroot]]/lib"
+@@ -97,8 +97,8 @@
+ // CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/10.2.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: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/10.2.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:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/10.2.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/clang/test/Driver/env.c b/clang/test/Driver/env.c
-index 0371bc91c4a3..ea89f5251217 100644
+index e9b86cbcf428..47f304c0420d 100644
 --- a/clang/test/Driver/env.c
 +++ b/clang/test/Driver/env.c
-@@ -20,7 +20,7 @@
+@@ -22,7 +22,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: "{{.*}}/usr/lib/gcc/i386-unknown-linux/10.2.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/../../.."
+ // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0"
+ // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../i386-unknown-linux/lib"
+ // CHECK-LD-32: "-L[[SYSROOT]]/lib"
 diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
-index 8926d55a0cf4..40f628ccae45 100644
+index b7d61abe7ec5..461b69b0ac15 100644
 --- a/clang/test/Driver/fsanitize.c
 +++ b/clang/test/Driver/fsanitize.c
-@@ -330,15 +330,15 @@
+@@ -344,15 +344,15 @@
  // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1
  // OK
  
@@ -162,7 +162,7 @@
  
  // CHECK-NO-PIE-NOT: "-pie"
  // CHECK-NO-PIE: "-mrelocation-model" "static"
-@@ -667,12 +667,12 @@
+@@ -687,12 +687,12 @@
  // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP
  // NOSP-NOT: "-fsanitize=safe-stack"
  
@@ -179,17 +179,26 @@
  // NO-SP-NOT: stack-protector
  // NO-SP: "-fsanitize=safe-stack"
 diff --git a/clang/test/Driver/gcc-toolchain.cpp b/clang/test/Driver/gcc-toolchain.cpp
-index 6c872f4255c3..f5006d1dd9ab 100644
+index 7cdba0841b8c..655457d62bf8 100644
 --- a/clang/test/Driver/gcc-toolchain.cpp
 +++ b/clang/test/Driver/gcc-toolchain.cpp
-@@ -26,6 +26,6 @@
+@@ -23,7 +23,7 @@
  // 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/../../../.."
+-// CHECK-SAME: "{{[^"]*}}/usr/lib/gcc/x86_64-linux-gnu/4.8{{/|\\\\}}crtbegin.o"
++// CHECK-SAME: "crtbeginS.o"
+ // CHECK-SAME: "-L[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8"
+ /// On x86_64, there is an extra usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu but we should not test it.
+ 
+@@ -35,5 +35,5 @@
+ // RUN:   --target=aarch64-suse-linux -B%S/Inputs/opensuse_42.2_aarch64_tree/usr | \
+ // RUN:   FileCheck %s --check-prefix=NO_AARCH64
+ 
+-// AARCH64:        Inputs{{[^"]+}}aarch64-suse-linux/{{[^"]+}}crt1.o"
+-// NO_AARCH64-NOT: Inputs{{[^"]+}}aarch64-suse-linux/{{[^"]+}}crt1.o"
++// AARCH64:        Inputs{{[^"]+}}aarch64-suse-linux/{{[^"]+}}crti.o"
++// NO_AARCH64-NOT: Inputs{{[^"]+}}aarch64-suse-linux/{{[^"]+}}crti.o"
 diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c
 index cc11f9fcba9e..1fe8b5db587b 100644
 --- a/clang/test/Driver/hexagon-toolchain-elf.c
@@ -244,10 +253,11 @@
  // CHECK-SPARCV9PIC: as
  // CHECK-SPARCV9PIC: -64
 diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
-index 24d3c78643f8..9ea22e6e0f64 100644
+index cc505588331b..c7f81d2c5e49 100644
 --- a/clang/test/Driver/linux-ld.c
 +++ b/clang/test/Driver/linux-ld.c
-@@ -1,3 +1,5 @@
+@@ -1,4 +1,6 @@
+ // UNSUPPORTED: system-windows
 +// XFAIL: linux
 +
  // General tests that ld invocations on Linux targets sane. Note that we use

Added: fix-scan-build-py-executable-lookup-path.patch
===================================================================
--- fix-scan-build-py-executable-lookup-path.patch	                        (rev 0)
+++ fix-scan-build-py-executable-lookup-path.patch	2021-10-23 03:27:39 UTC (rev 426452)
@@ -0,0 +1,31 @@
+From c84755a046bbdcd0564693e30b2508034b06002b Mon Sep 17 00:00:00 2001
+From: serge-sans-paille <sguelton at redhat.com>
+Date: Mon, 13 Sep 2021 10:25:45 +0200
+Subject: [PATCH] Fix scan-build-py executable lookup path
+
+Once installed, scan-build-py doesn't know anything about its auxiliary
+executable and can't find them.
+Use relative path wrt. scan-build-py script.
+
+Differential Revision: https://reviews.llvm.org/D109659
+---
+ clang/tools/scan-build-py/lib/libscanbuild/analyze.py | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/clang/tools/scan-build-py/lib/libscanbuild/analyze.py b/clang/tools/scan-build-py/lib/libscanbuild/analyze.py
+index 9a249a8e15cb..d83ff2aefab9 100644
+--- a/clang/tools/scan-build-py/lib/libscanbuild/analyze.py
++++ b/clang/tools/scan-build-py/lib/libscanbuild/analyze.py
+@@ -39,8 +39,10 @@ from libscanbuild.shell import decode
+ 
+ __all__ = ['scan_build', 'analyze_build', 'analyze_compiler_wrapper']
+ 
+-COMPILER_WRAPPER_CC = 'analyze-cc'
+-COMPILER_WRAPPER_CXX = 'analyze-c++'
++scanbuild_dir = os.path.dirname(__import__('sys').argv[0])
++
++COMPILER_WRAPPER_CC = os.path.join(scanbuild_dir, '..', 'libexec', 'analyze-cc')
++COMPILER_WRAPPER_CXX = os.path.join(scanbuild_dir, '..', 'libexec', 'analyze-c++')
+ 
+ CTU_EXTDEF_MAP_FILENAME = 'externalDefMap.txt'
+ CTU_TEMP_DEFMAP_FOLDER = 'tmpExternalDefMaps'



More information about the arch-commits mailing list