Date: Tuesday, May 2, 2023 @ 09:51:52
  Author: foutrelis
Revision: 476330

archrelease: copy trunk to extra-x86_64

Added:
  clang/repos/extra-x86_64/PKGBUILD
    (from rev 476329, clang/trunk/PKGBUILD)
  clang/repos/extra-x86_64/clang-tidy-fix-standalone-build.patch
    (from rev 476329, clang/trunk/clang-tidy-fix-standalone-build.patch)
  clang/repos/extra-x86_64/enable-fstack-protector-strong-by-default.patch
    (from rev 476329, 
clang/trunk/enable-fstack-protector-strong-by-default.patch)
  clang/repos/extra-x86_64/keys/
Deleted:
  clang/repos/extra-x86_64/PKGBUILD
  clang/repos/extra-x86_64/clang-tidy-fix-standalone-build.patch
  clang/repos/extra-x86_64/enable-fstack-protector-strong-by-default.patch
  clang/repos/extra-x86_64/keys/

-------------------------------------------------+
 PKGBUILD                                        |  304 ++++++++++------------
 clang-tidy-fix-standalone-build.patch           |   16 -
 enable-fstack-protector-strong-by-default.patch |  144 +++++-----
 3 files changed, 229 insertions(+), 235 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD    2023-05-02 09:51:41 UTC (rev 476329)
+++ PKGBUILD    2023-05-02 09:51:52 UTC (rev 476330)
@@ -1,155 +0,0 @@
-# Maintainer: Evangelos Foutras <evange...@foutrelis.com>
-# Contributor: Jan "heftig" Steffens <jan.steff...@gmail.com>
-
-pkgname=clang
-pkgver=15.0.7
-pkgrel=4
-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' 'python-recommonmark')
-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_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
-source=($_source_base/clang-$pkgver.src.tar.xz{,.sig}
-        $_source_base/clang-tools-extra-$pkgver.src.tar.xz{,.sig}
-        $_source_base/llvm-$pkgver.src.tar.xz{,.sig}
-        $_source_base/cmake-$pkgver.src.tar.xz{,.sig}
-        
$pkgname-linker-wrapper-tool.patch::https://github.com/llvm/llvm-project/commit/c2aabcfc8395.patch
-        
$pkgname-structured-bindings.patch::https://github.com/llvm/llvm-project/commit/44f2baa3804a.patch
-        enable-fstack-protector-strong-by-default.patch)
-sha256sums=('a6b673ef15377fb46062d164e8ddc4d05c348ff8968f015f7f4af03f51000067'
-            'SKIP'
-            '809a2ef46d46be3b83ca389356404ac041fa6d8f5496cb02ec35d252afb64fd1'
-            'SKIP'
-            '4ad8b2cc8003c86d0078d15d987d84e3a739f24aae9033865c027abae93ee7a4'
-            'SKIP'
-            '8986f29b634fdaa9862eedda78513969fe9788301c9f2d938f4c10a3e7a3e7ea'
-            'SKIP'
-            '640ac4858c68cc6d52226afe01a67ad017f95511636b631d826b791c5b11a47e'
-            'fd096c25f5b152238fede898ef305f506044add29bf741f074af4b9840debf21'
-            '7a9ce949579a3b02d4b91b6835c4fb45adc5f743007572fb0e28e6433e48f3a5')
-validpgpkeys=('474E22316ABF4785A88C6E8EA2C794A986419D8A'  # Tom Stellard 
<tstel...@redhat.com>
-              'D574BD5D1D0E98895E3BF90044F2485E45D59042') # Tobias Hieta 
<tob...@hieta.se>
-
-# 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-tidy-headers)
-        continue
-        ;;
-      clang|clangd|clang-*)
-        ;;
-      clang*|findAllSymbols)
-        continue
-        ;;
-    esac
-    echo $target
-  done
-}
-
-prepare() {
-  mv cmake{-$pkgver.src,}
-  cd clang-$pkgver.src
-  mkdir build
-  mv "$srcdir/clang-tools-extra-$pkgver.src" tools/extra
-  patch -Np2 -i ../enable-fstack-protector-strong-by-default.patch
-
-  # https://reviews.llvm.org/D145862
-  patch -Np2 -l -i ../$pkgname-linker-wrapper-tool.patch
-
-  # https://reviews.llvm.org/D122768 (needed for Chromium 113)
-  sed 's|clang-tools-extra|clang/tools/extra|g' \
-    ../$pkgname-structured-bindings.patch | patch -Np2
-
-  # 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() {
-  cd clang-$pkgver.src/build
-
-  # Build only minimal debug info to reduce size
-  CFLAGS=${CFLAGS/-g /-g1 }
-  CXXFLAGS=${CXXFLAGS/-g /-g1 }
-
-  local cmake_args=(
-    -G Ninja
-    -DCMAKE_BUILD_TYPE=Release
-    -DCMAKE_INSTALL_PREFIX=/usr
-    -DCMAKE_INSTALL_DOCDIR=share/doc
-    -DCMAKE_SKIP_RPATH=ON
-    -DCLANG_DEFAULT_PIE_ON_LINUX=ON
-    -DCLANG_LINK_CLANG_DYLIB=ON
-    -DENABLE_LINKER_BUILD_ID=ON
-    -DLLVM_BUILD_DOCS=ON
-    -DLLVM_BUILD_TESTS=ON
-    -DLLVM_ENABLE_RTTI=ON
-    -DLLVM_ENABLE_SPHINX=ON
-    -DLLVM_EXTERNAL_LIT=/usr/bin/lit
-    -DLLVM_INCLUDE_DOCS=ON
-    -DLLVM_LINK_LLVM_DYLIB=ON
-    -DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src"
-    -DSPHINX_WARNINGS_AS_ERRORS=OFF
-  )
-
-  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
-}
-
-check() {
-  cd clang-$pkgver.src/build
-  LD_LIBRARY_PATH=$PWD/lib ninja check-clang{,-tools}
-}
-
-_python_optimize() {
-  python -m compileall "$@"
-  python -O -m compileall "$@"
-  python -OO -m compileall "$@"
-}
-
-package() {
-  cd clang-$pkgver.src/build
-
-  DESTDIR="$pkgdir" ninja install-distribution
-  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 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/* "$pkgdir/usr/lib/clang/"
-  rmdir "$pkgdir/usr/libexec"
-  sed -i 's|libexec|lib/clang|' \
-    "$pkgdir/usr/bin/scan-build" \
-    "$pkgdir/$site_packages/libscanbuild/analyze.py"
-
-  # Compile Python scripts
-  _python_optimize "$pkgdir/usr/share" "$pkgdir/$site_packages"
-}
-
-# vim:set ts=2 sw=2 et:

Copied: clang/repos/extra-x86_64/PKGBUILD (from rev 476329, 
clang/trunk/PKGBUILD)
===================================================================
--- PKGBUILD                            (rev 0)
+++ PKGBUILD    2023-05-02 09:51:52 UTC (rev 476330)
@@ -0,0 +1,149 @@
+# Maintainer: Evangelos Foutras <evange...@foutrelis.com>
+# Contributor: Jan "heftig" Steffens <jan.steff...@gmail.com>
+
+pkgname=clang
+pkgver=15.0.7
+pkgrel=6
+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' 'python-recommonmark')
+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_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
+source=($_source_base/clang-$pkgver.src.tar.xz{,.sig}
+        $_source_base/clang-tools-extra-$pkgver.src.tar.xz{,.sig}
+        $_source_base/llvm-$pkgver.src.tar.xz{,.sig}
+        $_source_base/cmake-$pkgver.src.tar.xz{,.sig}
+        
$pkgname-linker-wrapper-tool.patch::https://github.com/llvm/llvm-project/commit/c2aabcfc8395.patch
+        enable-fstack-protector-strong-by-default.patch)
+sha256sums=('a6b673ef15377fb46062d164e8ddc4d05c348ff8968f015f7f4af03f51000067'
+            'SKIP'
+            '809a2ef46d46be3b83ca389356404ac041fa6d8f5496cb02ec35d252afb64fd1'
+            'SKIP'
+            '4ad8b2cc8003c86d0078d15d987d84e3a739f24aae9033865c027abae93ee7a4'
+            'SKIP'
+            '8986f29b634fdaa9862eedda78513969fe9788301c9f2d938f4c10a3e7a3e7ea'
+            'SKIP'
+            '640ac4858c68cc6d52226afe01a67ad017f95511636b631d826b791c5b11a47e'
+            '7a9ce949579a3b02d4b91b6835c4fb45adc5f743007572fb0e28e6433e48f3a5')
+validpgpkeys=('474E22316ABF4785A88C6E8EA2C794A986419D8A'  # Tom Stellard 
<tstel...@redhat.com>
+              'D574BD5D1D0E98895E3BF90044F2485E45D59042') # Tobias Hieta 
<tob...@hieta.se>
+
+# 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-tidy-headers)
+        continue
+        ;;
+      clang|clangd|clang-*)
+        ;;
+      clang*|findAllSymbols)
+        continue
+        ;;
+    esac
+    echo $target
+  done
+}
+
+prepare() {
+  mv cmake{-$pkgver.src,}
+  cd clang-$pkgver.src
+  mkdir build
+  mv "$srcdir/clang-tools-extra-$pkgver.src" tools/extra
+  patch -Np2 -i ../enable-fstack-protector-strong-by-default.patch
+
+  # https://reviews.llvm.org/D145862
+  patch -Np2 -l -i ../$pkgname-linker-wrapper-tool.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() {
+  cd clang-$pkgver.src/build
+
+  # Build only minimal debug info to reduce size
+  CFLAGS=${CFLAGS/-g /-g1 }
+  CXXFLAGS=${CXXFLAGS/-g /-g1 }
+
+  local cmake_args=(
+    -G Ninja
+    -DCMAKE_BUILD_TYPE=Release
+    -DCMAKE_INSTALL_PREFIX=/usr
+    -DCMAKE_INSTALL_DOCDIR=share/doc
+    -DCMAKE_SKIP_RPATH=ON
+    -DCLANG_DEFAULT_PIE_ON_LINUX=ON
+    -DCLANG_LINK_CLANG_DYLIB=ON
+    -DENABLE_LINKER_BUILD_ID=ON
+    -DLLVM_BUILD_DOCS=ON
+    -DLLVM_BUILD_TESTS=ON
+    -DLLVM_ENABLE_RTTI=ON
+    -DLLVM_ENABLE_SPHINX=ON
+    -DLLVM_EXTERNAL_LIT=/usr/bin/lit
+    -DLLVM_INCLUDE_DOCS=ON
+    -DLLVM_LINK_LLVM_DYLIB=ON
+    -DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src"
+    -DSPHINX_WARNINGS_AS_ERRORS=OFF
+  )
+
+  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
+}
+
+check() {
+  cd clang-$pkgver.src/build
+  LD_LIBRARY_PATH=$PWD/lib ninja check-clang{,-tools}
+}
+
+_python_optimize() {
+  python -m compileall "$@"
+  python -O -m compileall "$@"
+  python -OO -m compileall "$@"
+}
+
+package() {
+  cd clang-$pkgver.src/build
+
+  DESTDIR="$pkgdir" ninja install-distribution
+  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 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/* "$pkgdir/usr/lib/clang/"
+  rmdir "$pkgdir/usr/libexec"
+  sed -i 's|libexec|lib/clang|' \
+    "$pkgdir/usr/bin/scan-build" \
+    "$pkgdir/$site_packages/libscanbuild/analyze.py"
+
+  # Compile Python scripts
+  _python_optimize "$pkgdir/usr/share" "$pkgdir/$site_packages"
+}
+
+# vim:set ts=2 sw=2 et:

Deleted: clang-tidy-fix-standalone-build.patch
===================================================================
--- clang-tidy-fix-standalone-build.patch       2023-05-02 09:51:41 UTC (rev 
476329)
+++ clang-tidy-fix-standalone-build.patch       2023-05-02 09:51:52 UTC (rev 
476330)
@@ -1,8 +0,0 @@
---- tools/extra/unittests/clang-tidy/ReadabilityModuleTest.cpp.orig    
2022-04-24 02:31:36.544185904 +0000
-+++ tools/extra/unittests/clang-tidy/ReadabilityModuleTest.cpp 2022-04-24 
02:32:20.390088782 +0000
-@@ -1,4 +1,4 @@
--#include "../../clang/unittests/ASTMatchers/ASTMatchersTest.h"
-+#include "../../../../unittests/ASTMatchers/ASTMatchersTest.h"
- #include "ClangTidyTest.h"
- #include "readability/BracesAroundStatementsCheck.h"
- #include "readability/NamespaceCommentCheck.h"

Copied: clang/repos/extra-x86_64/clang-tidy-fix-standalone-build.patch (from 
rev 476329, clang/trunk/clang-tidy-fix-standalone-build.patch)
===================================================================
--- clang-tidy-fix-standalone-build.patch                               (rev 0)
+++ clang-tidy-fix-standalone-build.patch       2023-05-02 09:51:52 UTC (rev 
476330)
@@ -0,0 +1,8 @@
+--- tools/extra/unittests/clang-tidy/ReadabilityModuleTest.cpp.orig    
2022-04-24 02:31:36.544185904 +0000
++++ tools/extra/unittests/clang-tidy/ReadabilityModuleTest.cpp 2022-04-24 
02:32:20.390088782 +0000
+@@ -1,4 +1,4 @@
+-#include "../../clang/unittests/ASTMatchers/ASTMatchersTest.h"
++#include "../../../../unittests/ASTMatchers/ASTMatchersTest.h"
+ #include "ClangTidyTest.h"
+ #include "readability/BracesAroundStatementsCheck.h"
+ #include "readability/NamespaceCommentCheck.h"

Deleted: enable-fstack-protector-strong-by-default.patch
===================================================================
--- enable-fstack-protector-strong-by-default.patch     2023-05-02 09:51:41 UTC 
(rev 476329)
+++ enable-fstack-protector-strong-by-default.patch     2023-05-02 09:51:52 UTC 
(rev 476330)
@@ -1,72 +0,0 @@
-From 75c02a21f954574675020e1d76391b4896211fc7 Mon Sep 17 00:00:00 2001
-From: Evangelos Foutras <evange...@foutrelis.com>
-Date: Sun, 24 Apr 2022 06:29:44 +0300
-Subject: [PATCH] Enable -fstack-protector-strong by default
-
----
- clang/lib/Driver/ToolChains/Linux.h | 5 +++++
- clang/test/Driver/fsanitize.c       | 6 +++---
- clang/test/Driver/stack-protector.c | 4 ++--
- 3 files changed, 10 insertions(+), 5 deletions(-)
-
-diff --git a/clang/lib/Driver/ToolChains/Linux.h 
b/clang/lib/Driver/ToolChains/Linux.h
-index a5648d79d655..3c4546cb9204 100644
---- a/clang/lib/Driver/ToolChains/Linux.h
-+++ b/clang/lib/Driver/ToolChains/Linux.h
-@@ -10,6 +10,7 @@
- #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LINUX_H
- 
- #include "Gnu.h"
-+#include "clang/Basic/LangOptions.h"
- #include "clang/Driver/ToolChain.h"
- 
- namespace clang {
-@@ -46,6 +47,10 @@ public:
-   IsAArch64OutlineAtomicsDefault(const llvm::opt::ArgList &Args) const 
override;
-   bool isPIEDefault(const llvm::opt::ArgList &Args) const override;
-   bool IsMathErrnoDefault() const override;
-+  LangOptions::StackProtectorMode
-+  GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
-+    return LangOptions::SSPStrong;
-+  }
-   SanitizerMask getSupportedSanitizers() const override;
-   void addProfileRTLibs(const llvm::opt::ArgList &Args,
-                         llvm::opt::ArgStringList &CmdArgs) const override;
-diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
-index 17fce1981eea..a732d29b7688 100644
---- a/clang/test/Driver/fsanitize.c
-+++ b/clang/test/Driver/fsanitize.c
-@@ -666,12 +666,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/clang/test/Driver/stack-protector.c 
b/clang/test/Driver/stack-protector.c
-index a3e40b50eed8..dfffe0d6cf85 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" 
- 
- // 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/extra-x86_64/enable-fstack-protector-strong-by-default.patch (from 
rev 476329, clang/trunk/enable-fstack-protector-strong-by-default.patch)
===================================================================
--- enable-fstack-protector-strong-by-default.patch                             
(rev 0)
+++ enable-fstack-protector-strong-by-default.patch     2023-05-02 09:51:52 UTC 
(rev 476330)
@@ -0,0 +1,72 @@
+From 75c02a21f954574675020e1d76391b4896211fc7 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evange...@foutrelis.com>
+Date: Sun, 24 Apr 2022 06:29:44 +0300
+Subject: [PATCH] Enable -fstack-protector-strong by default
+
+---
+ clang/lib/Driver/ToolChains/Linux.h | 5 +++++
+ clang/test/Driver/fsanitize.c       | 6 +++---
+ clang/test/Driver/stack-protector.c | 4 ++--
+ 3 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/clang/lib/Driver/ToolChains/Linux.h 
b/clang/lib/Driver/ToolChains/Linux.h
+index a5648d79d655..3c4546cb9204 100644
+--- a/clang/lib/Driver/ToolChains/Linux.h
++++ b/clang/lib/Driver/ToolChains/Linux.h
+@@ -10,6 +10,7 @@
+ #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LINUX_H
+ 
+ #include "Gnu.h"
++#include "clang/Basic/LangOptions.h"
+ #include "clang/Driver/ToolChain.h"
+ 
+ namespace clang {
+@@ -46,6 +47,10 @@ public:
+   IsAArch64OutlineAtomicsDefault(const llvm::opt::ArgList &Args) const 
override;
+   bool isPIEDefault(const llvm::opt::ArgList &Args) const override;
+   bool IsMathErrnoDefault() const override;
++  LangOptions::StackProtectorMode
++  GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
++    return LangOptions::SSPStrong;
++  }
+   SanitizerMask getSupportedSanitizers() const override;
+   void addProfileRTLibs(const llvm::opt::ArgList &Args,
+                         llvm::opt::ArgStringList &CmdArgs) const override;
+diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
+index 17fce1981eea..a732d29b7688 100644
+--- a/clang/test/Driver/fsanitize.c
++++ b/clang/test/Driver/fsanitize.c
+@@ -666,12 +666,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/clang/test/Driver/stack-protector.c 
b/clang/test/Driver/stack-protector.c
+index a3e40b50eed8..dfffe0d6cf85 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" 
+ 
+ // 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

Reply via email to