Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 EMPTYscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/EMPTY. =
4 COMMAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/COMMA. = ,
5 SPACEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SPACE. = $(EMPTYscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/EMPTY.) $(EMPTYscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/EMPTY.)
6
7 # Check if DEB_BUILD_OPTIONS contains a comma and break the build
8 ifneq (,$(findstringscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/findstring. $(COMMAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/COMMA.),$(DEB_BUILD_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_OPTIONS.)))
9 $(scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().errorscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/error. scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().DEB_BUILD_OPTIONS scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().contains scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().a scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().comma, scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().which scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().is scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().not scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().supported. scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().Please scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().use scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().spaces scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().to scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().separate scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().options.)scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`$(error DEB_BUILD_OPTIONS contains a comma, which is not supported. Please use spaces to separate options.)`().
10 endif
11
12 # polly & lldb aren't enabled for every platform
13 PROJECTSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PROJECTS. = clang;clang-tools-extra;lld;cross-project-tests;mlir
14 # openmp & libunwind aren't enabled for every platform
15
16 DEB_BUILD_PROFILESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_PROFILES. := $(DEB_BUILD_PROFILESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_PROFILES.)
17 export DEB_BUILD_PROFILESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_PROFILES.
18
19 # FIXME: disable some PROJECTS according to build profiles
20 #ifeq (,$(filter pkg.llvm.noclang, $(DEB_BUILD_PROFILES)))
21 # DEB_BUILD_PROFILES += pkg.llvm.noclang
22 # $(warning LLVM PROFILES: enabled build profile pkg.llvm.noclang)
23 #endif
24
25 TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD. := build-llvm
26 TARGET_BUILD_STAGE2scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD_STAGE2. := $(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.)/tools/clang/stage2-bins
27 dscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/d. = debian/tmp
28 DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST. := $(CURDIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CURDIR.)/$(dscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/d.)
29
30 GXX_VERSIONED_PACKAGEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GXX_VERSIONED_PACKAGE. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dpkg-query -W -f '$${Depends}' g++ | grep -o 'g++-[0-9][0-9.]*' | tail -n1 )
31 GXX_VERSIONED_EXECUTABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GXX_VERSIONED_EXECUTABLE. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dpkg -L $(GXX_VERSIONED_PACKAGEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GXX_VERSIONED_PACKAGE.) | grep '/usr/bin/g++-[0-9][0-9.]*' | xargs ls -d | tail -n1 )
32 GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION. := $(substscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/subst. /usr/bin/g++-,,$(GXX_VERSIONED_EXECUTABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GXX_VERSIONED_EXECUTABLE.))
33
34 PYTHON3scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PYTHON3. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. py3versions -d)
35 PY_EXT_SUFFIXscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PY_EXT_SUFFIX. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. python3-config --extension-suffix)
36
37 PKG_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PKG_VERSION. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
38 LLVM_EPOCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_EPOCH. := 1:
39 LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. echo $(PKG_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PKG_VERSION.) | sed -rne "s,^1:([0-9]+).*,\1,p")
40 LLVM_VERSION_FULLscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_FULL. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. echo $(PKG_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PKG_VERSION.) | sed -rne "s,^1:([0-9.]+)(~|-)(.*),\1,p")
41 LLVM_VERSION_MINORscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_MINOR. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. echo $(PKG_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PKG_VERSION.) | sed -rne "s,^1:[0-9]+\.([0-9]+)\.[0-9]+.*,\1,p")
42 LLVM_VERSION_SNAPSHOTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_SNAPSHOT. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. echo $(PKG_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PKG_VERSION.) | sed -rne "s,^1:(.*),\1,p")
43 ifeq ($(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.),$(LLVM_VERSION_FULLscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_FULL.))
44 LLVM_VERSION_FULL := $(LLVM_VERSION).0.0
45 LLVM_VERSION_MINOR := 0
46 endif
47 LLVM_VERSION_NEXTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_NEXT. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. echo $(LLVM_VERSION_FULLscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_FULL.) | awk -F. '{ OFS="."; $$NF+=1; print}')
48 LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR. = usr/lib/llvm-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)
49 LLVM_LIBDIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_LIBDIR. = usr/lib/llvm-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)/lib
50
51 # Source-package integrity checks (defines APT_LLVM_ORG,
52 # GENERATED_TRACKED_FILES and the snapshot/verify canned recipes).
53 include debian/source-integrity.mk
54
55 # Version cap used for the libc++/libomp/libunwind move Breaks/Replaces.
56 # For apt.llvm.org snapshot builds we need a different cap so it matches
57 # the previously-published snapshot package version. See debian/control.in
58 # (@LIBCXX_MOVE_VERSION@) for the call sites.
59 ifeq ($(APT_LLVM_ORGscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/APT_LLVM_ORG.),yes)
60 LIBCXX_MOVE_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCXX_MOVE_VERSION. = 1:22~++20251113081817
61 else
62 LIBCXX_MOVE_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCXX_MOVE_VERSION. = 1:22~++20251023025710+3f47a7be1ae6-1~exp4
63 endif
64
65 # dpkg-buildflags support
66 # disable fixfilepath in favor of the llvm-project supplied flavor, disable lto
67 # remove +time64,+lfs once the time64_t transition starts
68 RUNTIMESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RUNTIMES. = compiler-rt;libcxx;libcxxabi
69 ifeq ($(DEB_HOST_ARCH_CPUscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH_CPU.),i386)
70 export DEB_BUILD_MAINT_OPTIONS = reproducible=-fixfilepath,-fixdebugpath optimize=-lto
71 else
72 ifeq ($(DEB_HOST_ARCH_BITS),32)
73 export DEB_BUILD_MAINT_OPTIONS = reproducible=-fixfilepath,-fixdebugpath optimize=-lto abi=+time64,+lfs
74 else
75 ifeq ($(DEB_HOST_ARCH),mips64el)
76 export DEB_BUILD_MAINT_OPTIONS = reproducible=-fixfilepath,-fixdebugpath optimize=-lto hardening=-stackprotector,-stackprotectorstrong
77 else
78 export DEB_BUILD_MAINT_OPTIONS = reproducible=-fixfilepath,-fixdebugpath optimize=-lto
79 endif
80 endif
81 endif
82
83 SOURCE_NAMEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SOURCE_NAME. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dpkg-parsechangelog -S Source)
84 ifneq (,$(findstringscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/findstring. snapshot,$(SOURCE_NAMEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SOURCE_NAME.)))
85 BRANCH_NAME=snapshot
86 else
87 BRANCH_NAME=$(LLVM_VERSION)
88 endif
89
90 VENDORscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/VENDOR.=$(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. lsb_release -is)
91 DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.=$(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. lsb_release -sc)
92 DERIVATIVEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DERIVATIVE. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. if dpkg-vendor --derives-from Ubuntu; then echo Ubuntu; \
93 elif dpkg-vendor --derives-from Debian; then echo Debian; \
94 else echo Unknown; fi)
95
96 SONAME_EXTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SONAME_EXT. := 1
97 SONAME_OPENMPscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SONAME_OPENMP. := 5
98 # Manage the case when the version is 3.5~svn213052-1~exp1 or 3.4.2-1
99 DEBIAN_REVISIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEBIAN_REVISION. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\3,p")
100 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. parallel=%,$(substscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/subst. $(COMMAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/COMMA.), ,$(DEB_BUILD_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_OPTIONS.))))
101 NCPUS := $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
102 else
103 NCPUS := $(shell nproc)
104 endif
105
106 # Check if a package meets version requirement
107 # Usage: $(call check_pkg_version,package-name,operator,version)
108 # Operators: ge (>=), gt (>), le (<=), lt (<), eq (=)
109 # Returns: yes or no
110 define check_pkg_versionscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/check_pkg_version.
111 $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. v=$$(dpkg-query -W -f '$${Version}' $(1) 2>/dev/null); \
112 if [ -z "$$v" ]; then \
113 echo no; \
114 elif dpkg --compare-versions "$$v" $(2) $(3); then \
115 echo yes; \
116 else \
117 echo no; \
118 fi)
119 endef
120
121 # Remove RPATH/RUNPATH from files matching a pattern
122 # Usage: $(call remove_rpath,file-pattern)
123 # Example: $(call remove_rpath,$(DEB_INST)/$(LLVM_DIR)/bin/*)
124 define remove_rpathscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/remove_rpath.
125 for i in \
126 `chrpath -k $(1) 2>/dev/null | awk -F: '/R(UN)?PATH=/ {print $$$$1}'`; \
127 do \
128 [ -h $$$$i ] && continue; \
129 chrpath -d $$$$i; \
130 echo "removed RPATH/RUNPATH: $$$$i"; \
131 done
132 endef
133
134 # Generate CMAKE compiler and linker flags
135 # Usage: $(call CMAKE_FLAGS,cflags,cxxflags,ldflags)
136 # Example: $(call CMAKE_FLAGS,$(STAGE_1_CFLAGS),$(STAGE_1_CXXFLAGS),$(STAGE_1_LDFLAGS))
137 define CMAKE_FLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CMAKE_FLAGS.
138 -DCMAKE_C_FLAGS="$(1)" \
139 -DCMAKE_CXX_FLAGS="$(2)" \
140 -DCMAKE_SHARED_LINKER_FLAGS="$(3)" \
141 -DCMAKE_MODULE_LINKER_FLAGS="$(3)" \
142 -DCMAKE_EXE_LINKER_FLAGS="$(3)"
143 endef
144
145 # Generate nested CMAKE args for BUILTINS_CMAKE_ARGS, RUNTIMES_CMAKE_ARGS, etc.
146 # Usage: $(call CMAKE_NESTED_FLAGS,cflags,cxxflags,ldflags)
147 # Optional 4th arg for build type (defaults to Release)
148 # Optional 5th arg for additional flags
149 define CMAKE_NESTED_FLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CMAKE_NESTED_FLAGS.
150 -DCMAKE_C_FLAGS=$(1);-DCMAKE_CXX_FLAGS=$(2);-DCMAKE_EXE_LINKER_FLAGS=$(3);-DCMAKE_SHARED_LINKER_FLAGS=$(3);-DCMAKE_MODULE_LINKER_FLAGS=$(3);-DCMAKE_BUILD_TYPE=$(if $(4),$(4),Release);$(if $(5),$(5);)-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF
151 endef
152
153 # Generate BOOTSTRAP_CMAKE flags (prepends BOOTSTRAP_ to flag names)
154 # Usage: $(call BOOTSTRAP_CMAKE_FLAGS,cflags,cxxflags,ldflags)
155 define BOOTSTRAP_CMAKE_FLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BOOTSTRAP_CMAKE_FLAGS.
156 -DBOOTSTRAP_CMAKE_C_FLAGS="$(1)" \
157 -DBOOTSTRAP_CMAKE_CXX_FLAGS="$(2)" \
158 -DBOOTSTRAP_CMAKE_SHARED_LINKER_FLAGS="$(3)" \
159 -DBOOTSTRAP_CMAKE_MODULE_LINKER_FLAGS="$(3)" \
160 -DBOOTSTRAP_CMAKE_EXE_LINKER_FLAGS="$(3)"
161 endef
162
163 # set this macro to anything else than "yes" to avoid generating alternative
164 # build dependencies on hello in the control file.
165 BD_ALT_HELLOscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BD_ALT_HELLO. = yes
166 ifeq ($(DERIVATIVEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DERIVATIVE.),Ubuntu)
167 BD_ALT_HELLOscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BD_ALT_HELLO. = no
168 endif
169
170 ifeq ($(BD_ALT_HELLOscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BD_ALT_HELLO.),yes)
171 BD_ALT_HELLO_SUBST = 's/@BEGIN_OPTIONAL_HELLO@//g;s/@END_OPTIONAL_HELLO@//g'
172 else
173 BD_ALT_HELLO_SUBST = 's/@BEGIN_OPTIONAL_HELLO@.*@END_OPTIONAL_HELLO@//'
174 endif
175
176 SKIP_COMMON_PACKAGESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SKIP_COMMON_PACKAGES. =
177 # for distro builds, skip these if a newer LLVM is in the distro series
178 ifeq ($(DERIVATIVEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DERIVATIVE.),Ubuntu)
179 # list series which should not have the common packages
180 ifneq (,$(filter $(DISTRO), series1 series2))
181 SKIP_COMMON_PACKAGES = yes
182 endif
183 else ifeq ($(DERIVATIVEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DERIVATIVE.),Debian)
184 ifneq (,$(filter $(DISTRO), series1 series2))
185 SKIP_COMMON_PACKAGES = yes
186 endif
187 endif
188 # set these two when building without the common packages
189 #SKIP_COMMON_PACKAGES = yes
190 #NEW_LLVM_VERSION = 23
191
192 ifeq ($(SKIP_COMMON_PACKAGESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SKIP_COMMON_PACKAGES.),yes)
193 COMMON_PKGS := $(shell cat debian/packages.common)
194 COMMON_BUILD_DEPS = $(foreach p,$(COMMON_PKGS),$(p)$(COMMA))
195 # make sure the common packages exist for the new LLVM version
196 NEXT_LIBLLVM_PKG = libllvm$(NEW_LLVM_VERSION),
197 endif
198
199 # some object files are removed for space constraints during the build
200 # uncomment to keep everything during a build
201 # a SMALL_DISK build is 15GB + <2GB in the parent directory, the full build
202 # peaks out at 35GB + <2GB for the parent directory.
203 #SMALL_DISK = yes
204
205 # use sloppy builds to collect to
206 # - ignore additional build artifacts
207 # - ignore missing symbols in libraries
208 # look at these in the build logs and fix them in follow-up uploads
209 SLOPPY_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SLOPPY_BUILD. =
210 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), amd64XXX arm64XXX))
211 SLOPPY_BUILD = yes
212 ignore_if_fail = -
213 endif
214
215 # this contains all packages to be built. Note that for at least the clean target,
216 # this always includes the binary-indep packages.
217 packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dh_listpackages)
218
219 # no 32bit support
220 FLANG_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/FLANG_ARCHS. := amd64 arm64 ppc64el ppc64 sparc64 riscv64 loong64
221
222 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), $(FLANG_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/FLANG_ARCHS.)))
223 # this doesn't work, Ubuntu passes these in both positive and negative form, filter later
224 # export DEB_BUILD_MAINT_OPTIONS += hardening=-stackprotector,-stackclash,-branch
225 endif
226
227 # flang has some memory hogs, of up to 6.2gb per process. Limit the parallel jobs
228 # based on the available memory
229 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), $(FLANG_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/FLANG_ARCHS.)))
230 MEM_PER_CPU=6000
231 else
232 MEM_PER_CPU=2100
233 endif
234
235 NJOBSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/NJOBS. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. mt=`awk '/^(MemAvail|SwapFree)/ { mt += $$2 } END {print mt}' /proc/meminfo`; \
236 awk -vn=$(NCPUSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/NCPUS.) -vmt=$$mt -vm=$(MEM_PER_CPUscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/MEM_PER_CPU.) \
237 'END { mt/=1024; n2 = int(mt/m); print n==1 || n2<=1 ? 1 : n2<=n ? n2 : n }' < /dev/null)
238
239 TIME_COMMANDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TIME_COMMAND. = $(CURDIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CURDIR.)/debian/usage-wrapper.py $(SUMMARY_ONLYscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SUMMARY_ONLY.) -j $(NJOBSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/NJOBS.) --base-memory -m 4.0 -o usage-$(notdirscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/notdir. $@)-$(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.).svg
240 TIME_BINscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TIME_BIN. := $(ifscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/if. $(wildcardscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/wildcard. /usr/bin/time),/usr/bin/time,/bin/time)
241 TIME_COMMANDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TIME_COMMAND. = $(TIME_BINscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TIME_BIN.) -v
242 USAGE_BUILD_DEPscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/USAGE_BUILD_DEP. = $(EMPTYscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/EMPTY.) time,
243 ifneq (,$(findstringscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/findstring. usage-wrapper, $(TIME_COMMANDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TIME_COMMAND.)))
244 ifeq ($(DERIVATIVE),Ubuntu)
245 USAGE_BUILD_DEP = $(EMPTY) python3:any, python3-psutil, python3-matplotlib [!i386],
246 ifeq ($(DEB_HOST_ARCH),i386)
247 SUMMARY_ONLY = --summary-only
248 endif
249 else
250 USAGE_BUILD_DEP = $(EMPTY) python3:any, python3-psutil [!hurd-i386 !hurd-amd64], python3-matplotlib [!m68k !sh4 !x32 !hurd-i386 !hurd-amd64],
251 ifneq (,$(filter $(DEB_HOST_ARCH), hurd-i386 hurd-amd64))
252 TIME_COMMAND = $(TIME_BIN) -v
253 endif
254 ifneq (,$(filter $(DEB_HOST_ARCH), m68k sh4 x32 hurd-i386 hurd-amd64))
255 SUMMARY_ONLY = --summary-only
256 endif
257 endif
258 endif
259
260 DH_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DH_VERSION. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dpkg -s debhelper | grep '^Version' | awk '{print $$2}')
261
262 include /usr/share/dpkg/architecture.mk
263
264 # list of archs to build for in Debian. This also includes architectures which
265 # have support in LLVM, but currently ftbfs, e.g. armel, m68k
266 # Excluded are alpha, hppa, sh4 to avoid build attempts
267 ANY_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/ANY_ARCHS. := amd64 arm64 armel armhf hurd-amd64 hurd-i386 i386 loong64 m68k \
268 mipsel mips64el powerpc ppc64 ppc64el riscv64 s390x sparc sparc64 x32
269
270 MULTILIB_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/MULTILIB_ARCHS. := amd64 i386 mips64 mips64el mipsel powerpc ppc64 s390x sparc sparc64 x32
271 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.), bionic focal jammy noble buster bullseye bookworm trixie))
272 MULTILIB_ARCHS := $(filter-out s390x, $(MULTILIB_ARCHS))
273 endif
274
275 CONFIGURE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CONFIGURE_EXTRA. =
276
277 # these are handled on a per stage / build basis
278 ifeq ($(VENDORscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/VENDOR.)-$(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),Ubuntu-ppc64el)
279 export DEB_CFLAGS_MAINT_STRIP = -g -O3
280 export DEB_CXXFLAGS_MAINT_STRIP = -g -O3
281 else
282 export DEB_CFLAGS_MAINT_STRIP = -g -O2
283 export DEB_CXXFLAGS_MAINT_STRIP = -g -O2
284 endif
285 include /usr/share/dpkg/buildflags.mk
286
287 # Remove -Bsymbolic-functions for causing:
288 # https://github.com/llvm/llvm-project/issues/59432#issuecomment-2500694332
289 ifeq ($(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dpkg-vendor --derives-from Ubuntu && echo yes),yes)
290 ifneq (,$(LDFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LDFLAGS.))
291 LDFLAGS := $(filter-out %-Bsymbolic-functions,$(LDFLAGS))
292 endif
293 endif
294
295 # Filter out flags that Flang doesn't understand (hardening and warning flags)
296 define filter_flang_flagsscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter_flang_flags.
297 $(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. -fstack-% -fno-stack-protector -fno-stack-clash-protection -fcf-protection% -mbranch-protection% -mno-omit-% -mbackchain -W% -Werror%,$(1))
298 endef
299
300 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), $(FLANG_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/FLANG_ARCHS.)))
301 # setting DEB_BUILD_MAINT_OPTIONS doesn't work, Ubuntu passes either the negative or the positive options
302 # export DEB_BUILD_MAINT_OPTIONS += hardening=-stackprotector,-stackclash,-branch
303 FFLAGS := $(filter-out $(FLANG_UNKNOWN_OPTS), $(FFLAGS))
304 endif
305
306 # We use a stage2 build. It means that a first clang is built using gcc,
307 # a second clang is built with the first
308 # And the various components are built using the second clang.
309 # See https://llvm.org/docs/AdvancedBuilds.html
310
311 # collect additional flags for all stages all builds
312 CFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CFLAGS_EXTRA. = -Wno-unused-command-line-argument
313 CXXFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CXXFLAGS_EXTRA. = -Wno-unused-command-line-argument
314 LDFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LDFLAGS_EXTRA. = -Wl,--build-id
315
316 # This will enable linking statically with large binaries like chromium.
317 # For more details, see:
318 # https://github.com/loongson/la-abi-specs/blob/release/laelf.adoc#code_models
319 ifeq (loong64,$(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.))
320 CFLAGS_EXTRA += -mcmodel=medium
321 CXXFLAGS_EXTRA += -mcmodel=medium
322 endif
323
324 # collect all flags for stage 1 toolchain build only
325 STAGE_1_CFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_CFLAGS. = $(CFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CFLAGS.) $(CFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CFLAGS_EXTRA.) $(CPPFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CPPFLAGS.)
326 STAGE_1_CXXFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_CXXFLAGS. = $(CXXFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CXXFLAGS.) $(CXXFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CXXFLAGS_EXTRA.) $(CPPFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CPPFLAGS.)
327 STAGE_1_LDFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_LDFLAGS. = $(LDFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LDFLAGS.) $(LDFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LDFLAGS_EXTRA.)
328 # If we build with libc++, we might want to set different arguments for
329 # stage 1 & runtimes
330 RUNTIMES_CFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RUNTIMES_CFLAGS. = $(STAGE_1_CFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_CFLAGS.)
331 RUNTIMES_CXXFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RUNTIMES_CXXFLAGS. = $(STAGE_1_CXXFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_CXXFLAGS.)
332 RUNTIMES_LDFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RUNTIMES_LDFLAGS. = $(STAGE_1_LDFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_LDFLAGS.)
333 RUNTIMES_FORTRAN_FLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RUNTIMES_FORTRAN_FLAGS. = $(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. filter_flang_flags,$(STAGE_1_CFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_CFLAGS.))
334
335 # collect all flags for stage 2 toolchain and stand-alone builds
336 STAGE_2_CFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CFLAGS. = $(CFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CFLAGS.) $(CFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CFLAGS_EXTRA.) $(CPPFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CPPFLAGS.)
337 STAGE_2_CXXFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CXXFLAGS. = $(CXXFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CXXFLAGS.) $(CXXFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CXXFLAGS_EXTRA.) $(CPPFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CPPFLAGS.)
338 STAGE_2_LDFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_LDFLAGS. = $(LDFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LDFLAGS.) $(LDFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LDFLAGS_EXTRA.)
339 STAGE_2_FORTRAN_FLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_FORTRAN_FLAGS. = $(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. filter_flang_flags,$(STAGE_2_CFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CFLAGS.))
340 STAGE_2_FORTRAN_OPT_FLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_FORTRAN_OPT_FLAGS. = $(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. filter_flang_flags,$(opt_flagsscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/opt_flags.))
341
342 # collect additional cmake options for toolchain build configuration
343 STAGE_1_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_CMAKE_EXTRA. =
344 STAGE_2_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CMAKE_EXTRA. =
345 STAGE_ALL_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_ALL_CMAKE_EXTRA. =
346 # toolchain config-only var combining all stage 1 cmake options
347 CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CMAKE_EXTRA. = $(STAGE_1_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_CMAKE_EXTRA.) $(STAGE_ALL_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_ALL_CMAKE_EXTRA.)
348 # toolchain config-only var prepending BOOTSTRAP_ to all stage 2 cmake options
349 BOOTSTRAP_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BOOTSTRAP_CMAKE_EXTRA. = $(foreachscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/foreach. extra,$(STAGE_2_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CMAKE_EXTRA.) $(STAGE_ALL_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_ALL_CMAKE_EXTRA.), $(substscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/subst. -D,-DBOOTSTRAP_,$(extrascip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/extra.)))
350
351 BASE_PATHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BASE_PATH. := $(CURDIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CURDIR.)
352 STAGE_1_BIN_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_BIN_DIR. := $(BASE_PATHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BASE_PATH.)/$(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.)/bin
353 STAGE_1_LIB_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_LIB_DIR. := $(BASE_PATHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BASE_PATH.)/$(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.)/lib
354 STAGE_2_BIN_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_BIN_DIR. := $(BASE_PATHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BASE_PATH.)/$(TARGET_BUILD_STAGE2scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD_STAGE2.)/bin
355 STAGE_2_LIB_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_LIB_DIR. := $(BASE_PATHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BASE_PATH.)/$(TARGET_BUILD_STAGE2scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD_STAGE2.)/lib
356
357 # toggleable defaults
358 COMPILER_RT_USE_BUILTINS_LIBRARYscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/COMPILER_RT_USE_BUILTINS_LIBRARY. := ON
359 LIBCXX_USE_COMPILER_RTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCXX_USE_COMPILER_RT. := ON
360
361 # We want to set the clang extra version ONLY in stage 2
362 # because we want the clang stage 1 to be as reproducible as possible
363 # when building with sccache (because this tool do a hash using the
364 # compiler binary and other things)
365 STAGE_2_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CMAKE_EXTRA. += -DCLANG_REPOSITORY_STRING=$(DEBIAN_REVISIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEBIAN_REVISION.)
366
367 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),sparc sparc64))
368 STAGE_1_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_CMAKE_EXTRA. += -DLLVM_PARALLEL_LINK_JOBS=4
369 endif
370
371 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),i386 hurd-i386 armel mipsel mips64el powerpc))
372 # For some reason, in the stage2 build, when clang is used to compile
373 # itself. The atomic detection is failing on armel. Forcing the inclusion
374 # everywhere and in all stages
375 LDFLAGS_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LDFLAGS_EXTRA. += -latomic
376 endif
377
378 Z3_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/Z3_ARCHS. := $(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. sh4, $(ANY_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/ANY_ARCHS.))
379 ifeq ($(DERIVATIVEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DERIVATIVE.),Ubuntu)
380 Z3_ARCHS := $(filter-out i386, $(Z3_ARCHS))
381 # no ocaml support in main. disable when it is the default LLVM
382 ifneq (,$(filter $(DISTRO), serieswith22asdefault))
383 Z3_ARCHS :=
384 endif
385 endif
386 ifneq (,$(Z3_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/Z3_ARCHS.))
387 Z3_DEV_DEP = libz3-dev [$(Z3_ARCHS)],
388 endif
389 Z3_FLAGscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/Z3_FLAG. = -DLLVM_ENABLE_Z3_SOLVER=$(ifscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/if. $(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),$(Z3_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/Z3_ARCHS.)),ON,OFF)
390 STAGE_2_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CMAKE_EXTRA. += $(Z3_FLAGscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/Z3_FLAG.)
391
392 # Change the default CPU for s390x
393 ZARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/ZARCH.=z196
394 ifeq ($(DERIVATIVEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DERIVATIVE.),Ubuntu)
395 ifneq (,$(filter $(DISTRO), xenial bionic focal jammy noble plucky questing))
396 ZARCH=z13
397 else
398 ZARCH=z15
399 endif
400 endif
401 STAGE_2_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CMAKE_EXTRA. += -DCLANG_SYSTEMZ_DEFAULT_ARCH=$(ZARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/ZARCH.)
402
403 # FIXME: where does this architecture list come from?
404 CLANG_GRPC_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CLANG_GRPC_ARCHS. := amd64 arm64 armel armhf i386 mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x
405 ifeq ($(DERIVATIVEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DERIVATIVE.),Ubuntu)
406 CLANG_GRPC_ARCHS := $(filter-out i386, $(CLANG_GRPC_ARCHS))
407 endif
408
409 # clangd remote index support requires GRPC & protobuf.
410 # Enable if minimum tested versions are available.
411 CLANGD_GRPC_INSTALLEDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CLANGD_GRPC_INSTALLED.=no
412 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. stage1, $(DEB_BUILD_PROFILESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_PROFILES.)))
413 ifeq ($(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. check_pkg_version,libgrpc++-dev,gt,1.30.0),yes)
414 ifeq ($(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. check_pkg_version,protobuf-compiler-grpc,gt,1.30.0),yes)
415 ifeq ($(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. check_pkg_version,libprotobuf-dev,gt,3.12.0),yes)
416 ifeq ($(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. check_pkg_version,protobuf-compiler,gt,3.12.0),yes)
417 CLANGD_GRPC_INSTALLEDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CLANGD_GRPC_INSTALLED.=yes
418 STAGE_2_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CMAKE_EXTRA. += -DCLANGD_ENABLE_REMOTE=ON
419 endif
420 endif
421 endif
422 endif
423 endif
424
425 export CCscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CC. ?= gcc-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.)
426 export CXXscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CXX. ?= g++-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.)
427
428 ifneq (,$(findstringscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/findstring. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),armel))
429 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=arm-linux-gnueabi
430 # align arch profile with debian baseline
431 # https://wiki.debian.org/ArmEabiPort
432 CFLAGS_EXTRA += -march=armv5t
433 CXXFLAGS_EXTRA += -march=armv5t
434 # disable compiler-rt builtins (not supported for baseline armel arch: armv5t)
435 # See http://lists.llvm.org/pipermail/llvm-dev/2016-May/099761.html
436 STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_BUILD_BUILTINS=OFF
437 COMPILER_RT_USE_BUILTINS_LIBRARY := OFF
438 LIBCXX_USE_COMPILER_RT := OFF
439 # disable scudo standalone (not supported for baseline armel arch: armv5t)
440 STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_BUILD_SCUDO_STANDALONE=OFF
441 endif
442
443 ifneq (,$(findstringscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/findstring. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),armhf))
444 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=arm-linux-gnueabihf
445 # align arch profile with debian baseline
446 # https://wiki.debian.org/ArmHardFloatPort#Minimum_CPU_.26_FPU
447 CFLAGS_EXTRA += -march=armv7-a -mfpu=vfpv3-d16
448 CXXFLAGS_EXTRA += -march=armv7-a -mfpu=vfpv3-d16
449 endif
450
451 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),i386))
452 # Sometimes, i386 needs help with the triple
453 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=i386-linux-gnu
454 CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=i386-linux-gnu
455 endif
456
457 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),mips64el))
458 # avoid an issue with search path on mips64el
459 # https://bugs.llvm.org/show_bug.cgi?id=41204
460 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=mips64el-linux-gnuabi64
461 CFLAGS_EXTRA += -mxgot
462 CXXFLAGS_EXTRA += -mxgot
463 LDFLAGS_EXTRA += -mxgot
464 # disable compiler-rt builtins (not supported for mips64el)
465 STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_BUILD_BUILTINS=OFF
466 COMPILER_RT_USE_BUILTINS_LIBRARY := OFF
467 LIBCXX_USE_COMPILER_RT := OFF
468 endif
469
470 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),powerpc))
471 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=powerpc-linux-gnu
472 STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc
473 STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
474 endif
475
476 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),ppc64el))
477 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=powerpc64le-linux-gnu
478 endif
479 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.), stretch buster bullseye bookworm trixie xenial bionic focal jammy noble oracular plucky))
480 # apparently, LLVM cannot have support for both ppc64 and ppc64el
481 ifeq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64))
482 STAGE_ALL_CMAKE_EXTRA += -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=ON
483 endif
484 endif
485
486 # debug symbols OOM in Ubuntu Ubuntu and slows down build process.
487 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),riscv64))
488 opt_flags = -O2 -DNDEBUG -g0
489 else
490 opt_flags = -O2 -DNDEBUG -g1
491 endif
492
493 # baseline selection is done with a patch only
494 ifeq ($(DERIVATIVEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DERIVATIVE.)-$(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),Ubuntu-riscv64)
495 RVA23 := $(shell grep -q ^ubuntu-clang-use-RVA23U64-profile debian/patches/series; echo $$?)
496 ifneq (,$(filter $(DISTRO), focal jammy noble))
497 ifeq ($(RVA23),0)
498 $(error RVA23 baseline must not be enabled for backports ($(DISTRO)))
499 endif
500 else
501 ifeq ($(RVA23),1)
502 $(error RVA23 baseline has to be enabled for Ubuntu $(DISTRO))
503 endif
504 endif
505 endif
506
507 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),sparc sparc64))
508 STAGE_ALL_CMAKE_EXTRA += -DLLVM_PARALLEL_LINK_JOBS=4
509 endif
510 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),sparc))
511 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=sparc-linux-gnu
512 endif
513 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),sparc64))
514 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=sparc64-linux-gnu
515 endif
516
517 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),s390x))
518 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=s390x-linux-gnu
519 endif
520
521 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),x32))
522 STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=x86_64-linux-gnux32
523 STAGE_ALL_CMAKE_EXTRA += -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnux32
524 STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_BUILD_BUILTINS=OFF
525 COMPILER_RT_USE_BUILTINS_LIBRARY := OFF
526 LIBCXX_USE_COMPILER_RT := OFF
527 endif
528
529 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),hurd-amd64))
530 STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_BUILD_BUILTINS=OFF
531 COMPILER_RT_USE_BUILTINS_LIBRARY := OFF
532 LIBCXX_USE_COMPILER_RT := OFF
533 endif
534
535 ifeq ($(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. check_pkg_version,g++-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.),ge,4.8-20121128-1~),yes)
536 control_vars = '-Vdep:devlibs=libstdc++-$(GCC_VERSION)-dev, libgcc-$(GCC_VERSION)-dev' \
537 '-Vdep:devlibs-objc=libobjc-$(GCC_VERSION)-dev'
538 else ifeq ($(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. check_pkg_version,g++-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.),ge,4.7.2-10~),yes)
539 control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev, libgcc-$(GCC_VERSION)-dev' \
540 '-Vdep:devlibs-objc=libobjc-$(GCC_VERSION)-dev'
541 else
542 control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev'
543 endif
544
545 LLVM_SPIRV_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_SPIRV_ARCHS. = amd64 arm64 armhf i386 ppc64 ppc64el riscv64 s390x
546 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. stage1, $(DEB_BUILD_PROFILESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_PROFILES.)))
547 LLVM_SPIRV_INSTALLED = no
548 else
549 # Only use llvm-spirv matching the exact LLVM version being built.
550 # Do NOT fallback to llvm-spirv-(N-1): the older version cannot read
551 # bitcode produced by the newer LLVM (e.g. unknown attribute kinds).
552 LLVM_SPIRV_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_SPIRV_VERSION. := $(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)
553 LLVM_SPIRVscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_SPIRV. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. bash -c "command -v llvm-spirv-$(LLVM_SPIRV_VERSION)" 2>/dev/null)
554
555 # Disable spirv support for most of the distro versions
556 # It needs llvm-spirv-17 and it is rarely available
557 # Be prescritive
558 SPIRV_DISABLE_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SPIRV_DISABLE_DISTRO. := bionic buster lunar jammy focal buster bullseye bookworm
559 ifndef LLVM_SPIRV
560 LLVM_SPIRV_INSTALLED = no
561 else
562 ifeq (,$(filter-out $(SPIRV_DISABLE_DISTRO), $(DISTRO)))
563 # Too old llvm-spirv version are failing. See #52200
564 LLVM_SPIRV_INSTALLED = no
565 else
566 LLVM_SPIRV_INSTALLED = yes
567 endif
568 endif
569 endif
570
571 LIBCLC_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCLC_ENABLE. = yes
572
573 ifeq ($(LIBCLC_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCLC_ENABLE.),yes)
574 LIBCLC_TARGETS_TO_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCLC_TARGETS_TO_BUILD.=amdgcn--;amdgcn-amd-amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx64--;nvptx64--nvidiacl
575 LIBCLC_LLVM_SPIRVscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCLC_LLVM_SPIRV. =
576 ifeq ($(LLVM_SPIRV_INSTALLEDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_SPIRV_INSTALLED.),yes)
577 LIBCLC_TARGETS_TO_BUILD := $(LIBCLC_TARGETS_TO_BUILD);spirv-mesa3d-;spirv64-mesa3d-
578 LIBCLC_LLVM_SPIRV = -DLLVM_SPIRV=$(LLVM_SPIRV)
579 endif
580 endif
581
582 # See compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake / HWASAN_SUPPORTED_ARCH
583 HWASAN_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/HWASAN_ARCHS. = amd64 arm64 i386 riscv64 x32
584
585 LLD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLD_ARCHS. := amd64 arm64 armel armhf i386 mipsel mips64el ppc64el s390x sparc m68k ppc64 sparc64 x32 riscv64 loong64
586 # some lld archs are unusable for the bootstrap
587 LLD_BUILD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLD_BUILD_ARCHS. := $(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. m68k mipsel mips64el ppc64 sparc sparc64 x32, $(LLD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLD_ARCHS.))
588 LLD_INSTALLEDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLD_INSTALLED. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dpkg-query -W -f='$${Status}\n' lld 2>/dev/null | grep -q "install ok installed" && echo yes || echo no)
589
590 # don't use gold anymore, but the BFD linker instead on these archs
591 BINUTILS_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BINUTILS_ARCHS. := alpha m68k mipsel mips64el powerpc ppc64 sparc sparc64 x32 hurd-i386 hurd-amd64
592
593 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.), stretch buster bullseye bookworm xenial bionic focal jammy))
594 LLD_BUILD_ARCHS := $(filter-out riscv64 s390x, $(LLD_BUILD_ARCHS))
595 BINUTILS_ARCHS += riscv64 s390x
596 endif
597
598 # build LLVMgold plugin on these archs, no b-d on binutils-gold needed
599 BINUTILS_GOLD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BINUTILS_GOLD_ARCHS. := amd64 arm64 armel armhf i386 powerpc ppc64 ppc64el s390x sparc64 x32 hurd-amd64 hurd-i386
600
601 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),$(LLD_BUILD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLD_BUILD_ARCHS.)))
602 ifeq ($(LLD_INSTALLED),yes)
603 # we have lld on the system
604 STAGE_ALL_CMAKE_EXTRA += -DLLVM_USE_LINKER=lld
605 USE_LLD=yes
606 endif
607 endif
608
609 ifneq ($(USE_LLDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/USE_LLD.),yes)
610 ifneq (,$(filter $(DEB_HOST_ARCH),$(BINUTILS_ARCHS)))
611 # no extra options needed
612 else ifneq (,$(filter $(DEB_HOST_ARCH),$(LLD_BUILD_ARCHS)))
613 # lld would normally be used here but isn't installed; fall back
614 # to the system default linker rather than aborting the build.
615 $(warning lld is not installed on $(DEB_HOST_ARCH); using the system default linker)
616 else
617 $(error unknown build linker for architecture $(DEB_HOST_ARCH))
618 endif
619 endif
620
621 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),$(BINUTILS_GOLD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BINUTILS_GOLD_ARCHS.)))
622 # build LLVMgold plugin, see https://github.com/llvm/llvm-project/issues/64216
623 STAGE_ALL_CMAKE_EXTRA += -DLLVM_BINUTILS_INCDIR=/usr/include/
624 endif
625
626 BOLT_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BOLT_ARCHS. = amd64 arm64
627 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),$(BOLT_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BOLT_ARCHS.)))
628 PROJECTS += ;bolt
629 endif
630
631 # Architectures where libc is enabled
632 LLVM_LIBC_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_LIBC_ARCHS. = amd64 arm64 armhf
633
634 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. libllvmlibc-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-dev, $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)))
635 LLVM_LIBC_ENABLE=yes
636 LLVM_LIBC_DISABLE_DISTRO := bionic focal bullseye
637 ifeq (,$(filter $(DISTRO), $(LLVM_LIBC_DISABLE_DISTRO)))
638 # Enable libc only for architectures listed in LIBC_ARCHS
639 ifneq (,$(filter $(DEB_HOST_ARCH), $(LLVM_LIBC_ARCHS)))
640 RUNTIMES += ;libc
641 # also disable llvm-gpu-loader
642 # for causing https://github.com/llvm/llvm-project/issues/132890
643 # and because libc isn't built on all platform but, as it is in the llvm package
644 # we expect it
645 STAGE_ALL_CMAKE_EXTRA += -DLLVM_LIBC_GPU_BUILD=ON -DLLVM_TOOL_LLVM_GPU_LOADER_BUILD=OFF
646 else
647 LLVM_LIBC_ENABLE=no
648 endif
649 else
650 LLVM_LIBC_ENABLE=no
651 endif
652 endif
653
654 ifeq ($(LLVM_LIBC_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_LIBC_ENABLE.),no)
655 $(info LLVM libc disabled for $(DISTRO))
656 endif
657
658 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), $(FLANG_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/FLANG_ARCHS.)))
659 PROJECTS += ;flang
660 RUNTIMES += ;flang-rt
661 STAGE_ALL_CMAKE_EXTRA += -DFLANG_ENABLE_PRIF=ON
662 endif
663
664 CODECOVERAGEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CODECOVERAGE.=no
665 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. codecoverage,$(DEB_BUILD_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_OPTIONS.)))
666 # enable the code coverage
667 CODECOVERAGE=yes
668 # for -fvisibility-inlines-hidden see http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130729/183016.html
669 CXXFLAGS_EXTRA += -fprofile-arcs -ftest-coverage
670 LDFLAGS_EXTRA += -coverage -lgcov
671 RUN_TEST=yes
672 # OpenMP doesn't respect LDFLAGS
673 STAGE_2_CMAKE_EXTRA+= -DLIBOMP_LDFLAGS="-coverage -lgcov" # don't pass LDFLAGS_EXTRA because it expects gcc arg
674 endif
675
676 # Enable polly (or not)
677 POLLY_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/POLLY_ARCHS. = $(ANY_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/ANY_ARCHS.)
678 POLLY_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/POLLY_ENABLE.=yes
679 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), $(POLLY_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/POLLY_ARCHS.)))
680 PROJECTS+=;polly
681 endif
682
683 # Enable libunwind (or not)
684 LIBUNWIND_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBUNWIND_ARCHS. := amd64 arm64 armhf i386 loong64 ppc64 ppc64el riscv64 s390x
685 LIBUNWIND_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBUNWIND_ENABLE.=yes
686 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), $(LIBUNWIND_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBUNWIND_ARCHS.)))
687 LIBUNWIND_ENABLE=no
688 # do not use compiler-rt builtins for libcxx (libcxxabi) when libunwind is
689 # disabled since the gnu implementation in libgcc_s will then be required
690 LIBCXX_USE_COMPILER_RT := OFF
691 # See https://github.com/llvm/llvm-project/issues/77846
692 else
693 RUNTIMES += ;libunwind
694 endif
695 ifeq ($(SKIP_COMMON_PACKAGESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SKIP_COMMON_PACKAGES.),yes)
696 COMMON_BUILD_DEPS := $(subst llvm-libunwind1,llvm-libunwind1 [$(LIBUNWIND_ARCHS)],$(COMMON_BUILD_DEPS))
697 endif
698
699 # Enable openmp (or not)
700 OMP_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OMP_ARCHS. = amd64 arm64 armhf i386 loong64 mips64el ppc64 ppc64el riscv64 hurd-amd64
701
702 # FIXME: what exactly enables ompd? e.g. not enabled on armhf, mips64el, hurd-any
703 OMPD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OMPD_ARCHS. = amd64 arm64 loong64 ppc64 ppc64el riscv64
704
705 OPENMP_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OPENMP_ENABLE.=yes
706 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), $(OMP_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OMP_ARCHS.)))
707 OPENMP_ENABLE=no
708 else
709 RUNTIMES += ;openmp
710 STAGE_ALL_CMAKE_EXTRA += -DLIBOMP_LIBFLAGS="-lm"
711 endif
712 ifeq ($(SKIP_COMMON_PACKAGESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SKIP_COMMON_PACKAGES.),yes)
713 COMMON_BUILD_DEPS := $(subst libomp5,libomp5 [$(OMP_ARCHS)],$(COMMON_BUILD_DEPS))
714 endif
715
716 # Enable offloading (or not)
717 OFFLOAD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OFFLOAD_ARCHS. = amd64 arm64 loong64 ppc64el riscv64
718 OFFLOAD_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OFFLOAD_ENABLE.=yes
719 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), $(OFFLOAD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OFFLOAD_ARCHS.)))
720 OFFLOAD_ENABLE=no
721 else
722 RUNTIMES += ;offload
723 endif
724
725 # macros for various compiler_rt/runtime library features
726 # according to compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
727 RT_ORC_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RT_ORC_ARCHS. = amd64 arm64 armhf armel i386 loong64 ppc64 ppc64el x32
728
729 # Do not install objects
730 STAGE_ALL_CMAKE_EXTRAscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_ALL_CMAKE_EXTRA. += -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF
731
732
733 RUN_TESTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RUN_TEST.=yes
734 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. nocheck,$(DEB_BUILD_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_OPTIONS.)))
735 RUN_TEST=no
736 endif
737 ifeq ($(DERIVATIVEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DERIVATIVE.),Ubuntu)
738 ifeq (riscv64,$(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.))
739 RUN_TEST=no
740 endif
741 endif
742
743 # llvm tests timeout, disable it on mipsel and x32
744 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), mipsel mips64el x32))
745 RUN_TEST=no
746 endif
747
748 SCAN_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCAN_BUILD.=no
749 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. scan-build,$(DEB_BUILD_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_OPTIONS.)))
750 # enable the build using scan-build
751 # The package are installed through the variable declarations:
752 # OTHERMIRROR="deb http://llvm.org/apt/unstable/ llvm-toolchain main"
753 # EXTRAPACKAGES="clang-X"
754 SCAN_BUILD=yes
755
756 PRE_PROCESS=scan-build-$(LLVM_VERSION) --show-description -analyzer-config stable-report-filename=true
757 PRE_PROCESS_CONF=scan-build-$(LLVM_VERSION)
758 TIME_COMMAND=
759 # no need to run tests in this case
760 RUN_TEST=no
761 CONFIGURE_EXTRA += --enable-assertions
762 STAGE_ALL_CMAKE_EXTRA += -DLLVM_ENABLE_ASSERTIONS=ON
763 endif
764
765 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. coverity,$(DEB_BUILD_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_OPTIONS.)))
766 # enable the build using coverity
767 # pbuilder contains BINDMOUNTS="/opt/cov-analysis/"
768 # And we have some pbuilder hooks to configure and pack the result
769 # Where the binaries are installed on the jenkins instance
770 PRE_PROCESS=PATH=$$PATH:/opt/cov-analysis/bin/ cov-build --dir cov-int
771 TIME_COMMAND=
772 # We don't want to check the temporary files produced by the configure
773 PRE_PROCESS_CONF=
774 COVERITY_ENABLE=1
775 CONFIGURE_EXTRA += --enable-assertions
776 STAGE_ALL_CMAKE_EXTRA += -DLLVM_ENABLE_ASSERTIONS=ON
777 # no need to run tests in this case
778 RUN_TEST=no
779 else
780 COVERITY_ENABLE=0
781 endif
782
783 # Handle terse build option to reduce verbosity
784 CMAKE_VERBOSEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CMAKE_VERBOSE.=1
785 CMAKE_VERBOSE_FLAGscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CMAKE_VERBOSE_FLAG.=VERBOSE=1
786 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. terse,$(DEB_BUILD_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_OPTIONS.)))
787 CMAKE_VERBOSE=0
788 CMAKE_VERBOSE_FLAG=
789 endif
790
791 # hurd has threading issues
792 LLDB_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLDB_ARCHS. := amd64 arm64 armel armhf i386 loong64 m68k ppc64el riscv64 s390x x32
793 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),$(LLDB_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLDB_ARCHS.)))
794 STAGE_ALL_CMAKE_EXTRA += -DLLDB_ENABLE_LUA=OFF
795 PROJECTS+=;lldb
796 endif
797
798 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),i386 amd64))
799 INTEL_PT_DISABLE_DISTRO := bionic
800 # Disable intel-pt on old distro, fails on bionic (too old)
801 ifeq (,$(filter $(DISTRO), $(INTEL_PT_DISABLE_DISTRO)))
802 STAGE_ALL_CMAKE_EXTRA += -DLLDB_BUILD_INTEL_PT=ON -DLIBIPT_INCLUDE_PATH=/usr/include -DLIBIPT_LIBRARY_PATH=/usr/lib/$(DEB_HOST_MULTIARCH)
803 endif
804 endif
805
806 LLDB_PYTHON_DISABLE_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLDB_PYTHON_DISABLE_DISTRO. := bionic buster
807 LLDB_PYTHON_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLDB_PYTHON_ENABLE.=yes
808 # Disable zstd on old distro, fails on lld
809 ifeq (,$(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. $(LLDB_PYTHON_DISABLE_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLDB_PYTHON_DISABLE_DISTRO.), $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.)))
810 # Don't enable lld python for old distros
811 STAGE_ALL_CMAKE_EXTRA += -DLLDB_ENABLE_PYTHON=OFF
812 LLDB_PYTHON_ENABLE=no
813 $(info LLBD Python disabled for $(DISTRO))
814 endif
815
816 LIBCXX_WASM_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCXX_WASM_ENABLE.=yes
817 LIBCXX_WASM_DISABLE_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCXX_WASM_DISABLE_DISTRO. := bionic buster focal bullseye jammy
818 # Either wasi-libc doesn't exist / too old
819 # or we have this bug
820 # https://sourceware.org/bugzilla/show_bug.cgi?id=27558
821 ifeq (,$(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. $(LIBCXX_WASM_DISABLE_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCXX_WASM_DISABLE_DISTRO.), $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.)))
822 LIBCXX_WASM_ENABLE=no
823 $(info libcxx wasm disabled for $(DISTRO))
824 endif
825
826 DOC_GENERATIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DOC_GENERATION.=yes
827 DOC_GENERATION_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DOC_GENERATION_DISTRO. := buster bullseye bionic focal
828 # LLVM upstream moved to myst_parser but it isn't available on old distro
829 ifeq (,$(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. $(DOC_GENERATION_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DOC_GENERATION_DISTRO.), $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.)))
830 DOC_GENERATION=no
831 $(info Doc generation disabled for $(DISTRO))
832 endif
833
834 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),powerpc))
835 LIBCXX_WASM_ENABLE=no
836 endif
837
838 MINGW_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/MINGW_ENABLE.=yes
839 MINGW_DISABLE_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/MINGW_DISABLE_DISTRO. := focal
840 # mingw-w64 cross compilation is broken on focal
841 ifeq (,$(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. $(MINGW_DISABLE_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/MINGW_DISABLE_DISTRO.), $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.)))
842 MINGW_ENABLE=no
843 $(info mingw build disabled for $(DISTRO))
844 endif
845
846 # FIXME: we have USE_LLD ... LLD_ENABLE usage is commented out anyway
847 LLD_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLD_ENABLE.=yes
848
849 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCH_OSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH_OS.),linux))
850 # only for linux
851 STAGE_2_CMAKE_EXTRA += -DLLVM_USE_PERF=ON -DLLVM_ENABLE_LIBPFM=ON
852 endif
853
854 LLVM_ENABLE_ZSTD_DISABLE_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_ENABLE_ZSTD_DISABLE_DISTRO. := bionic buster
855 # Disable zstd on old distro, fails on lld
856 ifeq (,$(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. $(LLVM_ENABLE_ZSTD_DISABLE_DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_ENABLE_ZSTD_DISABLE_DISTRO.), $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.)))
857 STAGE_ALL_CMAKE_EXTRA += -DLLVM_ENABLE_ZSTD=OFF
858 endif
859
860 LTO_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LTO_ENABLE.=no
861 # Only enable it for archs supporting lld
862 ifeq ($(USE_LLDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/USE_LLD.),yes)
863 # LTO requires a bunch of memory. Don't do it everywhere
864 LTO_DISABLE_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LTO_DISABLE_ARCHS. := i386 armhf s390x ppc64 x32
865 ifeq (,$(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. $(LTO_DISABLE_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LTO_DISABLE_ARCHS.), $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.)))
866 LTO_ENABLE=no
867 else
868 # Disable for now because of
869 # https://github.com/llvm/llvm-project/issues/58317#issuecomment-1276190743
870 # LTO_ENABLE=yes
871 # STAGE_2_CMAKE_EXTRA += -DLLVM_ENABLE_LTO="On"
872 endif
873 endif
874
875 ifeq ($(LTO_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LTO_ENABLE.),no)
876 $(info LTO disabled for $(DEB_HOST_ARCH))
877 endif
878
879 # https://bugs.launchpad.net/bugs/2016471
880 ifeq (,$(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. $(LTO_DISABLE_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LTO_DISABLE_ARCHS.), $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.)))
881 LLD_SUPPORTS_NO_SYMBOLICscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLD_SUPPORTS_NO_SYMBOLIC. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. ld.lld --help | grep -q -w -- '-Bno-symbolic' && echo "yes" || echo "no")
882 ifeq ($(LLD_SUPPORTS_NO_SYMBOLICscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLD_SUPPORTS_NO_SYMBOLIC.),yes)
883 STAGE_2_CMAKE_EXTRA += -DLIBOMP_LDFLAGS=-Wl,-Bno-symbolic
884 endif
885 endif
886
887 DH_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DH_OPTIONS. = python3
888 OCAML_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OCAML_ENABLE. = no
889 OCAML_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OCAML_ARCHS. = amd64 arm64 ppc64el riscv64 s390x
890 OCAML_RELEASESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OCAML_RELEASES. = stretch buster bullseye bookworm trixie forky \
891 precise trusty xenial bionic focal jammy noble plucky questing \
892 resolute stonking
893 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.), $(OCAML_RELEASESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OCAML_RELEASES.)))
894 ifneq (,$(filter $(DEB_HOST_ARCH),$(OCAML_ARCHS)))
895 # Enable OCAML for this arch.
896 OCAML_ENABLE = yes
897 OCAML_STDLIB_DIR ?= $(shell ocamlc -where)
898 DH_OPTIONS := $(DH_OPTIONS),ocaml
899 endif
900 OCAML_BUILD_DEPS = ocaml-base [$(OCAML_ARCHS)] <!pkg.llvm.noocaml> | ocaml-nox [$(OCAML_ARCHS)] <!pkg.llvm.noocaml>, \
901 ocaml-findlib [$(OCAML_ARCHS)] <!pkg.llvm.noocaml>, \
902 libctypes-ocaml-dev [$(OCAML_ARCHS)] <!pkg.llvm.noocaml>, \
903 dh-ocaml [$(OCAML_ARCHS)] <!pkg.llvm.noocaml>,
904 OCAML_IN_RELEASE = yes
905 endif
906
907 LIBFUZZER_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBFUZZER_ENABLE.=yes
908 LIBFUZZER_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBFUZZER_ARCHS. = $(filter-outscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter-out. hurd-%, $(ANY_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/ANY_ARCHS.))
909 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCH_OSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH_OS.),linux))
910 LIBFUZZER_ENABLE=no
911 $(info Libfuzzer disabled for $(DEB_HOST_ARCH_OS))
912 endif
913
914 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), mipsel))
915 LIBOMP_ARCH = mips
916 endif
917
918 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), mips64 mips64el))
919 LIBOMP_ARCH = mips64
920 endif
921
922 # if cmake is installed in /tmp/cmake/ uses it
923 # Used to build llvm on old ubuntu (precise) on the llvm.org/apt/ ci
924 CMAKE_BINscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CMAKE_BIN.=cmake
925 ifeq ($(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. test -e /tmp/cmake/bin/cmake && echo -n yes),yes)
926 CMAKE_BIN=/tmp/cmake/bin/cmake
927 export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/
928 endif
929
930 SCCACHE_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCCACHE_ENABLE.=no
931 SCCACHE_CMAKEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCCACHE_CMAKE. =
932 # if sccache is installed in the chroot, use it
933 ifeq ($(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. test -e /opt/sccache/sccache && echo -n yes),yes)
934 ifneq (,$(filter $(DEB_HOST_ARCH),i386 amd64 s390x))
935 STAGE_1_CMAKE_EXTRA += $(SCCACHE_CMAKE)
936 SCCACHE_ENABLE=yes
937 SCCACHE_PATH=/opt/sccache/
938 SCCACHE_CMD=$(SCCACHE_PATH)/sccache
939 SCCACHE_CMAKE = -DCMAKE_C_COMPILER_LAUNCHER=$(SCCACHE_CMD) -DCMAKE_CXX_COMPILER_LAUNCHER=$(SCCACHE_CMD)
940 export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/opt/sccache
941 endif
942 endif
943
944 # enables cmake build targets like stage2-[target_name]
945 ENABLED_STAGE2_CMAKE_BUILD_TARGETSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/ENABLED_STAGE2_CMAKE_BUILD_TARGETS. = check-all;check-llvm;check-clang;check-clang-tools;check-lld;check-libcxx;check-libcxxabi;check-mlir;check-libc;check-sanitizer;llvm-config;test-suite
946
947 %scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`%`().:
948 dh $@ $(if $(DH_OPTIONS),--with $(DH_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DH_OPTIONS.))
949
950 # For some reasons, some spaces are added, removing them
951 PROJECTS_LISTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PROJECTS_LIST. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. echo "$(PROJECTS)"|sed -e "s| ||g")
952 RUNTIMES_LISTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RUNTIMES_LIST. := $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. echo "$(RUNTIMES)"|sed -e "s| ||g")
953
954 stamps/preconfigurescip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`stamps/preconfigure`().:
955 if ! grep -qs '/proc ' /proc/mounts; then \
956 echo "/proc needs to be mounted"; \
957 exit 1; \
958 fi
959
960 if test "$(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.)" = "bookworm" -a "$(LLVM_SPIRV_INSTALLEDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_SPIRV_INSTALLED.)" = "no"; then \
961 echo "llvm spriv isn't detected while it should probably for this distro"; \
962 fi
963
964 @echo "Memory:"
965 @if [ -e /proc/meminfo ]; then \
966 cat /proc/meminfo | grep -E '(Mem|Swap)Free|Cached'; \
967 else \
968 echo " No memory info available"; \
969 fi
970 @echo "Processors: $$(cat /proc/cpuinfo | grep --count '^processor')"
971 @echo "Used Processors: $(NJOBSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/NJOBS.) (out of $(NCPUSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/NCPUS.)), $(MEM_PER_CPUscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/MEM_PER_CPU.)kb/processor"
972
973 @echo "Build profiles: $(DEB_BUILD_PROFILESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_PROFILES.)"
974 @echo "Packages to build: $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)"
975
976 @echo "DEB_BUILD_OPTIONS=$(DEB_BUILD_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_OPTIONS.)"
977 @echo "DEB_HOST_MULTIARCH=$(DEB_HOST_MULTIARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_MULTIARCH.)"
978 @echo "DEB_HOST_GNU_TYPE=$(DEB_HOST_GNU_TYPEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_GNU_TYPE.)"
979 @echo "DEB_HOST_ARCH_BITS=$(DEB_HOST_ARCH_BITSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH_BITS.)"
980 @echo "DEB_HOST_ARCH=$(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.)"
981 @echo "DEB_HOST_ARCH_OS=$(DEB_HOST_ARCH_OSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH_OS.)"
982 @echo "DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_MAINT_OPTIONS.)"
983 @echo "DISTRO=$(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.)"
984 @echo "GCC_VERSION=$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.)"
985 @echo "PROJECTS=$(PROJECTS_LISTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PROJECTS_LIST.)"
986 @echo "RUNTIMES=$(RUNTIMES_LISTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RUNTIMES_LIST.)"
987 @echo "LLVM_VERSION=$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)"
988 @echo "LLVM_VERSION_MINOR=$(LLVM_VERSION_MINORscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_MINOR.)"
989 @echo "LLVM_VERSION_FULL=$(LLVM_VERSION_FULLscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_FULL.)"
990 @echo "LLVM_VERSION_SNAPSHOT=$(LLVM_VERSION_SNAPSHOTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_SNAPSHOT.)"
991 @echo "APT_LLVM_ORG=$(APT_LLVM_ORGscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/APT_LLVM_ORG.)"
992 @echo "PATH=$(PATHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PATH.)"
993 @echo "LD_LIBRARY_PATH=$$LD_LIBRARY_PATH"
994 @echo "RUNTIMES_CXXFLAGS=$(RUNTIMES_CXXFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/RUNTIMES_CXXFLAGS.)"
995 @echo "STAGE_1_CXXFLAGS=$(STAGE_1_CXXFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_CXXFLAGS.)"
996 @echo "STAGE_2_CFLAGS=$(STAGE_2_CFLAGSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_CFLAGS.)"
997 @echo "LIBFUZZER_ENABLE=$(LIBFUZZER_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBFUZZER_ENABLE.)"
998 @echo "LTO_ENABLE=$(LTO_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LTO_ENABLE.)"
999 @echo "COMPILER_RT_WASM_ENABLE=$(COMPILER_RT_WASM_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/COMPILER_RT_WASM_ENABLE.)"
1000 @echo "LIBCXX_WASM_ENABLE=$(LIBCXX_WASM_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCXX_WASM_ENABLE.)"
1001 @echo "SCCACHE_ENABLE=$(SCCACHE_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCCACHE_ENABLE.)"
1002 @echo "LLVM_SPIRV=$(LLVM_SPIRVscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_SPIRV.)"
1003 @echo "LLVM_SPIRV_INSTALLED=$(LLVM_SPIRV_INSTALLEDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_SPIRV_INSTALLED.)"
1004 @echo "DOC_GENERATION=$(DOC_GENERATIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DOC_GENERATION.)"
1005
1006 $(snapshot_generated_tracked_filesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/snapshot_generated_tracked_files.)
1007 for f in debian/*.in debian/tests/*.in; do \
1008 f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)/'); \
1009 echo "$$f => $$f2"; \
1010 sed -e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_MULTIARCH.)|g' \
1011 -e "s|@USAGE_BUILD_DEP@|$(USAGE_BUILD_DEPscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/USAGE_BUILD_DEP.)|g" \
1012 -e "s|@Z3_DEV_DEP@|$(Z3_DEV_DEPscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/Z3_DEV_DEP.)|g" \
1013 -e "s|@MULTILIB_ARCHS@|$(MULTILIB_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/MULTILIB_ARCHS.)|g" \
1014 -e "s|@LLDB_ARCHS@|$(LLDB_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLDB_ARCHS.)|g" \
1015 -e "s|@OCAML_ARCHS@|$(OCAML_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OCAML_ARCHS.)|g" \
1016 -e "s#@OCAML_BUILD_DEPS@#$(OCAML_BUILD_DEPSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OCAML_BUILD_DEPS.)#g" \
1017 -e "s|@OMP_ARCHS@|$(OMP_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OMP_ARCHS.)|g" \
1018 -e "s|@OMPD_ARCHS@|$(OMPD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OMPD_ARCHS.)|g" \
1019 -e "s|@OFFLOAD_ARCHS@|$(OFFLOAD_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OFFLOAD_ARCHS.)|g" \
1020 -e "s|@FLANG_ARCHS@|$(FLANG_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/FLANG_ARCHS.)|g" \
1021 -e "s|@LLVM_LIBC_ARCHS@|$(LLVM_LIBC_ARCHSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_LIBC_ARCHS.)|g" \
1022 -e "s|@BINUTILS_GOLD_ARCHS@|$(sort $(BINUTILS_GOLD_ARCHS))|g" \
1023 -e "s|@LLD_ARCHS@|$(sort $(LLD_ARCHS))|g" \
1024 -e "s|@LLD_BUILD_ARCHS@|$(sort $(LLD_BUILD_ARCHS))|g" \
1025 -e "s|@LLVM_SPIRV_ARCHS@|$(sort $(LLVM_SPIRV_ARCHS))|g" \
1026 -e "s|@POLLY_ARCHS@|$(sort $(POLLY_ARCHS))|g" \
1027 -e "s|@HWASAN_ARCHS@|$(sort $(HWASAN_ARCHS))|g" \
1028 -e "s|@LIBUNWIND_ARCHS@|$(sort $(LIBUNWIND_ARCHS))|g" \
1029 -e "s|@ANY_ARCHS@|$(sort $(ANY_ARCHS))|g" \
1030 -e "s|@LIBFUZZER_ARCHS@|$(sort $(LIBFUZZER_ARCHS))|g" \
1031 -e "s|@BOLT_ARCHS@|$(sort $(BOLT_ARCHS))|g" \
1032 -e "s|@CLANG_GRPC_ARCHS@|$(sort $(CLANG_GRPC_ARCHS))|g" \
1033 -e "s|@RT_ORC_ARCHS@|$(sort $(RT_ORC_ARCHS))|g" \
1034 -e "s|@Z3_ARCHS@|$(sort $(Z3_ARCHS))|g" \
1035 -e "s|@BRANCH_NAME@|$(BRANCH_NAMEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BRANCH_NAME.)|g" \
1036 -e "s|@OCAML_STDLIB_DIR@|$(OCAML_STDLIB_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OCAML_STDLIB_DIR.)|g" \
1037 -e "s|@LLVM_EPOCH@|$(LLVM_EPOCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_EPOCH.)|g" \
1038 -e "s|@LLVM_VERSION_FULL@|$(LLVM_VERSION_FULLscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_FULL.)|g" \
1039 -e "s|@LLVM_VERSION_MINOR@|$(LLVM_VERSION_MINORscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_MINOR.)|g" \
1040 -e "s|@LLVM_VERSION_NEXT@|$(LLVM_VERSION_NEXTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_NEXT.)|g" \
1041 -e "s|@LLVM_VERSION@|$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)|g" \
1042 -e "s|@LLVM_DIR@|$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)|g" \
1043 -e "s|@LLVM_LIBDIR@|$(LLVM_LIBDIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_LIBDIR.)|g" \
1044 -e "s|@PYTHON3@|$(PYTHON3scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PYTHON3.)|g" \
1045 -e "s|@PY_EXT_SUFFIX@|$(PY_EXT_SUFFIXscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PY_EXT_SUFFIX.)|g" \
1046 -e "s|@COMMON_BUILD_DEPS@|$(COMMON_BUILD_DEPSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/COMMON_BUILD_DEPS.)|g" \
1047 -e "s|@NEXT_LIBLLVM_PKG@|$(NEXT_LIBLLVM_PKGscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/NEXT_LIBLLVM_PKG.)|g" \
1048 -e "s|@LIBCXX_MOVE_VERSION@|$(LIBCXX_MOVE_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCXX_MOVE_VERSION.)|g" \
1049 -e $(BD_ALT_HELLO_SUBSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/BD_ALT_HELLO_SUBST.) \
1050 $$f > $$f2; \
1051 if grep -q -m 1 '^#! */.*bin/' $$f; then \
1052 if ! [ -x $$f ]; then \
1053 echo "error: $$f: perm r, but using dh-exec"; \
1054 exit 1; \
1055 fi; \
1056 else \
1057 if [ -x $$f ]; then \
1058 echo "error: $$f: perm x, but no dh-exec"; \
1059 exit 1; \
1060 fi; \
1061 fi; \
1062 [ -x $$f ] && chmod +x $$f2; \
1063 done
1064 sed -i -e "s| *$$||" debian/control
1065
1066 # llvm-spirv was found, so we can enable *.spv files. Debian
1067 # buster and Ubuntu 18.04 don't have llvm-spirv to create the
1068 # *.spv files.
1069 if test "$(LLVM_SPIRV_INSTALLEDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_SPIRV_INSTALLED.)" = "yes"; then \
1070 sed -i -e "s|#spv\ ||g" debian/libclc-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.).install; \
1071 fi
1072
1073 # disable libc++-X.Y-dev-wasm32.install.in on old distro
1074 if test "$(LIBCXX_WASM_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCXX_WASM_ENABLE.)" = "no"; then \
1075 echo "" > debian/libc++-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-dev-wasm32.install; \
1076 echo "" > debian/libc++abi-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-dev-wasm32.install; \
1077 else \
1078 if ! dpkg -l|grep -q wasi-libc; then \
1079 echo "Could not find wasi-libc on the system"; \
1080 echo "Please check that the package is available on the system"; \
1081 echo "it might be that the 'hello' package is installed by another constraint"; \
1082 echo "try to install pbuilder-hookdir/D22wasi-libc ?"; \
1083 exit 1; \
1084 fi; \
1085 fi
1086
1087 if test "$(LLVM_LIBC_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_LIBC_ENABLE.)" = "no"; then \
1088 echo "" > debian/libllvmlibc-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-dev.install; \
1089 fi
1090
1091 # disable mingw build on old distro
1092 if test "$(MINGW_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/MINGW_ENABLE.)" = "no"; then \
1093 echo "" > debian/libclang-rt-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-dev-win.install; \
1094 fi
1095
1096 # Conditionally enable install clangd grpc files
1097 if test "$(CLANGD_GRPC_INSTALLEDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CLANGD_GRPC_INSTALLED.)" = "yes"; then \
1098 sed -i -e "s|#grpc\ ||g" debian/libclang-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-dev.install; \
1099 fi
1100
1101 python3 debian/remove-unbuilt.py \
1102 $(if $(filter yes, $(SKIP_COMMON_PACKAGES)),--skip-common-packages) \
1103 $(if $(filter yes, $(OCAML_IN_RELEASE)),,--skip-ocaml-packages) \
1104 $(if $(filter yes, $(LIBCLC_ENABLE)),,--skip-libclc-packages) \
1105 debian/control debian/packages.common debian/packages.ocaml debian/packages.libclc \
1106 > debian/control.new
1107 mv debian/control.new debian/control
1108
1109 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. llvm.noclang, $(DEB_BUILD_PROFILESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_PROFILES.)))
1110 if ! dh_listpackages|grep -q clang-$(LLVM_VERSION); then \
1111 echo "Could not find clang-$(LLVM_VERSION) in the list of packages"; \
1112 echo "Refresh debian/control ?"; \
1113 echo "Package list:"; \
1114 dh_listpackages; \
1115 exit 1; \
1116 fi
1117 else
1118 if ! dh_listpackages|grep -q llvm-$(LLVM_VERSION); then \
1119 echo "Could not find llvm-$(LLVM_VERSION) in the list of packages"; \
1120 echo "Refresh debian/control ?"; \
1121 echo "Package list:"; \
1122 dh_listpackages; \
1123 exit 1; \
1124 fi
1125 endif
1126
1127 # Verify no source-package file was mutated during the build
1128 # (see debian/source-integrity.mk).
1129 $(verify_generated_tracked_files)
1130
1131 @mkdir -p stamps
1132 touch $@
1133
1134 # Override this two targets. They are trying to manage the .in conversion for me
1135 override_dh_ocamlinitscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_ocamlinit().:
1136 override_dh_ocamlcleanscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_ocamlclean().:
1137
1138 override_dh_auto_configurescip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_auto_configure().: stamps/configure
1139 stamps/configurescip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`stamps/configure`().: stamps/preconfigure
1140 ifeq (${SCCACHE_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCCACHE_ENABLE.},yes)
1141 ls -al $(SCCACHE_PATH)*
1142 endif
1143 echo "Using gcc: "
1144 $(CCscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CC.) -v
1145 $(CXXscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CXX.) -v
1146 mkdir -p $(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.)
1147 # remove in case of artifact
1148 rm -rf build
1149
1150 if test "$(SCAN_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCAN_BUILD.)" = "yes"; then \
1151 patch -f -p1 < debian/patches/on-the-fly/use-scan-build-runtimes.diff||true; \
1152 fi
1153
1154 # Configure coverity (we need the compilers) + work around perf issues
1155 -(if test $(COVERITY_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/COVERITY_ENABLE.) -eq 1; then \
1156 export PATH=$$PATH:/opt/cov-analysis/bin/; \
1157 cov-configure --compiler clang --comptype clang; \
1158 cov-configure --compiler gcc-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.) --comptype gcc; \
1159 cov-configure --compiler g++-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.) --comptype gcc; \
1160 cov-configure -co /usr/bin/g++-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.) --comptype gcc -- -fPIC -std=c++11; \
1161 cov-configure -co /usr/bin/gcc-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.) --comptype gcc -- -fPIC; \
1162 cov-configure -co /usr/bin/g++-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.) --comptype gcc -- -fPIC -std=c++11 -fno-exceptions; \
1163 cov-configure -co /usr/bin/g++-$(GCC_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/GCC_VERSION.) --comptype gcc --template \
1164 --xml-option append_arg:"--ppp_translator" \
1165 --xml-option append_arg:"replace/llvm::AlignOf<PrevTy>::Alignment/(llvm::AlignOf<PrevTy>::Alignment)" \
1166 --xml-option append_arg:"--ppp_translator" \
1167 --xml-option append_arg:"replace/llvm::AlignOf<NextTy>::Alignment/(llvm::AlignOf<NextTy>::Alignment)"; \
1168 cov-configure --compiler c++ --comptype g++ --template \
1169 --xml-option append_arg:"--ppp_translator" \
1170 --xml-option append_arg:"replace/llvm::AlignOf<PrevTy>::Alignment/(llvm::AlignOf<PrevTy>::Alignment)" \
1171 --xml-option append_arg:"--ppp_translator" \
1172 --xml-option append_arg:"replace/llvm::AlignOf<NextTy>::Alignment/(llvm::AlignOf<NextTy>::Alignment)"; \
1173 fi)
1174
1175 # Fails with No target "unwind_static"
1176 # -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \
1177 # -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=OFF \
1178 # -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=ON \
1179 #- to libc++ when libunwind is built
1180 #- Matches what is done on brew:
1181 #- https://bit.ly/3kDNpC9
1182 ifeq (${SCCACHE_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCCACHE_ENABLE.},yes)
1183 # Just in case...
1184 $(SCCACHE_CMD) --stop-server||true
1185 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.),i386 amd64))
1186 # Start the sccache server with the right set of options to use GCP
1187 SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=$(SCCACHE_PATH)/sccache.log SCCACHE_GCS_KEY_PATH=$(SCCACHE_PATH)/secret-gcp-storage.json SCCACHE_GCS_BUCKET=apt-llvm-org-sccache SCCACHE_GCS_RW_MODE=READ_WRITE $(SCCACHE_CMD) --start-server
1188 else
1189 # on s390x machine, use a local cache
1190 SCCACHE_CACHE_SIZE=20G SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=$(SCCACHE_PATH)/sccache.log SCCACHE_DIR=/opt/sccache/cache/ SCCACHE_DIRECT=true $(SCCACHE_CMD) --start-server
1191 endif
1192 endif
1193 echo "Running tests: $(RUN_TEST)"
1194 echo "Verbose build: $(CMAKE_VERBOSE)"
1195 echo "Using cmake: $(CMAKE_BIN)"; \
1196 LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \
1197 $(PRE_PROCESS_CONF) $(CMAKE_BIN) -S llvm/ -B $(TARGET_BUILD) \
1198 -G Ninja \
1199 -DCMAKE_INSTALL_PREFIX=/$(LLVM_DIR) \
1200 -DLLVM_VERSION_SUFFIX= \
1201 -DCMAKE_SUPPRESS_REGENERATION=ON \
1202 -DCMAKE_BUILD_TYPE=Release \
1203 $(call CMAKE_FLAGS,$(STAGE_1_CFLAGS),$(STAGE_1_CXXFLAGS),$(STAGE_1_LDFLAGS)) \
1204 -DPACKAGE_VENDOR=$(VENDOR) \
1205 -DENABLE_LINKER_BUILD_ID=ON \
1206 -DLLVM_TARGETS_TO_BUILD=Native \
1207 -DLLVM_ENABLE_PROJECTS="$(PROJECTS_LIST)" \
1208 -DLLVM_ENABLE_RUNTIMES="$(RUNTIMES_LIST)" \
1209 -DLLVM_ENABLE_PIC=ON \
1210 -DLLVM_ENABLE_RTTI=ON \
1211 -DLLVM_BUILD_DOCS=OFF \
1212 -DLLVM_INCLUDE_GO_TESTS=OFF \
1213 -DLLVM_USE_RELATIVE_PATHS_IN_FILES=ON \
1214 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \
1215 -DLLVM_ENABLE_CURL=$(if $(filter stage1, $(DEB_BUILD_PROFILES)),OFF,ON) \
1216 -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=ON \
1217 -DCLANG_PLUGIN_SUPPORT=OFF \
1218 -DCLANG_BUILD_EXAMPLES=OFF \
1219 -DCLANG_DEFAULT_LINKER=ld \
1220 -DCLANG_DEFAULT_RTLIB=libgcc \
1221 -DCOMPILER_RT_BUILD_XRAY=OFF \
1222 -DCOMPILER_RT_INCLUDE_TESTS=OFF \
1223 -DCOMPILER_RT_USE_LIBCXX=OFF \
1224 -DCOMPILER_RT_USE_BUILTINS_LIBRARY=$(COMPILER_RT_USE_BUILTINS_LIBRARY) \
1225 -DLIBUNWIND_INSTALL_LIBRARY=OFF \
1226 -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \
1227 -DLIBCXXABI_USE_COMPILER_RT=$(LIBCXX_USE_COMPILER_RT) \
1228 -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
1229 -DLIBCXXABI_INSTALL_LIBRARY=OFF \
1230 -DLIBCXX_ENABLE_EXCEPTIONS=ON \
1231 -DLIBCXX_USE_COMPILER_RT=$(LIBCXX_USE_COMPILER_RT) \
1232 -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \
1233 -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \
1234 -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \
1235 -DLIBCXX_INSTALL_LIBRARY=OFF \
1236 -DLIBCXX_INSTALL_MODULES=ON \
1237 -DBOOTSTRAP_LIBCXX_INSTALL_MODULES=ON \
1238 -DLLDB_GLOBAL_INIT_DIRECTORY=/etc/lldb \
1239 -DOPENMP_ENABLE_LIBOMP_PROFILING=OFF \
1240 -DOPENMP_ENABLE_LIBOMPTARGET_PROFILING=OFF \
1241 -DLIBOMP_ENABLE_RTTI=OFF \
1242 -DLIBOMP_OMPT_SUPPORT=OFF \
1243 -DCLANG_FORCE_MATCHING_LIBCLANG_SOVERSION=ON \
1244 -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
1245 $(CMAKE_EXTRA) \
1246 -DBUILTINS_CMAKE_ARGS="$(call CMAKE_NESTED_FLAGS,$(STAGE_1_CFLAGS),$(STAGE_1_CXXFLAGS),$(STAGE_1_LDFLAGS))" \
1247 -DRUNTIMES_CMAKE_ARGS="$(call CMAKE_NESTED_FLAGS,$(STAGE_1_CFLAGS),$(STAGE_1_CXXFLAGS),$(STAGE_1_LDFLAGS),Release,-DCMAKE_Fortran_FLAGS=$(RUNTIMES_FORTRAN_FLAGS))" \
1248 -DCLANG_ENABLE_BOOTSTRAP=ON \
1249 -DCLANG_BOOTSTRAP_TARGETS="$(ENABLED_STAGE2_CMAKE_BUILD_TARGETS)" \
1250 -DCLANG_BOOTSTRAP_PASSTHROUGH="CMAKE_INSTALL_PREFIX;CMAKE_SUPPRESS_REGENERATION;ENABLE_LINKER_BUILD_ID;LLVM_ENABLE_PIC;LLVM_ENABLE_RTTI;LLVM_INCLUDE_GO_TESTS;LLVM_USE_RELATIVE_PATHS_IN_FILES;CLANG_DEFAULT_LINKER;CLANG_DEFAULT_CXX_STDLIB;CLANG_DEFAULT_RTLIB;COMPILER_RT_USE_LIBCXX;COMPILER_RT_USE_BUILTINS_LIBRARY;COMPILER_RT_DEFAULT_TARGET_ONLY;COMPILER_RT_INCLUDE_TESTS;LIBUNWIND_USE_COMPILER_RT;LIBCXXABI_ENABLE_EXCEPTIONS;LIBCXXABI_USE_COMPILER_RT;LIBCXXABI_USE_LLVM_UNWINDER;LIBCXX_USE_COMPILER_RT;LIBCXX_ENABLE_EXCEPTIONS;LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY;LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY;LIBOMP_ENABLE_RTTI;LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN;CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION;CMAKE_C_COMPILER_LAUNCHER;CMAKE_CXX_COMPILER_LAUNCHER;LLVM_LIBC_GPU_BUILD;LLDB_GLOBAL_INIT_DIRECTORY" \
1251 -DBOOTSTRAP_CMAKE_BUILD_TYPE=RelWithDebInfo \
1252 -DBOOTSTRAP_CMAKE_C_FLAGS_RELWITHDEBINFO="$(opt_flags)" \
1253 -DBOOTSTRAP_CMAKE_CXX_FLAGS_RELWITHDEBINFO="$(opt_flags)" \
1254 $(call BOOTSTRAP_CMAKE_FLAGS,$(STAGE_2_CFLAGS),$(STAGE_2_CXXFLAGS),$(STAGE_2_LDFLAGS)) \
1255 -DBOOTSTRAP_LLVM_ENABLE_FFI=ON \
1256 -DBOOTSTRAP_LLVM_ENABLE_DUMP=ON \
1257 -DBOOTSTRAP_LLVM_ENABLE_LIBPFM=ON \
1258 -DBOOTSTRAP_LLVM_ENABLE_SPHINX=ON \
1259 -DBOOTSTRAP_CLANG_DEFAULT_PIE_ON_LINUX=ON \
1260 -DBOOTSTRAP_SPHINX_WARNINGS_AS_ERRORS=OFF \
1261 -DBOOTSTRAP_LLVM_USE_RELATIVE_PATHS_IN_FILES=ON \
1262 -DBOOTSTRAP_LLVM_INSTALL_UTILS=ON \
1263 -DBOOTSTRAP_LLVM_VERSION_SUFFIX= \
1264 -DBOOTSTRAP_LLVM_POLLY_LINK_INTO_TOOLS=ON \
1265 -DBOOTSTRAP_LLVM_EXPERIMENTAL_TARGETS_TO_BUILD="M68k;Xtensa" \
1266 -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="M68k;Xtensa" \
1267 -DBOOTSTRAP_LLVM_LINK_LLVM_DYLIB=ON \
1268 -DBOOTSTRAP_LLVM_ENABLE_CURL=$(if $(filter stage1, $(DEB_BUILD_PROFILES)),OFF,ON) \
1269 -DBOOTSTRAP_CLANG_LINK_CLANG_DYLIB=ON \
1270 -DBOOTSTRAP_LIBCLANG_LIBRARY_VERSION=$(SONAME_EXT) \
1271 -DBOOTSTRAP_LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON \
1272 -DBOOTSTRAP_PYTHON_EXECUTABLE=/usr/bin/python3 \
1273 $(BOOTSTRAP_CMAKE_EXTRA) \
1274 -DBOOTSTRAP_BUILTINS_CMAKE_ARGS="$(call CMAKE_NESTED_FLAGS,$(STAGE_2_CFLAGS),$(STAGE_2_CXXFLAGS),$(STAGE_2_LDFLAGS),RelWithDebInfo,-DCMAKE_C_FLAGS_RELWITHDEBINFO=$(opt_flags);-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$(opt_flags))" \
1275 -DBOOTSTRAP_RUNTIMES_CMAKE_ARGS="$(call CMAKE_NESTED_FLAGS,$(STAGE_2_CFLAGS),$(RUNTIMES_CXXFLAGS),$(STAGE_2_LDFLAGS) -L$(STAGE_1_LIB_DIR),RelWithDebInfo,-DCMAKE_Fortran_FLAGS=$(STAGE_2_FORTRAN_FLAGS);-DCMAKE_C_FLAGS_RELWITHDEBINFO=$(opt_flags);-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$(opt_flags);-DCMAKE_Fortran_FLAGS_RELWITHDEBINFO=$(STAGE_2_FORTRAN_OPT_FLAGS))" || tail -100 build-llvm/CMakeFiles/CMakeConfigureLog.yaml
1276
1277 FOUND_VERSION=`grep LLVM_VERSION_STRING build-llvm/include/llvm/Config/llvm-config.h|cut -d\" -f2`; \
1278 if ! echo "$(LLVM_VERSION_FULL)"|grep -q "$$FOUND_VERSION"; then \
1279 echo "mismatch of version. Found: $$FOUND_VERSION / Expected: $(LLVM_VERSION_FULL)"; \
1280 exit 1; \
1281 fi
1282 @mkdir -p stamps
1283 touch $@
1284
1285 # Set ninja verbosity flag (-v for verbose, empty for terse)
1286 VERBOSEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/VERBOSE.=-v
1287 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. terse,$(DEB_BUILD_OPTIONSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_BUILD_OPTIONS.)))
1288 VERBOSE=
1289 endif
1290
1291 stamps/debian-full-buildscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`stamps/debian-full-build`().: stamps/configure
1292 echo "Using cmake: $(CMAKE_BINscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CMAKE_BIN.)"
1293 # linker hack so stage2 can link against stage1 libs at runtime
1294 LD_LIBRARY_PATH=$(STAGE_1_LIB_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_1_LIB_DIR.):$$LD_LIBRARY_PATH \
1295 $(CMAKE_VERBOSE_FLAGscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CMAKE_VERBOSE_FLAG.) CMAKE_BUILD_PARALLEL_LEVEL=$(NJOBSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/NJOBS.) \
1296 $(TIME_COMMANDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TIME_COMMAND.) $(PRE_PROCESSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PRE_PROCESS.) $(CMAKE_BINscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CMAKE_BIN.) --build $(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.) --target stage2
1297
1298 # Check the stage 2 build worked
1299 if ! readelf --string-dump .comment $(TARGET_BUILD_STAGE2)/bin/clang 2>&1|grep -q "clang version"; then \
1300 echo "clang hasn't been built using clang. Bye bye. Check that the stage2 build has been done."; \
1301 if test "$(SCAN_BUILD)" = "no"; then \
1302 exit 2; \
1303 fi; \
1304 fi
1305 if ldd $(TARGET_BUILD_STAGE2)/lib/libclang-$(LLVM_VERSION).so.1|grep -q libclang-cpp-$(LLVM_VERSION); then \
1306 echo "libclang-$(LLVM_VERSION).so.1 depends on libclang-cpp. Should not be the case"; \
1307 exit 2; \
1308 fi
1309 if test -e $(DEB_INST)/$(LLVM_DIR)/lib/libclang-$(LLVM_VERSION).so.1; then \
1310 echo "libclang-$(LLVM_VERSION).so.1 link is broken"; \
1311 exit 2; \
1312 fi
1313 touch $@
1314
1315 stamps/debian-libfuzzer-buildscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`stamps/debian-libfuzzer-build`().: stamps/debian-full-build
1316 ifeq (${LIBFUZZER_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBFUZZER_ENABLE.},yes)
1317 cd $(TARGET_BUILD); \
1318 CFLAGS="$(opt_flags) $(STAGE_2_CFLAGS)"; \
1319 echo $$CFLAGS; \
1320 for sourcefile in $(BASE_PATH)/compiler-rt/lib/fuzzer/*.cpp; do \
1321 $(SCCACHE_CMD) $(STAGE_2_BIN_DIR)/clang++ -c $$CFLAGS -std=c++17 $$sourcefile -IFuzzer || exit 1; \
1322 done; \
1323 ar ruv libFuzzer.a Fuzzer*.o
1324 endif
1325 touch $@
1326
1327 stamps/debian-libclc-buildscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`stamps/debian-libclc-build`().: stamps/debian-full-build
1328 ifeq ($(LIBCLC_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBCLC_ENABLE.),yes)
1329 # workaround missing files on i386
1330 cd $(TARGET_BUILD_STAGE2) && ninja opt llvm-link llvm-as
1331 # Builds libclc
1332 mkdir -p libclc/build
1333 echo "Using cmake: $(CMAKE_BIN)"
1334 cd libclc/build && \
1335 $(CMAKE_BIN) ../ \
1336 -G Ninja \
1337 $(SCCACHE_CMAKE) \
1338 -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \
1339 -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \
1340 $(call CMAKE_FLAGS,$(opt_flags) $(STAGE_2_CFLAGS),$(opt_flags) $(STAGE_2_CXXFLAGS) -I$(BASE_PATH)/llvm/include,$(STAGE_2_LDFLAGS) -L$(STAGE_2_LIB_DIR)) \
1341 -DCMAKE_INSTALL_PREFIX=/usr \
1342 -DCMAKE_INSTALL_DATADIR=lib \
1343 -DCMAKE_INSTALL_INCLUDEDIR=include \
1344 -DLLVM_CMAKE_DIR=$(STAGE_2_BIN_DIR)/../ \
1345 $(LIBCLC_LLVM_SPIRV) \
1346 -DLIBCLC_TARGETS_TO_BUILD="$(LIBCLC_TARGETS_TO_BUILD)"; \
1347 LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(STAGE_2_LIB_DIR) $(TIME_COMMAND) ninja -j $(NJOBS) $(VERBOSE)
1348 ifdef LLVM_SPIRV
1349 @if ! $(LLVM_SPIRV) --version 2>&1 | grep -q "LLVM version $(LLVM_VERSION)\."; then \
1350 echo "WARNING: llvm-spirv version does not match LLVM $(LLVM_VERSION). Mismatched versions may cause bitcode read failures."; \
1351 $(LLVM_SPIRV) --version; \
1352 sleep 60; \
1353 fi
1354 else
1355 echo "libclc built without SPIRV (.spv) outputs because llvm-spirv-$(LLVM_VERSION) wasn't found"
1356 endif
1357 endif
1358 touch $@
1359
1360 # Cross-compilation rules (wasm32/wasm64 + mingw-w64 compiler-rt/libcxx).
1361 include debian/build-wasm-mingw.mk
1362
1363 stamps/sccache-statsscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`stamps/sccache-stats`().:
1364 # If we used sccache, shows stats
1365 if test -f $(SCCACHE_CMDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCCACHE_CMD.); then \
1366 ls -al $(SCCACHE_PATHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCCACHE_PATH.)/; \
1367 mkdir -p /tmp/buildd/source/; \
1368 $(SCCACHE_CMDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCCACHE_CMD.) --stats-format json --show-stats > /tmp/buildd/source/sccache-stats.json; \
1369 cat /tmp/buildd/source/sccache-stats.json; \
1370 fi
1371 touch $@
1372
1373 override_dh_auto_buildscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_auto_build().: \
1374 stamps/debian-full-build \
1375 $(ifscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/if. $(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. libfuzzer-%, $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)),stamps/debian-libfuzzer-build) \
1376 $(ifscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/if. $(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. libclc-%, $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)),stamps/debian-libclc-build) \
1377 $(ifscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/if. $(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. %-wasm32 %-wasm64, $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)),stamps/debian-wasm-build) \
1378 $(ifscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/if. $(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. %-dev-win, $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)),stamps/debian-mingw-build) \
1379 stamps/sccache-stats
1380
1381 override_dh_prepscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_prep().: stamps/build_doc
1382 dh_prepscip-debian debian debhelper . dh_prep().
1383
1384 ifeq ($(DOC_GENERATIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DOC_GENERATION.), no)
1385 stamps/build_docscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`stamps/build_doc`().: stamps/debian-full-build
1386 mkdir -p $(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.)/tools/clang/stage2-bins/docs/ocamldoc/html/
1387 @echo "Don't build doc on this distro $(DISTROscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DISTRO.)"
1388 else
1389 stamps/build_docscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`stamps/build_doc`().: stamps/debian-full-build
1390 BUILDDIR="_build"; \
1391 ALLSPHINXOPTS="-d $$BUILDDIR/doctrees ."; \
1392 cd $(CURDIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CURDIR.)/llvm/docs && \
1393 sphinx-build -b html $$ALLSPHINXOPTS $$BUILDDIR/html && \
1394 sphinx-build -b man $$ALLSPHINXOPTS $$BUILDDIR/man && \
1395 cd -; \
1396 cd $(CURDIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/CURDIR.)/clang/docs && \
1397 sphinx-build -b html $$ALLSPHINXOPTS $$BUILDDIR/html && \
1398 sphinx-build -b man $$ALLSPHINXOPTS $$BUILDDIR/man
1399
1400 -(if test "$(OCAML_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/OCAML_ENABLE.)" = yes; then \
1401 ninja -C "$(TARGET_BUILD_STAGE2scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD_STAGE2.)" $(VERBOSEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/VERBOSE.) ocaml_doc; \
1402 fi)
1403
1404 ninja -C $(TARGET_BUILD_STAGE2scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD_STAGE2.) $(VERBOSEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/VERBOSE.) docs-llvm-html docs-clang-html docs-clang-tools-html docs-clang-tools-man docs-clang-man docs-llvm-man
1405
1406 ifeq (${POLLY_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/POLLY_ENABLE.},yes)
1407 ninja -C $(TARGET_BUILD_STAGE2) $(VERBOSE) docs-polly-html docs-polly-man
1408 endif
1409
1410 # Rename manpages
1411 d=$(CURDIR)/llvm/docs/_build/man/; \
1412 if test -d $$d; then \
1413 cd $$d; \
1414 for f in *.1; do \
1415 echo "$$f"|grep -q $(LLVM_VERSION) || mv $$f `echo $$f|sed "s|\.1|-$(LLVM_VERSION).1|"`; \
1416 done; \
1417 else \
1418 echo "could not find $$d"; \
1419 fi
1420 # the clang doc generation only generates clang manpage
1421 # When it will do more, we should move that in the loop above
1422 cd clang/docs/_build/man/ && mv clang.1 clang-$(LLVM_VERSION).1
1423
1424 # Remove the copy of jquery. See bug #701087
1425 for d in $(TARGET_BUILD_STAGE2)/docs/html/_static/ $(TARGET_BUILD_STAGE2)/tools/clang/docs/html/_static/ $(TARGET_BUILD_STAGE2)/tools/clang/tools/extra/docs/html/_static/; do \
1426 rm -f $$d/jquery.js $$d/underscore.js; \
1427 ln -s /usr/share/javascript/jquery/jquery.js $$d/jquery.js; \
1428 ln -s /usr/share/javascript/underscore/underscore.js $$d/underscore.js; \
1429 done
1430
1431 mkdir -p debian/man/
1432 ls -al clang/tools/scan-view/bin/scan-view
1433 clang/tools/scan-view/bin/scan-view --help || true
1434 help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/scan-view/bin/scan-view > debian/man/scan-view-$(LLVM_VERSION).1 || true
1435 help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/clang-format/clang-format-diff.py > debian/man/clang-format-diff-$(LLVM_VERSION).1 || true
1436
1437 CMDS="llvm-dwarfdump llvm-mc llvm-objdump llvm-rtdyld llvm-size llvm-ranlib lldb clang-format clang clang++ clang-tblgen clang-check clang-cpp clang-tidy clang-apply-replacements clang-query pp-trace sancov lli modularize clang-include-fixer find-all-symbols clang-reorder-fields ld.lld llvm-tblgen clang-change-namespace clang-offload-bundler clangd clang-repl git-clang-format run-clang-tidy"; \
1438 for f in $$CMDS; do \
1439 echo "Generating manpage of $$f"; \
1440 LD_LIBRARY_PATH=$(DEB_INST)/$(LLVM_DIR)/lib/:/usr/lib/*/libfakeroot help2man --no-info --version-string=$(LLVM_VERSION) $(TARGET_BUILD_STAGE2)/bin/$$f > debian/man/$$f-$(LLVM_VERSION).1 || true; \
1441 done
1442 # Create the following directory regardless as libomp-XX-doc
1443 # is Architecture: all
1444 mkdir -p openmp/runtime/doc/doxygen/generated/html/
1445
1446 if test "$(OPENMP_ENABLE)" = yes; then \
1447 cd openmp/runtime && doxygen doc/doxygen/config; cd -; \
1448 cd openmp/runtime/doc/doxygen/generated/html/ && rm jquery.js && ln -s /usr/share/javascript/jquery/jquery.js; \
1449 fi
1450 touch $@
1451 endif
1452
1453 override_dh_auto_installscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_auto_install().:
1454 ifeq ($(SMALL_DISKscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SMALL_DISK.),yes)
1455 # Clean up temporary files to make sure the install works
1456 rm -rf $(find $(TARGET_BUILD) -wholename '*CMakeFiles*' -not -name CMakeLists.txt -a -name "*.dir" -type d)
1457 endif
1458
1459 # Remove stage2 install stamps so ninja always re-runs the cmake install
1460 # (dh_prepscip-debian debian debhelper . dh_prep(). clears debian/tmp, so the install must re-run on every invocation)
1461 rm -f $(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.)/tools/clang/stage2-stamps/stage2-really-install \
1462 $(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.)/tools/clang/stage2-stamps/stage2-install
1463
1464 # install/fast enables a make install without recompiling temporary files
1465 LD_LIBRARY_PATH=$(STAGE_2_LIB_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/STAGE_2_LIB_DIR.):$$LD_LIBRARY_PATH DESTDIR=$(DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST.)/ ninja -C $(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.) $(VERBOSEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/VERBOSE.) stage2-install
1466
1467 # Not used on Linux.
1468 rm -f $(DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/bin/argdumper
1469 rm -f $(DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/share/clang/clang-format-bbedit.applescript
1470 # Remove bat files https://bugs.llvm.org/show_bug.cgi?id=30755
1471 rm -f $(DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST.)/usr/share/clang/scan-build-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)/libexec/*.bat $(DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST.)/usr/share/clang/scan-build-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)/bin/*.bat
1472
1473 rm -f $(DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/libExampleIRTransforms.a
1474 # Remove an example - introduced in https://reviews.llvm.org/D61446
1475 rm -f $(DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/libBye.a
1476
1477 : # remove extra stuff, not installed by the upstream installation
1478 cp $(TARGET_BUILD_STAGE2scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD_STAGE2.)/bin/clang-query $(DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/bin
1479
1480 : # lit install without tests
1481 mkdir -p $(dscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/d.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/utils/lit
1482 cp -r llvm/utils/lit/lit $(dscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/d.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/utils/lit/.
1483 cp debian/lit $(dscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/d.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/bin/.
1484
1485 # Only run on executable, not script
1486 $(call remove_rpath,$(DEB_INST)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/bin/*)
1487
1488 ifeq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH.), powerpc))
1489 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. $(DEB_HOST_ARCH_OSscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_HOST_ARCH_OS.),linux))
1490 # To fix custom-library-search-path
1491 $(call remove_rpath,$(DEB_INST)/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)*/lib/linux/*.so)
1492 endif
1493 endif
1494
1495 if test "$(LIBUNWIND_ENABLE)" = yes; then \
1496 mkdir -p debian/tmp/usr/include/libunwind; \
1497 cp -R libunwind/include/* debian/tmp/usr/include/libunwind/; \
1498 fi
1499
1500 : # libomp
1501 if test "$(OPENMP_ENABLE)" = yes; then \
1502 cd debian/tmp/$(LLVM_DIR)/lib; \
1503 ln -s libomp.so.$(SONAME_OPENMP) libomp.so; \
1504 fi
1505
1506 # Remove artifact (where compiler-rt is built)
1507 # if test -d $(TARGET_BUILD)/tools/clang/runtime/compiler-rt/clang_linux; then \
1508 # cd $(TARGET_BUILD)/tools/clang/runtime/compiler-rt/clang_linux && rm -rf $$(find . -mindepth 2 -maxdepth 2 -type d) && rm -rf $$(find -empty) && rm -rf */.dir; \
1509 # fi
1510
1511 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. clang-tools-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.), $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)))
1512 mkdir -p debian/clang-tools-$(LLVM_VERSION)/$(LLVM_DIR)/bin/
1513 cp compiler-rt/lib/asan/scripts/asan_symbolize.py \
1514 debian/clang-tools-$(LLVM_VERSION)/$(LLVM_DIR)/bin/asan_symbolize
1515 dh_link -p clang-tools-$(LLVM_VERSION) \
1516 /$(LLVM_DIR)/bin/asan_symbolize /usr/bin/asan_symbolize-$(LLVM_VERSION)
1517 endif
1518
1519 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. libfuzzer-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-dev, $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)))
1520 ifeq (${LIBFUZZER_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LIBFUZZER_ENABLE.},yes)
1521 mkdir -p debian/libfuzzer-$(LLVM_VERSION)-dev/$(LLVM_DIR)/lib/
1522 cp -v $(TARGET_BUILD)/libFuzzer.a debian/libfuzzer-$(LLVM_VERSION)-dev/$(LLVM_DIR)/lib/
1523 endif
1524 endif
1525
1526 # Because of hurd, we are more flexible in what we include in libclang-X.Y-rt
1527 # but we don't want to install wasi or windows files into libclang-rt as they
1528 # have their own package So, we remove this directory from the package
1529 rm -f debian/libclang-rt-$(LLVM_VERSION)-dev/$(LLVM_DIR)/lib/wasi/
1530 rm -f debian/libclang-rt-$(LLVM_VERSION)-dev/$(LLVM_DIR)/lib/windows/
1531
1532 # Create this fake directory to make the install libclang-common-dev happy
1533 # under the unsupported archs of compiler-rt
1534 mkdir -p $(DEB_INST)/usr/lib/clang/$(LLVM_VERSION)/lib
1535 mkdir -p $(DEB_INST)/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/lib/
1536 mkdir -p $(DEB_INST)/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/lib/clang_linux/
1537 mkdir -p $(TARGET_BUILD)/tools/clang/runtime/compiler-rt/clang_linux/
1538 mkdir -p $(DEB_INST)/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/share/
1539 # On some archs, the sanitizers are not built. As we explicitly includes some txt files, create
1540 # a fake txt to make sure it doesn't fail
1541 echo "The *.txt files, if available, contain helper to override some of the errors messages." > $(DEB_INST)/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/README.txt
1542 echo "Please visit https://github.com/google/sanitizers/wiki/AddressSanitizer for help" >> $(DEB_INST)/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/README.txt
1543 # Path changed. Make a copy of it
1544 cp $(DEB_INST)/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/README.txt $(DEB_INST)/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/share/README.txt
1545
1546 # Remove things that CMake install but which aren't packaged yet,
1547 # or are packaged from the source or build tree.
1548 mv $(DEB_INST)/$(LLVM_DIR)/bin/clang-$(LLVM_VERSION) \
1549 $(DEB_INST)/$(LLVM_DIR)/bin/clang
1550
1551 # workaround issue https://github.com/llvm/llvm-project/issues/57101
1552 find debian/tmp -iname 'libbolt_rt*.a' -path '*/build-llvm/*' -delete
1553 # Remove an osx file
1554 rm -f $(DEB_INST)/$(LLVM_DIR)/lib/libbolt_rt_instr_osx.a
1555
1556 : # FIXME: prepare_builtins: error while loading shared libraries: libLLVM.so.X.Y.1
1557 if test -d libclc/build; then \
1558 LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(CURDIR)/build-llvm/tools/clang/stage2-bins/lib \
1559 DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C libclc/build install; \
1560 fi
1561
1562 set -e; for dir in build-wasm/compiler-rt-wasm32 build-wasm/compiler-rt-wasm64 build-wasm/libcxx-wasm32-wasi; do \
1563 if test -d $$dir; then \
1564 DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C $$dir install; \
1565 fi; \
1566 done
1567
1568 set -e; for arch in x86_64 i686 armv7 aarch64; do \
1569 if test -d build-mingw/compiler-rt-$${arch}; then \
1570 DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-mingw/compiler-rt-$${arch} install; \
1571 fi; \
1572 done
1573
1574 # Rename binaries
1575 mkdir -p $(DEB_INST)/usr/bin/
1576 cd $(DEB_INST)/usr/bin/; \
1577 rm -f *; \
1578 for f in ../lib/llvm-$(LLVM_VERSION)/bin/*; do \
1579 ln -s $$f `basename $$f`-$(LLVM_VERSION); \
1580 echo "Link $$f to `basename $$f`-$(LLVM_VERSION)"; \
1581 done
1582
1583 rm -f $(DEB_INST)/usr/bin/flang-$(LLVM_VERSION)-$(LLVM_VERSION)
1584 # Rename some stuff with the version name
1585 cp clang/tools/scan-build/man/scan-build.1 clang/tools/scan-build/man/scan-build-$(LLVM_VERSION).1
1586
1587 # copy the vim files (except that tablegen does not exist for indent
1588 VIM_DIRS="ftdetect ftplugin syntax indent"; \
1589 for dir in $$VIM_DIRS; do \
1590 cp -f llvm/utils/vim/$$dir/llvm.vim llvm/utils/vim/$$dir/llvm-$(LLVM_VERSION).vim; \
1591 if test -f llvm/utils/vim/$$dir/tablegen.vim; then \
1592 cp -f llvm/utils/vim/$$dir/tablegen.vim llvm/utils/vim/$$dir/tablegen-$(LLVM_VERSION).vim; \
1593 fi; \
1594 done
1595 cp -f llvm/utils/vim/vimrc llvm/utils/vim/llvm-$(LLVM_VERSION)-vimrc
1596
1597 cp -f clang/tools/clang-format/clang-format-diff.py clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION)
1598
1599 cp -f clang/tools/clang-format/clang-format.py clang/tools/clang-format/clang-format-$(LLVM_VERSION).py
1600
1601 rm -rf clang/tools/scan-build-$(LLVM_VERSION)
1602 cp -fR clang/tools/scan-build clang/tools/scan-build-$(LLVM_VERSION)
1603
1604 rm -rf clang/tools/scan-build-py-$(LLVM_VERSION)
1605 cp -fR clang/tools/scan-build-py clang/tools/scan-build-py-$(LLVM_VERSION)
1606 chmod +x clang/tools/scan-build-py-$(LLVM_VERSION)/bin/*
1607
1608 rm -rf clang/tools/scan-view-$(LLVM_VERSION)
1609 cp -fR clang/tools/scan-view clang/tools/scan-view-$(LLVM_VERSION)
1610
1611 # Remove some license files
1612 rm -f $(DEB_INST)/$(LLVM_DIR)/include/llvm/Support/LICENSE.TXT
1613
1614 # Disable CMake's LLVMExports package validation checks for target files that we may remove.
1615 sed -i \
1616 -e '/_\(cmake_import_check_targets\|IMPORT_CHECK_TARGETS\) \(Polly\|sancov\|llvm-omp-device-info\|omptarget\|omp\)/ {s|^|#|}' \
1617 -e '/_\(cmake_import_check_targets\|IMPORT_CHECK_TARGETS\) LLVM/ {s|^|#|}' \
1618 -e '/_\(cmake_import_check_targets\|IMPORT_CHECK_TARGETS\)_.*\/libLLVM\.so\.1.*/ {s|^|#|}' \
1619 -e '/_\(cmake_import_check_targets\|IMPORT_CHECK_TARGETS\) \(mlir-\|MLIR\)/ {s|^|#|}' \
1620 -e '/_\(cmake_import_check_files_for\|IMPORT_CHECK_FILES_FOR\)_.*\/bin\/.*/ {s|^|#|}' \
1621 -e '/_\(cmake_import_check_files_for\|IMPORT_CHECK_FILES_FOR\)_\(mlir\|Polly\|MLIR\|omp\|omptarget\)/ {s|^|#|}' \
1622 $(DEB_INST)/$(LLVM_DIR)/lib/cmake/llvm/LLVMExports-*.cmake
1623
1624 sed -i \
1625 -e '/_\(cmake_import_check_files_for\|IMPORT_CHECK_FILES_FOR\)_.*\/bin\/.*/ {s|^|#|}' \
1626 -e '/_\(cmake_import_check_files_for\|IMPORT_CHECK_FILES_FOR\)_\(mlir\|Polly\|MLIR\|omp\|omptarget\)/ {s|^|#|}' \
1627 $(DEB_INST)/$(LLVM_DIR)/lib/cmake/clang/ClangTargets-*.cmake
1628
1629 : # Fix the python lldb installation
1630 : # The link to the binary extension is managed in python3-lldb-X.Y.links.in
1631 : # this binary is installed in lldb-X.Y, not depending on python3-lldb-X.Y
1632 rm -vf $(DEB_INST)/$(LLVM_DIR)/lib/$(PYTHON3)/site-packages/lldb/lldb-argdumper
1633
1634 # Manage the polly files. Sometimes, we build them. Sometimes not.
1635 if test "$(POLLY_ENABLE)" = yes; then \
1636 mkdir -p debian/libclang-$(LLVM_VERSION)-dev/$(LLVM_DIR)/lib/ \
1637 debian/libpolly-$(LLVM_VERSION)-dev/$(LLVM_DIR)/include/polly/; \
1638 mv -f $(DEB_INST)/$(LLVM_DIR)/lib/libPolly* \
1639 debian/libpolly-$(LLVM_VERSION)-dev/$(LLVM_DIR)/lib/; \
1640 rm -rf debian/libpolly-$(LLVM_VERSION)-dev/$(LLVM_DIR)/include/polly; \
1641 mv -f $(DEB_INST)/$(LLVM_DIR)/include/polly/ \
1642 debian/libpolly-$(LLVM_VERSION)-dev/$(LLVM_DIR)/include/; \
1643 fi
1644
1645 mkdir -p debian/usr/share/doc/llvm-$(LLVM_VERSION)-doc/ debian/usr/share/doc/clang-$(LLVM_VERSION)-doc/
1646 if test "$(DOC_GENERATION)" = yes; then \
1647 cp -R $(TARGET_BUILD_STAGE2)/docs/html debian/usr/share/doc/llvm-$(LLVM_VERSION)-doc/; \
1648 cp -R $(TARGET_BUILD_STAGE2)/tools/clang/docs/html debian/usr/share/doc/clang-$(LLVM_VERSION)-doc/; \
1649 cp -R $(TARGET_BUILD_STAGE2)/tools/clang/tools/extra/docs/html debian/usr/share/doc/clang-$(LLVM_VERSION)-doc/clang-extra; \
1650 else \
1651 mkdir -p llvm/docs/_build/html clang/docs/_build/html/ tools/clang/tools/extra/docs/html openmp/runtime/doc/doxygen/generated/html/ debian/man/ clang/docs/_build/man/ llvm/docs/_build/man/; \
1652 rm -f debian/*$(LLVM_VERSION)*manpages; \
1653 fi
1654
1655 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. libllvm-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-ocaml-dev, $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)))
1656 # Rename OCaml bindings
1657 if test "$(OCAML_ENABLE)" = yes; then \
1658 mkdir -p "$(DEB_INST)/$(OCAML_STDLIB_DIR)"; \
1659 mkdir -p "$(DEB_INST)/$(LLVM_DIR)/docs/ocaml/html/html"; \
1660 mkdir -p "$(DEB_INST)/$(LLVM_DIR)/share/doc/llvm/ocaml-html/"; \
1661 if test -d "$(DEB_INST)/$(LLVM_DIR)/lib/ocaml"; then \
1662 mv -f "$(DEB_INST)$(LLVM_DIR)/lib/ocaml" \
1663 "$(DEB_INST)$(OCAML_STDLIB_DIR)/llvm-$(LLVM_VERSION)"; \
1664 fi; \
1665 fi
1666 endif
1667
1668 # For some reasons, from Ubuntu jammy, python stuff are installed in /local/lib, move it back
1669 if test -d $(DEB_INST)/$(LLVM_DIR)/local/lib/; then \
1670 mv $(DEB_INST)/$(LLVM_DIR)/local/lib/* $(DEB_INST)/$(LLVM_DIR)/lib/; \
1671 rm -f $(DEB_INST)/$(LLVM_DIR)/lib/python*/*-packages/six.py; \
1672 ls $(DEB_INST)/$(LLVM_DIR)/local/; \
1673 rmdir $(DEB_INST)/$(LLVM_DIR)/local/lib; \
1674 rmdir $(DEB_INST)/$(LLVM_DIR)/local; \
1675 fi
1676
1677 # Disable the python binding for buster. not sure why it regressed
1678 # regressed de4364f1ecaa..0745b0c0354a
1679 if test "$(DISTRO)" = "buster"; then \
1680 mkdir -p $(DEB_INST)/$(LLVM_DIR)/share/gdb/python/ompd/; \
1681 touch $(DEB_INST)/$(LLVM_DIR)/share/gdb/python/ompd/empty; \
1682 fi
1683 if test "$(LLDB_PYTHON_ENABLE)" = no; then \
1684 echo "" > debian/python3-lldb-$(LLVM_VERSION).install; \
1685 fi
1686 # rename the ompd.so python extension, plus the whole thing shouldn't go to share ...
1687 if [ -f $(DEB_INST)/$(LLVM_DIR)/share/gdb/python/ompd/ompdModule.so ]; then \
1688 mv $(DEB_INST)/$(LLVM_DIR)/share/gdb/python/ompd/ompdModule.so \
1689 $(DEB_INST)/$(LLVM_DIR)/share/gdb/python/ompd/ompdModule$(PY_EXT_SUFFIX); \
1690 fi
1691
1692 # Remove some mlir example
1693 rm -f $(DEB_INST)/$(LLVM_DIR)/lib/libMyExtensionCh*.a
1694
1695 # Add autocompletion for the versioned clang binary, Debian #1109370
1696 echo 'complete -F _clang clang-$(LLVM_VERSION)' \
1697 >> $(DEB_INST)/$(LLVM_DIR)/share/clang/bash-autocomplete.sh
1698
1699 # Python code removals
1700 rm -vf $(DEB_INST)/$(LLVM_DIR)/lib/python*/*-packages/six.py \
1701 $(DEB_INST)/$(LLVM_DIR)/local/lib/python*/*-packages/six.py
1702 find $(DEB_INST)/$(LLVM_DIR) \( -type d -name __pycache__ -o -type f -name '*.pyc' \) | xargs -r rm -vrf
1703
1704 : # fix lintian warnings for non-script python files
1705 -chmod a-x $(d)/$(LLVM_DIR)/utils/lit/lit/main.py \
1706 $(d)/$(LLVM_DIR)/utils/lit/lit/reports.py \
1707 $(d)/$(LLVM_DIR)/share/opt-viewer/optpmap.py
1708
1709 : # Replace all '#!' calls to python with /usr/bin/python3
1710 : # and make them executable
1711 : # FIXME: scan-build and scan-view are only installed via install file, fix it in the source for now
1712 -for i in \
1713 $$(find \
1714 $(d)/$(LLVM_DIR)/bin \
1715 $(d)/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/bin \
1716 $(d)/$(LLVM_DIR)/share/clang \
1717 $(d)/$(LLVM_DIR)/utils/lit \
1718 $(d)/$(LLVM_DIR)/share/opt-viewer \
1719 $(d)/$(LLVM_DIR)/share/scan-view \
1720 $(d)/$(LLVM_DIR)/lib/$(PYTHON3)/site-packages/lldb \
1721 $(d)/usr/share/clang/scan-build-$(LLVM_VERSION) \
1722 $(d)/usr/share/clang/scan-view-$(LLVM_VERSION) \
1723 clang/tools/scan-build-$(LLVM_VERSION) \
1724 clang/tools/scan-view-$(LLVM_VERSION) \
1725 -type f ! -name '*.so*' ); \
1726 do \
1727 if file -b $$i | grep -q ^ELF; then \
1728 continue; \
1729 fi; \
1730 sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python3\1,' \
1731 $$i > $$i.temp; \
1732 if cmp --quiet $$i $$i.temp; then \
1733 rm -f $$i.temp; \
1734 else \
1735 if [ ! -x $$i ]; then \
1736 echo "fixed x file permissions: $$i"; \
1737 fi; \
1738 mv -f $$i.temp $$i; \
1739 chmod 755 $$i; \
1740 echo "fixed interpreter: $$i"; \
1741 fi; \
1742 done
1743
1744 # Delete the target build directory to save some space on the build systems
1745 # All the files have been installed in $(CURDIR)/debian/tmp/ already
1746 ifeq ($(SMALL_DISKscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SMALL_DISK.),yes)
1747 rm -rf $(TARGET_BUILD)
1748 endif
1749
1750
1751 override_dh_python3scip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_python3().:
1752 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. python3-lldb-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.), $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)))
1753 -find debian \( -name '_lldb*.so' -o -name 'liblldb*.so*' \) -ls
1754 : # need the extension be present before calling dh_python3
1755 mkdir -p debian/python3-lldb-$(LLVM_VERSION)/$(LLVM_DIR)/lib/$(PYTHON3)/site-packages/lldb/native
1756 rm -vf debian/python3-lldb-$(LLVM_VERSION)/$(LLVM_DIR)/lib/$(PYTHON3)/site-packages/lldb/native/_lldb$(PY_EXT_SUFFIX)
1757 cp $(DEB_INST)/$(LLVM_DIR)/lib/liblldb-$(LLVM_VERSION).so.1 \
1758 debian/python3-lldb-$(LLVM_VERSION)/$(LLVM_DIR)/lib/$(PYTHON3)/site-packages/lldb/native/_lldb$(PY_EXT_SUFFIX)
1759 dh_python3 -v -p python3-lldb-$(LLVM_VERSION) \
1760 /$(LLVM_DIR)/lib/$(PYTHON3)/site-packages/lldb
1761 -ls debian/python3-lldb-$(LLVM_VERSION).p*.debhelper
1762 -cat debian/python3-lldb-$(LLVM_VERSION).substvars
1763 -find debian/python3-lldb-$(LLVM_VERSION)
1764 : # remove, symlink created later by dh_link
1765 rm -vf debian/python3-lldb-$(LLVM_VERSION)/$(LLVM_DIR)/lib/$(PYTHON3)/site-packages/lldb/native/_lldb$(PY_EXT_SUFFIX)
1766 endif
1767 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. python3-clang-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.), $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)))
1768 dh_python3 -v -p python3-clang-$(LLVM_VERSION)
1769 -ls debian/python3-clang-$(LLVM_VERSION).p*.debhelper
1770 -cat debian/python3-clang-$(LLVM_VERSION).substvars
1771 -find debian/python3-clang-$(LLVM_VERSION)
1772 endif
1773 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. clang-tools-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.), $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)))
1774 dh_python3 -v -p clang-tools-$(LLVM_VERSION)
1775 endif
1776 dh_python3scip-debian debian debhelper . dh_python3(). -v -p llvm-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-tools \
1777 /$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/utils/lit
1778
1779
1780 # for apt.llvm.org and prerelease versions, we are depending on the
1781 # upstream version. After release, assume that the ABIs don't change
1782 # anymore with the point releases (X.Y.1, Y.Y.2, ...)
1783 LLVM_RELEASEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_RELEASE. := $(LLVM_EPOCHscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_EPOCH.)$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.).$(LLVM_VERSION_MINORscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION_MINOR.).0
1784 override_dh_makeshlibsscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_makeshlibs().:
1785 ifeq ($(SLOPPY_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SLOPPY_BUILD.),yes)
1786 @echo 'FIXME: SLOPPY_BUILD defined, check results of dh_makeshlibs'
1787 endif
1788 ifneq (,$(findstringscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/findstring. ~,$(PKG_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/PKG_VERSION.)))
1789 : # all in one call, to get results for all in case of mismatches
1790 $(ignore_if_fail)dh_makeshlibs \
1791 -plibclang$(SONAME_EXT)-$(LLVM_VERSION) \
1792 -pliblldb-$(LLVM_VERSION) \
1793 -plibllvm$(LLVM_VERSION) \
1794 $(if $(filter yes, $(SKIP_COMMON_PACKAGES)),,-plibomp$(SONAME_OPENMP))
1795 else
1796 $(ignore_if_fail)dh_makeshlibs -plibclang$(SONAME_EXT)-$(LLVM_VERSION) \
1797 '-Vlibclang$(SONAME_EXT)-$(LLVM_VERSION) (>= $(LLVM_RELEASE))'
1798 $(ignore_if_fail)dh_makeshlibs -pliblldb-$(LLVM_VERSION) \
1799 '-Vliblldb-$(LLVM_VERSION) (>= $(LLVM_RELEASE))'
1800 $(ignore_if_fail)dh_makeshlibs -plibllvm$(LLVM_VERSION) \
1801 '-Vlibllvm$(LLVM_VERSION) (>= $(LLVM_RELEASE))'
1802 ifneq ($(SKIP_COMMON_PACKAGES),yes)
1803 $(ignore_if_fail)dh_makeshlibs -plibomp$(SONAME_OPENMP) \
1804 '-Vlibomp$(SONAME_OPENMP) (>= $(LLVM_RELEASE))'
1805 endif
1806
1807 ifneq ($(SKIP_COMMON_PACKAGES),yes)
1808 : # ignore errors for these new packages for now
1809 $(ignore_if_fail)dh_makeshlibs -pllvm-libunwind1 -plibc++abi1 -plibc++1
1810 endif
1811 endif
1812 $(ignore_if_failscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/ignore_if_fail.)dh_makeshlibsscip-debian debian debhelper . dh_makeshlibs(). --remaining-packages -V
1813
1814 override_dh_shlibdepsscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_shlibdeps().:
1815 ifeq ($(SKIP_COMMON_PACKAGESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SKIP_COMMON_PACKAGES.),yes)
1816 echo 'libc++ 1 libc++1 (>= 1:$(LLVM_VERSION).1)' > debian/shlibs.common
1817 echo 'libc++abi 1 libc++abi1 (>= 1:$(LLVM_VERSION).1)' >> debian/shlibs.common
1818 ifneq (,$(filter $(DEB_HOST_ARCH), $(OMP_ARCHS)))
1819 echo 'libomp $(SONAME_OPENMP) libomp5 (>= 1:$(LLVM_VERSION).1)' >> debian/shlibs.common
1820 endif
1821 ifneq (,$(filter $(DEB_HOST_ARCH), $(LIBUNWIND_ARCHS)))
1822 echo 'libunwind 1 llvm-libunwind1 (>= 1:$(LLVM_VERSION).1)' >> debian/shlibs.common
1823 endif
1824 cat debian/shlibs.common >> debian/shlibs.local
1825 endif
1826 ifeq ($(SLOPPY_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SLOPPY_BUILD.),yes)
1827 @echo 'FIXME: SLOPPY_BUILD defined, check results of dh_shlibdeps'
1828 endif
1829 # Ignore asan libraries. They would trigger dependencies to multiarch libraries
1830 dh_shlibdepsscip-debian debian debhelper . dh_shlibdeps(). -l$(DEB_INSTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DEB_INST.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/ \
1831 -Xlibclang_rt.asan -Xlibclang_rt.asan -Xlibclang_rt.asan-*.so -Xlibclang_rt.asan-*.so
1832
1833 override_dh_installmanscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_installman().:
1834 if test -f lld/docs/ld.lld.1; then \
1835 mv lld/docs/ld.lld.1 lld/docs/ld.lld-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.).1; \
1836 fi
1837 dh_installmanscip-debian debian debhelper . dh_installman().
1838 # Make sure that lli manpage is only in llvm-3.2-runtime (See #697117)
1839 rm -f debian/llvm-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)/usr/share/man/man1/lli*
1840
1841
1842 override_dh_stripscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_strip().:
1843 ifeq ($(SMALL_DISKscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SMALL_DISK.),yes)
1844 : # running out of diskspace on the buildds
1845 find $(TARGET_BUILD) \( -name '*.o' -o -name '*.a' \) -type f | xargs -r rm -f
1846 endif
1847 ifeq (0, $(stripscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/strip. $(shellscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/shell. dpkg --compare-versions $(DH_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/DH_VERSION.) ge 9.20160114; echo $$?)))
1848 : # If we don't have the right version of debhelper, don't run the option
1849 dh_strip -p libclang$(SONAME_EXT)-$(LLVM_VERSION) --dbgsym-migration='libclang$(SONAME_EXT)-$(LLVM_VERSION)-dbg'
1850 dh_strip -p libllvm$(LLVM_VERSION) --dbgsym-migration='libllvm$(LLVM_VERSION)-dbg'
1851 dh_strip -p liblldb-$(LLVM_VERSION) --dbgsym-migration='liblldb-$(LLVM_VERSION)-dbg'
1852 endif
1853 # ifeq (${LLD_ENABLE},yes)
1854 # PATH=$(CURDIR)/:$$PATH dh_strip -p liblld-$(LLVM_VERSION) --dbg-package=liblld-$(LLVM_VERSION)-dbg
1855 # endif
1856 ifeq ($(callscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/call. check_pkg_version,binutils,lt,2.31.1-11),yes)
1857 : # building with clang, binutils/strip has hard time stripping some libs because of
1858 : # https://sourceware.org/bugzilla/show_bug.cgi?id=23788
1859 : # use llvm-strip instead
1860 : # Workaround some issues with stripping by using llvm's
1861 if test ! -f $(CURDIR)/strip; then \
1862 ln -s $(CURDIR)/debian/llvm-$(LLVM_VERSION)/$(LLVM_DIR)/bin/llvm-strip $(CURDIR)/strip; \
1863 fi
1864 ls -al $(CURDIR)/debian/.debhelper/*/dbgsym-root/usr/lib/debug/.build-id/*/*|| true
1865 : # On some old version of Debian (stretch) and Ubuntu, Rules-Requires-Root isn't supported
1866 : # Sometime, it fails because of chown: changing ownership of 'debian/.debhelper/clang-7/dbgsym-root/usr/lib/debug/.build-id/37/ba506ae9d2f82219bf5c552f7c09853052b2b0.debug': Operation not permitted
1867 : # Therefore, continue when we encounter an error
1868 PATH=$(CURDIR)/:$$PATH LD_LIBRARY_PATH=$(DEB_INST)/$(LLVM_DIR)/lib/:/usr/lib/*/libfakeroot dh_strip -a -v || true
1869 : # Remove the workaround
1870 rm $(CURDIR)/strip
1871 : # for some reasons, the +x might be removed
1872 chmod -f +x $(CURDIR)/debian/*/$(LLVM_DIR)/bin/* || true
1873 else
1874 # GNU strip doesn't recognize WebAssembly binaries, and actually corrupts them.
1875 # llvm-strip (as of 15.0.2) fails with --strip-debug (but works with --strip-all)
1876 dh_strip -a -v -Xlibclang_rt.builtins-wasm32.a -Xlibclang_rt.builtins-wasm64.a -Xusr/lib/wasm32-wasi
1877 endif
1878
1879 override_dh_installscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_install().:
1880 : # fix libLLVM.so install, install it under the SONAME
1881 -ls -l debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/libLLVM*.so*
1882
1883 if [ -f debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/libLLVM.so.$(SONAME_EXTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SONAME_EXT.) ] && [ ! -h debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/libLLVM.so.$(SONAME_EXTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SONAME_EXT.) ]; then \
1884 soname=$$(objdump -p debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/libLLVM.so.$(SONAME_EXTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SONAME_EXT.) | awk '/ *SONAME / {print $$2}'); \
1885 rm -f debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/$$soname; \
1886 mv debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/libLLVM.so.$(SONAME_EXTscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SONAME_EXT.) debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/$$soname; \
1887 ln -sf $$soname debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/libLLVM-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.).so; \
1888 ln -sf $$soname debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/libLLVM.so; \
1889 fi
1890
1891 ifeq (${POLLY_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/POLLY_ENABLE.},yes)
1892 # only for arch:any builds
1893 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. libpolly-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-dev, $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)))
1894 dh_install -p libpolly-$(LLVM_VERSION)-dev $(LLVM_DIR)/lib/cmake/polly/*.cmake $(LLVM_DIR)/lib/cmake/polly
1895 # On old Debian & Ubuntu, removing the files is necessary
1896 rm -rf debian/tmp/$(LLVM_DIR)/lib/cmake/polly/*.cmake
1897 else
1898 rm -rf debian/tmp/$(LLVM_DIR)/lib/cmake/polly/*.cmake
1899 endif
1900 endif
1901
1902 ifeq ($(SKIP_COMMON_PACKAGESscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SKIP_COMMON_PACKAGES.),yes)
1903 : # removing files from the common packages
1904 for p in $(COMMON_PKGS); do \
1905 echo "===== removing files from common package $$p ====="; \
1906 for f in $$(sed -e 's/^ *\[[^]]*\] *//' debian/$$p.install | awk '/^#|^ *$$/ {next} {print $$1}'); do \
1907 rm -vfr debian/tmp/$$f; \
1908 done; \
1909 echo ''; \
1910 done
1911 endif
1912
1913 ifneq ($(SLOPPY_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SLOPPY_BUILD.),yes)
1914 dh_install --fail-missing ${skip_packages}
1915 else
1916 : # don't fail on additional build artifacts, let the build continue
1917 @echo 'FIXME: SLOPPY_BUILD defined, check results of dh_install'
1918 dh_install --list-missing ${skip_packages}
1919 endif
1920
1921 # Move the libc++ abi files from libc++ to libc++-abi for the wasm32 packages
1922 # These packages are arch: all, so only do so when the packages are built
1923 ifneq (,$(filterscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/filter. libc++-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-dev-wasm32, $(packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/packages.)))
1924 mkdir -p debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/$(LLVM_DIR)/include/wasm32-wasi/c++/v1
1925 if test -f debian/libc++-$(LLVM_VERSION)-dev-wasm32/$(LLVM_DIR)/include/wasm32-wasi/c++/v1/__cxxabi_config.h; then \
1926 mv debian/libc++-$(LLVM_VERSION)-dev-wasm32/$(LLVM_DIR)/include/wasm32-wasi/c++/v1/__cxxabi_config.h \
1927 debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/$(LLVM_DIR)/include/wasm32-wasi/c++/v1/__cxxabi_config.h; \
1928 mv debian/libc++-$(LLVM_VERSION)-dev-wasm32/$(LLVM_DIR)/include/wasm32-wasi/c++/v1/cxxabi.h \
1929 debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/$(LLVM_DIR)/include/wasm32-wasi/c++/v1/cxxabi.h; \
1930 fi
1931 endif
1932 # Because of hurd, we are more flexible in what we include in libclang-X.Y-rt
1933 # but we don't want to install wasi files into libclang-rt as they have their own package
1934 # So, we remove this directory from the package
1935 rm -fr debian/libclang-rt-$(LLVM_VERSION)-dev/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/lib/wasi/
1936
1937 if [ -d debian/llvm-$(LLVM_VERSION)/usr/share/doc/llvm-$(LLVM_VERSION) ]; then \
1938 for svg in usage-*.svg; do \
1939 [ -f $$svg ] || continue; \
1940 xz -9v $$svg; \
1941 cp -p $$svg.xz debian/llvm-$(LLVM_VERSION)/usr/share/doc/llvm-$(LLVM_VERSION)/.; \
1942 done; \
1943 fi
1944
1945 # create a debian_config.mk file to use in llvm-defaults
1946 # avoids hard-coding the architectures for various packages
1947 # CLANG_RT_ARCHS is used in llvm-defaults, but not here ... set it to ANY_ARCHS
1948 mkdir -p debian/llvm-$(LLVM_VERSION)-dev/$(LLVM_DIR)/share
1949 ( \
1950 echo '# record component builds for every architecture'; \
1951 echo 'ANY_ARCHS = $(ANY_ARCHS)'; \
1952 echo 'BINUTILS_ARCHS = $(BINUTILS_ARCHS)'; \
1953 echo 'BINUTILS_GOLD_ARCHS = $(BINUTILS_GOLD_ARCHS)'; \
1954 echo 'BOLT_ARCHS = $(BOLT_ARCHS)'; \
1955 echo 'CLANG_GRPC_ARCHS = $(CLANG_GRPC_ARCHS)'; \
1956 echo 'CLANG_RT_ARCHS = $(ANY_ARCHS)'; \
1957 echo 'FLANG_ARCHS = $(FLANG_ARCHS)'; \
1958 echo 'HWASAN_ARCHS = $(HWASAN_ARCHS)'; \
1959 echo 'LIBFUZZER_ARCHS = $(LIBFUZZER_ARCHS)'; \
1960 echo 'LIBUNWIND_ARCHS = $(LIBUNWIND_ARCHS)'; \
1961 echo 'LLD_ARCHS = $(LLD_ARCHS)'; \
1962 echo 'LLDB_ARCHS = $(LLDB_ARCHS)'; \
1963 echo 'LLVM_LIBC_ARCHS = $(LLVM_LIBC_ARCHS)'; \
1964 echo 'LLVM_SPIRV_ARCHS = $(LLVM_SPIRV_ARCHS)'; \
1965 echo 'MULTILIB_ARCHS = $(MULTILIB_ARCHS)'; \
1966 echo 'OCAML_ARCHS = $(OCAML_ARCHS)'; \
1967 echo 'OFFLOAD_ARCHS = $(OFFLOAD_ARCHS)'; \
1968 echo 'OMP_ARCHS = $(OMP_ARCHS)'; \
1969 echo 'OMPD_ARCHS = $(OMPD_ARCHS)'; \
1970 echo 'POLLY_ARCHS = $(POLLY_ARCHS)'; \
1971 echo 'RT_ORC_ARCHS = $(RT_ORC_ARCHS)'; \
1972 echo 'Z3_ARCHS = $(Z3_ARCHS)'; \
1973 ) > debian/llvm-$(LLVM_VERSION)-dev/$(LLVM_DIR)/share/debian_config.mk
1974
1975
1976 stamps/repack_a_llvm_irscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`stamps/repack_a_llvm_ir`().:
1977 ifeq (${LTO_ENABLEscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LTO_ENABLE.},yes)
1978 # with LTO, .a contains llvm ir instead of native code. So, recompile them
1979 NJOBS="$(NJOBS)" P_TO_LLVM="$(CURDIR)" VERSION=$(LLVM_VERSION) bash -v debian/llvm-compile-lto-elf.sh $(CXXFLAGS_EXTRA)
1980 endif
1981 touch $@
1982
1983
1984 override_dh_installdebscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_installdeb().: stamps/repack_a_llvm_ir
1985 # Managed by the package
1986 dh_installdebscip-debian debian debhelper . dh_installdeb(). -a
1987
1988 rm -f debian/tmp/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/python*/*-packages/lldb/__init__.pyc debian/python*-lldb-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)/$(LLVM_DIRscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_DIR.)/lib/python*/*-packages/lldb/__init__.pyc
1989 rm -f debian/clang-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-examples/usr/share/doc/clang-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)-examples/examples/*Make*
1990
1991 # the openmp header files moved to the same path as lib clang headers.
1992 # To make sure they aren't conflicting ( https://bugs.llvm.org/show_bug.cgi?id=46977 )
1993 # Remove them from the libclang-common package
1994 rm -f debian/libclang-common-$(LLVM_VERSION)-dev/$(LLVM_DIR)/lib/clang/$(LLVM_VERSION)/include/omp*.h
1995
1996 # Remove some libc++ abi files in the libc++ file. See bug #969274
1997 rm -f debian/libc++-$(LLVM_VERSION)-dev/$(LLVM_DIR)/include/c++/__cxxabi_config.h debian/libc++-$(LLVM_VERSION)-dev/$(LLVM_DIR)/include/c++/cxxabi.h
1998
1999 # Remove auto generated python pyc
2000 find debian/llvm-$(LLVM_VERSION)-tools/$(LLVM_DIR)/ -name '*.pyc' | xargs -r rm -f
2001
2002 # Test rules (override_dh_auto_test).
2003 include debian/tests.mk
2004
2005
2006 override_dh_builddebscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_builddeb().:
2007 dh_builddebscip-debian debian debhelper . dh_builddeb(). ${skip_packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/skip_packages.}
2008
2009 override_dh_gencontrolscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_gencontrol().: stamps/sccache-stats
2010 dh_gencontrolscip-debian debian debhelper . dh_gencontrol(). ${skip_packagesscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/skip_packages.} -- $(control_varsscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/control_vars.)
2011
2012 override_dh_auto_cleanscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/override_dh_auto_clean().:
2013 rm -rf $(TARGET_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/TARGET_BUILD.) llvm/docs/_build/ clang/docs/_build tools/clang/docs/_html/
2014 # QA tools
2015 rm -rf cov-int/ reports/
2016 find utils -name '*.pyc' | xargs -r rm -f
2017 # Use -I because a test has a space in its name
2018 find lldb/test -iname '*.pyc' | xargs -I{} -r rm -f {}
2019 rm -f utils/vim/llvm-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.).vim utils/vim/tablegen-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.).vim
2020 rm -f clang/tools/clang-format/clang-format-diff-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)
2021 rm -f clang/tools/clang-format/clang-format-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.).py
2022 rm -rf libclc/build
2023 rm -rf build-wasm
2024 rm -rf build-mingw
2025 if test -f lld/docs/ld.lld-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.).1; then \
2026 mv lld/docs/ld.lld-$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.).1 lld/docs/ld.lld.1; \
2027 fi
2028 for f in debian/*.in; do \
2029 f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSIONscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/LLVM_VERSION.)/'); \
2030 case $$f2 in \
2031 debian/control|debian/watch|debian/packages.ocaml|debian/packages.libclc) \
2032 echo "keep $$f2";; \
2033 *) \
2034 rm -f $$f2; \
2035 esac; \
2036 done
2037 if test "$(SCAN_BUILDscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/SCAN_BUILD.)" = "yes"; then \
2038 patch -f -R -p1 < debian/patches/on-the-fly/use-scan-build-runtimes.diff||true; \
2039 fi
2040 : # for some reason, the docs are written to debian/usr and debian/man ...
2041 rm -rf debian/usr debian/man
2042 : # remove extra stamps
2043 rm -f override_dh_auto_install
2044 rm -rf stamps
2045 rm -f usage-*.svg*
2046 rm -f debian/shlibs.common debian/shlibs.local
2047
2048 .PHONYscip-debian debian llvm-toolchain-22 1:22.1.7-1 llvm-toolchain-22/rules/`.PHONY`().: override_dh_strip preconfigure