mirror of
https://git.proxmox.com/git/llvm-toolchain
synced 2025-08-06 23:10:15 +00:00
Ugly workaround to enable scan-build on runtimes debian/patches/use-scan-build-runtimes.diff
This commit is contained in:
parent
e1e7bfa8a1
commit
c06e88525b
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,8 +1,10 @@
|
|||||||
llvm-toolchain-snapshot (1:14~++20220107114130+3a604fdbcd5f-1~exp2) UNRELEASED; urgency=medium
|
llvm-toolchain-snapshot (1:14~++20220112110040+612f5ed88231-1~exp1) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* Remove lldb-instr to match upstream change 4609e30f5001cfcba59d1f2f90ce72ebfda6e61f
|
* Remove lldb-instr to match upstream change 4609e30f5001cfcba59d1f2f90ce72ebfda6e61f
|
||||||
|
* Ugly workaround to enable scan-build on runtimes
|
||||||
|
debian/patches/use-scan-build-runtimes.diff
|
||||||
|
|
||||||
-- Sylvestre Ledru <sylvestre@debian.org> Tue, 11 Jan 2022 10:17:57 +0100
|
-- Sylvestre Ledru <sylvestre@debian.org> Wed, 12 Jan 2022 11:00:59 +0100
|
||||||
|
|
||||||
llvm-toolchain-snapshot (1:14~++20220107114130+3a604fdbcd5f-1~exp1) experimental; urgency=medium
|
llvm-toolchain-snapshot (1:14~++20220107114130+3a604fdbcd5f-1~exp1) experimental; urgency=medium
|
||||||
|
|
||||||
|
17
debian/patches/on-the-fly/use-scan-build-runtimes.diff
vendored
Normal file
17
debian/patches/on-the-fly/use-scan-build-runtimes.diff
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
Index: llvm-toolchain-snapshot_14~++20220105111900+cdbad62c526c/clang/CMakeLists.txt
|
||||||
|
===================================================================
|
||||||
|
--- llvm-toolchain-snapshot_14~++20220105111900+cdbad62c526c.orig/clang/CMakeLists.txt
|
||||||
|
+++ llvm-toolchain-snapshot_14~++20220105111900+cdbad62c526c/clang/CMakeLists.txt
|
||||||
|
@@ -726,9 +726,9 @@ if (CLANG_ENABLE_BOOTSTRAP)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(COMPILER_OPTIONS
|
||||||
|
- -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${CXX_COMPILER}
|
||||||
|
- -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER}
|
||||||
|
- -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER}
|
||||||
|
+ -DCMAKE_CXX_COMPILER=/usr/share/clang/scan-build-${LLVM_PACKAGE_VERSION}/libexec/c++-analyzer
|
||||||
|
+ -DCMAKE_C_COMPILER=/usr/share/clang/scan-build-${LLVM_PACKAGE_VERSION}/libexec/ccc-analyzer
|
||||||
|
+ -DCMAKE_ASM_COMPILER=/usr/share/clang/scan-build-${LLVM_PACKAGE_VERSION}/libexec/ccc-analyzer
|
||||||
|
-DCMAKE_ASM_COMPILER_ID=Clang)
|
||||||
|
|
||||||
|
# cmake requires CMAKE_LINKER to be specified if the compiler is MSVC-like,
|
10
debian/rules
vendored
10
debian/rules
vendored
@ -285,11 +285,14 @@ ifeq (mipsel,$(DEB_HOST_ARCH))
|
|||||||
RUN_TEST=no
|
RUN_TEST=no
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
SCAN_BUILD=no
|
||||||
ifneq (,$(filter scan-build,$(DEB_BUILD_OPTIONS)))
|
ifneq (,$(filter scan-build,$(DEB_BUILD_OPTIONS)))
|
||||||
# enable the build using scan-build
|
# enable the build using scan-build
|
||||||
# The package are installed through the variable declarations:
|
# The package are installed through the variable declarations:
|
||||||
# OTHERMIRROR="deb http://llvm.org/apt/unstable/ llvm-toolchain main"
|
# OTHERMIRROR="deb http://llvm.org/apt/unstable/ llvm-toolchain main"
|
||||||
# EXTRAPACKAGES="clang-X"
|
# EXTRAPACKAGES="clang-X"
|
||||||
|
SCAN_BUILD=yes
|
||||||
|
patch -p1 < debian/patches/on-the-fly/use-scan-build-runtimes.diff
|
||||||
PRE_PROCESS=scan-build-$(LLVM_VERSION) --show-description -analyzer-config stable-report-filename=true
|
PRE_PROCESS=scan-build-$(LLVM_VERSION) --show-description -analyzer-config stable-report-filename=true
|
||||||
# -enable-checker optin.performance.Padding
|
# -enable-checker optin.performance.Padding
|
||||||
PRE_PROCESS_CONF=scan-build-$(LLVM_VERSION)
|
PRE_PROCESS_CONF=scan-build-$(LLVM_VERSION)
|
||||||
@ -587,7 +590,9 @@ debian-full-build:
|
|||||||
# Check the stage 2 build worked
|
# Check the stage 2 build worked
|
||||||
if ! readelf --string-dump .comment $(TARGET_BUILD_STAGE2)/bin/clang 2>&1|grep -q "clang version"; then \
|
if ! readelf --string-dump .comment $(TARGET_BUILD_STAGE2)/bin/clang 2>&1|grep -q "clang version"; then \
|
||||||
echo "clang hasn't been built using clang. Bye bye. Check that the stage2 build has been done."; \
|
echo "clang hasn't been built using clang. Bye bye. Check that the stage2 build has been done."; \
|
||||||
exit 2; \
|
if test "$(SCAN_BUILD)" = "no"; then \
|
||||||
|
exit 2; \
|
||||||
|
fi; \
|
||||||
fi
|
fi
|
||||||
if ldd $(TARGET_BUILD_STAGE2)/lib/libclang-$(LLVM_VERSION).so.1|grep -q libclang-cpp-$(LLVM_VERSION); then \
|
if ldd $(TARGET_BUILD_STAGE2)/lib/libclang-$(LLVM_VERSION).so.1|grep -q libclang-cpp-$(LLVM_VERSION); then \
|
||||||
echo "libclang-$(LLVM_VERSION).so.1 depends on libclang-cpp. Should not be the case"; \
|
echo "libclang-$(LLVM_VERSION).so.1 depends on libclang-cpp. Should not be the case"; \
|
||||||
@ -1046,6 +1051,9 @@ override_dh_auto_clean:
|
|||||||
f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \
|
f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \
|
||||||
rm -f $$f2; \
|
rm -f $$f2; \
|
||||||
done
|
done
|
||||||
|
if test "$(SCAN_BUILD)" = "yes"; then \
|
||||||
|
patch -R -p1 < debian/patches/on-the-fly/use-scan-build-runtimes.diff||true; \
|
||||||
|
fi
|
||||||
: # for some reason, the docs are written to debian/usr and debian/man ...
|
: # for some reason, the docs are written to debian/usr and debian/man ...
|
||||||
rm -rf debian/usr debian/man
|
rm -rf debian/usr debian/man
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user