Apply scan-build-py integration patch

This commit is contained in:
sergesanspaille 2021-09-10 15:30:06 +02:00
parent d99713b7d0
commit 6f2884179b
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 62eaebcb6bb872830299efa3f87506f1d23ef366 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Mon, 13 Sep 2021 10:25:45 +0200
Subject: [PATCH][clang] 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
(cherry picked from commit c84755a046bbdcd0564693e30b2508034b06002b)
---
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 9a249a8..d83ff2a 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'
--
1.8.3.1

View File

@ -68,7 +68,7 @@
Name: %pkg_name
Version: %{clang_version}%{?rc_ver:~rc%{rc_ver}}
Release: 2%{?dist}
Release: 3%{?dist}
Summary: A C language family front-end for LLVM
License: NCSA
@ -90,6 +90,7 @@ Patch1: 0002-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch
Patch2: 0003-PATCH-clang-Don-t-install-static-libraries.patch
Patch3: 0004-PATCH-clang-Prefer-gcc-toolchains-with-libgcc_s.so-w.patch
Patch4: 0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch
Patch5: 0001-PATCH-clang-Fix-scan-build-py-executable-lookup-path.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -561,6 +562,9 @@ false
%endif
%changelog
* Fri Sep 10 2021 sguelton@redhat.com - 13.0.0~rc1-3
- Apply scan-build-py intergation patch
* Thu Sep 09 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0~rc1-2
- Add macros.clang file