1
ifeq ($(with_libgcc),yes)
2
$(lib_binaries) += libgcc
4
ifeq ($(with_lib64gcc),yes)
5
$(lib_binaries) += lib64gcc
7
ifeq ($(with_lib32gcc),yes)
8
$(lib_binaries) += lib32gcc
10
ifeq ($(with_libn32gcc),yes)
11
$(lib_binaries) += libn32gcc
13
ifeq ($(with_libx32gcc),yes)
14
$(lib_binaries) += libx32gcc
16
ifeq ($(with_libhfgcc),yes)
17
$(lib_binaries) += libhfgcc
19
ifeq ($(with_libsfgcc),yes)
20
$(lib_binaries) += libsfgcc
23
ifneq ($(DEB_STAGE),rtlibs)
24
ifeq ($(with_cdev),yes)
25
$(lib_binaries) += libgcc-dev
27
ifeq ($(with_lib64gccdev),yes)
28
$(lib_binaries) += lib64gcc-dev
30
ifeq ($(with_lib32gccdev),yes)
31
$(lib_binaries) += lib32gcc-dev
33
ifeq ($(with_libn32gccdev),yes)
34
$(lib_binaries) += libn32gcc-dev
36
ifeq ($(with_libx32gccdev),yes)
37
$(lib_binaries) += libx32gcc-dev
39
ifeq ($(with_libhfgccdev),yes)
40
$(lib_binaries) += libhfgcc-dev
42
ifeq ($(with_libsfgccdev),yes)
43
$(lib_binaries) += libsfgcc-dev
48
$(gcc_lib_dir)/include/std*.h \
50
README features.h arm_neon.h loongson.h \
51
{cpuid,decfloat,float,iso646,limits,mm3dnow,mm_malloc}.h \
52
{ppu_intrinsics,paired,spu2vmx,vec_types,si2vmx}.h \
53
{,a,b,e,i,n,p,s,t,w,x}mmintrin.h mmintrin-common.h \
54
{abm,adx,avx,avx2,bmi,bmi2,f16c,fma,fma4,fxsr,ia32,}intrin.h \
55
{lwp,lzcnt,popcnt,prfchw,rdseed,rtm,tbm,x86,xop,xsave{,opt},xtest,}intrin.h \
56
{htm,htmxl,mwaitx,sha}intrin.h \
57
avx512{bw,er,cd,dq,f,ifma,ifmavl,pf,vlbw,vbmi,vldq,vbmivl,vl}intrin.h \
58
{clflushopt,clwb,pcommit,xsavec,xsaves}intrin.h \
59
{arm_acle,unwind-arm-common,s390intrin}.h \
60
{cross-stdarg,syslimits,unwind,varargs}.h; \
62
test -e $(d)/$(gcc_lib_dir)/include/$$h \
63
&& echo $(gcc_lib_dir)/include/$$h; \
64
test -e $(d)/$(gcc_lib_dir)/include-fixed/$$h \
65
&& echo $(gcc_lib_dir)/include-fixed/$$h; \
68
asm bits cilk gnu linux sanitizer $(TARGET_ALIAS) \
69
$(subst $(DEB_TARGET_GNU_CPU),$(biarch_cpu),$(TARGET_ALIAS)); \
71
test -e $(d)/$(gcc_lib_dir)/include/$$d \
72
&& echo $(gcc_lib_dir)/include/$$d; \
73
test -e $(d)/$(gcc_lib_dir)/include-fixed/$$d \
74
&& echo $(gcc_lib_dir)/include-fixed/$$d; \
77
ifeq ($(with_libssp),yes)
78
header_files += $(gcc_lib_dir)/include/ssp
80
ifeq ($(with_gomp),yes)
81
header_files += $(gcc_lib_dir)/include/{omp,openacc}.h
83
ifeq ($(with_qmath),yes)
84
header_files += $(gcc_lib_dir)/include/quadmath{,_weak}.h
87
ifeq ($(DEB_TARGET_ARCH),ia64)
88
header_files += $(gcc_lib_dir)/include/ia64intrin.h
91
ifeq ($(DEB_TARGET_ARCH),m68k)
92
header_files += $(gcc_lib_dir)/include/math-68881.h
95
ifeq ($(DEB_TARGET_ARCH),$(findstring $(DEB_TARGET_ARCH),powerpc ppc64 ppc64el powerpcspe))
96
header_files += $(gcc_lib_dir)/include/{altivec.h,ppc-asm.h,spe.h}
99
p_lgcc = libgcc$(GCC_SONAME)$(cross_lib_arch)
100
p_lgccdbg = libgcc$(GCC_SONAME)-dbg$(cross_lib_arch)
101
p_lgccdev = libgcc-$(BASE_VERSION)-dev$(cross_lib_arch)
102
d_lgcc = debian/$(p_lgcc)
103
d_lgccdbg = debian/$(p_lgccdbg)
104
d_lgccdev = debian/$(p_lgccdev)
106
p_l32gcc = lib32gcc$(GCC_SONAME)$(cross_lib_arch)
107
p_l32gccdbg = lib32gcc$(GCC_SONAME)-dbg$(cross_lib_arch)
108
p_l32gccdev = lib32gcc-$(BASE_VERSION)-dev$(cross_lib_arch)
109
d_l32gcc = debian/$(p_l32gcc)
110
d_l32gccdbg = debian/$(p_l32gccdbg)
111
d_l32gccdev = debian/$(p_l32gccdev)
113
p_l64gcc = lib64gcc$(GCC_SONAME)$(cross_lib_arch)
114
p_l64gccdbg = lib64gcc$(GCC_SONAME)-dbg$(cross_lib_arch)
115
p_l64gccdev = lib64gcc-$(BASE_VERSION)-dev$(cross_lib_arch)
116
d_l64gcc = debian/$(p_l64gcc)
117
d_l64gccdbg = debian/$(p_l64gccdbg)
118
d_l64gccdev = debian/$(p_l64gccdev)
120
p_ln32gcc = libn32gcc$(GCC_SONAME)$(cross_lib_arch)
121
p_ln32gccdbg = libn32gcc$(GCC_SONAME)-dbg$(cross_lib_arch)
122
p_ln32gccdev = libn32gcc-$(BASE_VERSION)-dev$(cross_lib_arch)
123
d_ln32gcc = debian/$(p_ln32gcc)
124
d_ln32gccdbg = debian/$(p_ln32gccdbg)
125
d_ln32gccdev = debian/$(p_ln32gccdev)
127
p_lx32gcc = libx32gcc$(GCC_SONAME)$(cross_lib_arch)
128
p_lx32gccdbg = libx32gcc$(GCC_SONAME)-dbg$(cross_lib_arch)
129
p_lx32gccdev = libx32gcc-$(BASE_VERSION)-dev$(cross_lib_arch)
130
d_lx32gcc = debian/$(p_lx32gcc)
131
d_lx32gccdbg = debian/$(p_lx32gccdbg)
132
d_lx32gccdev = debian/$(p_lx32gccdev)
134
p_lhfgcc = libhfgcc$(GCC_SONAME)$(cross_lib_arch)
135
p_lhfgccdbg = libhfgcc$(GCC_SONAME)-dbg$(cross_lib_arch)
136
p_lhfgccdev = libhfgcc-$(BASE_VERSION)-dev$(cross_lib_arch)
137
d_lhfgcc = debian/$(p_lhfgcc)
138
d_lhfgccdbg = debian/$(p_lhfgccdbg)
139
d_lhfgccdev = debian/$(p_lhfgccdev)
141
p_lsfgcc = libsfgcc$(GCC_SONAME)$(cross_lib_arch)
142
p_lsfgccdbg = libsfgcc$(GCC_SONAME)-dbg$(cross_lib_arch)
143
p_lsfgccdev = libsfgcc-$(BASE_VERSION)-dev$(cross_lib_arch)
144
d_lsfgcc = debian/$(p_lsfgcc)
145
d_lsfgccdbg = debian/$(p_lsfgccdbg)
146
d_lsfgccdev = debian/$(p_lsfgccdev)
148
# __do_gcc_devels(flavour,package,todir,fromdir)
149
define __do_gcc_devels
152
mv $(install_stamp) $(install_stamp)-tmp
156
dh_installdirs -p$(2) $(docdir) #TODO
157
dh_installdirs -p$(2) $(3)
159
$(call __do_gcc_devels2,$(1),$(2),$(3),$(4))
161
debian/dh_doclink -p$(2) $(p_lbase)
162
debian/dh_rmemptydirs -p$(2)
166
$(cross_shlibdeps) dh_shlibdeps -p$(2)
167
$(call cross_mangle_substvars,$(2))
170
$(cross_gencontrol) dh_gencontrol -p$(2) -- -v$(DEB_VERSION) $(common_substvars)
171
$(call cross_mangle_control,$(2))
175
trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
178
# __do_gcc_devels2(flavour,package,todir,fromdir)
179
define __do_gcc_devels2
180
# stage1 builds static libgcc only
181
$(if $(filter $(DEB_STAGE),stage1),,
182
: # libgcc_s.so may be a linker script on some architectures
184
if [ -h $(4)/libgcc_s.so ]; then \
185
rm -f $(4)/libgcc_s.so; \
186
dh_link -p$(2) /$(libgcc_dir$(1))/libgcc_s.so.$(GCC_SONAME) \
189
mv $(4)/libgcc_s.so $(d)/$(3)/libgcc_s.so; \
190
dh_link -p$(2) /$(libgcc_dir$(1))/libgcc_s.so.$(GCC_SONAME) \
191
/$(3)/libgcc_s.so.$(GCC_SONAME); \
193
$(if $(1), dh_link -p$(2) /$(3)/libgcc_s.so \
194
/$(gcc_lib_dir)/libgcc_s_$(1).so;)
196
$(dh_compat2) dh_movefiles -p$(2) \
197
$(3)/{libgcc*,libgcov.a,*.o} \
198
$(if $(1),,$(header_files)) # Only move headers for the "main" package
200
: # libbacktrace not installed by default
201
$(if $(filter yes, $(with_backtrace)),
202
if [ -f $(buildlibdir)/$(1)/libbacktrace/.libs/libbacktrace.a ]; then \
203
install -m644 $(buildlibdir)/$(1)/libbacktrace/.libs/libbacktrace.a \
204
debian/$(2)/$(gcc_lib_dir)/$(1); \
207
if [ -f $(buildlibdir)/libbacktrace/backtrace-supported.h ]; then \
208
install -m644 $(buildlibdir)/libbacktrace/backtrace-supported.h \
209
debian/$(2)/$(gcc_lib_dir)/include/; \
210
install -m644 $(srcdir)/libbacktrace/backtrace.h \
211
debian/$(2)/$(gcc_lib_dir)/include/; \
215
: # If building a flavour, add a lintian override
217
#TODO: use a file instead of a hacky echo
218
# bu do we want to use one override file (in the source package) per
219
# flavour or not since they are essentially the same?
220
mkdir -p debian/$(2)/usr/share/lintian/overrides
221
echo "$(2) binary: binary-from-other-architecture" \
222
>> debian/$(2)/usr/share/lintian/overrides/$(2)
224
$(if $(filter yes, $(with_lib$(1)gmath)),
225
$(call install_gcc_lib,libgcc-math,$(GCC_SONAME),$(1),$(2))
227
$(if $(filter yes, $(with_libssp)),
228
$(call install_gcc_lib,libssp,$(SSP_SONAME),$(1),$(2))
230
$(if $(filter yes, $(with_ssp)),
231
mv $(4)/libssp_nonshared.a debian/$(2)/$(3)/;
233
$(if $(filter yes, $(with_gomp)),
234
$(call install_gcc_lib,libgomp,$(GOMP_SONAME),$(1),$(2))
236
$(if $(filter yes, $(with_itm)),
237
$(call install_gcc_lib,libitm,$(ITM_SONAME),$(1),$(2))
239
$(if $(filter yes, $(with_atomic)),
240
$(call install_gcc_lib,libatomic,$(ATOMIC_SONAME),$(1),$(2))
242
$(if $(filter yes, $(with_asan)),
243
$(call install_gcc_lib,libasan,$(ASAN_SONAME),$(1),$(2))
244
mv $(4)/libasan_preinit.o debian/$(2)/$(3)/;
246
$(if $(1),,$(if $(filter yes, $(with_lsan)),
247
$(call install_gcc_lib,liblsan,$(LSAN_SONAME),$(1),$(2))
249
$(if $(1),,$(if $(filter yes, $(with_tsan)),
250
$(call install_gcc_lib,libtsan,$(TSAN_SONAME),$(1),$(2))
252
$(if $(filter yes, $(with_ubsan)),
253
$(call install_gcc_lib,libubsan,$(UBSAN_SONAME),$(1),$(2))
255
$(if $(filter yes, $(with_vtv)),
256
$(call install_gcc_lib,libvtv,$(VTV_SONAME),$(1),$(2))
258
$(if $(filter yes, $(with_cilkrts)),
259
$(call install_gcc_lib,libcilkrts,$(CILKRTS_SONAME),$(1),$(2))
261
$(if $(filter yes, $(with_mpx)),
262
$(if $(filter x32, $(1)),,
263
$(call install_gcc_lib,libmpxwrappers,$(MPX_SONAME),$(1),$(2))
264
$(call install_gcc_lib,libmpx,$(MPX_SONAME),$(1),$(2))
267
$(if $(filter yes, $(with_qmath)),
268
$(call install_gcc_lib,libquadmath,$(QMATH_SONAME),$(1),$(2))
272
# do_gcc_devels(flavour)
274
$(call __do_gcc_devels,$(1),$(p_l$(1)gccdev),$(gcc_lib_dir$(1)),$(d)/$(usr_lib$(1)))
281
mv $(install_stamp) $(install_stamp)-tmp
285
dh_installdirs -p$(p_l) \
289
$(if $(filter yes,$(with_shared_libgcc)),
290
mv $(d)/$(usr_lib$(2))/libgcc_s.so.$(GCC_SONAME) \
291
$(d_l)/$(libgcc_dir$(2))/.
294
debian/dh_doclink -p$(p_l) $(if $(3),$(3),$(p_lbase))
295
debian/dh_doclink -p$(p_d) $(if $(3),$(3),$(p_lbase))
296
debian/dh_rmemptydirs -p$(p_l)
297
debian/dh_rmemptydirs -p$(p_d)
298
dh_strip -p$(p_l) --dbg-package=$(p_d)
300
# see Debian #533843 for the __aeabi symbol handling; this construct is
301
# just to include the symbols for dpkg versions older than 1.15.3 which
302
# didn't allow bypassing the symbol blacklist
303
$(if $(filter yes,$(with_shared_libgcc)),
304
$(cross_makeshlibs) dh_makeshlibs -p$(p_l) -p$(p_d) \
305
-- -v$(DEB_LIBGCC_VERSION)
306
$(call cross_mangle_shlibs,$(p_l))
307
$(if $(filter arm-linux-gnueabi%,$(DEB_TARGET_GNU_TYPE)),
308
if head -1 $(d_l)/DEBIAN/symbols 2>/dev/null | grep -q '^lib'; then \
309
grep -q '^ __aeabi' $(d_l)/DEBIAN/symbols \
310
|| cat debian/libgcc1.symbols.aeabi \
311
>> $(d_l)/DEBIAN/symbols; \
317
$(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
318
$(call shlibdirs_to_search,,$(2))
320
$(call cross_mangle_substvars,$(p_l))
322
$(if $(2),, # only for native
323
mkdir -p $(d_l)/usr/share/lintian/overrides
324
echo '$(p_l): package-name-doesnt-match-sonames' \
325
> $(d_l)/usr/share/lintian/overrides/$(p_l)
328
dh_compress -p$(p_l) -p$(p_d)
329
dh_fixperms -p$(p_l) -p$(p_d)
330
$(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
331
-- -v$(DEB_LIBGCC_VERSION) $(common_substvars)
332
$(call cross_mangle_control,$(p_l))
334
dh_installdeb -p$(p_l) -p$(p_d)
335
dh_md5sums -p$(p_l) -p$(p_d)
336
dh_builddeb -p$(p_l) -p$(p_d)
338
trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
341
do_libgcc = $(call __do_libgcc,lib$(1)gcc$(GCC_SONAME),$(1),$(2))
342
# ----------------------------------------------------------------------
344
$(binary_stamp)-libgcc: $(install_dependencies)
345
ifeq ($(with_standalone_gcj),yes)
346
$(call do_libgcc,,$(p_jbase))
351
$(binary_stamp)-lib64gcc: $(install_dependencies)
352
$(call do_libgcc,64,)
354
$(binary_stamp)-lib32gcc: $(install_dependencies)
355
$(call do_libgcc,32,)
357
$(binary_stamp)-libn32gcc: $(install_dependencies)
358
$(call do_libgcc,n32,)
360
$(binary_stamp)-libx32gcc: $(install_dependencies)
361
$(call do_libgcc,x32,)
363
$(binary_stamp)-libhfgcc: $(install_dependencies)
366
$(binary_stamp)-libsfgcc: $(install_dependencies)
369
$(binary_stamp)-libgcc-dev: $(install_dependencies)
370
$(call do_gcc_devels,)
372
$(binary_stamp)-lib64gcc-dev: $(install_dependencies)
373
$(call do_gcc_devels,64)
375
$(binary_stamp)-lib32gcc-dev: $(install_dependencies)
376
$(call do_gcc_devels,32)
378
$(binary_stamp)-libn32gcc-dev: $(install_dependencies)
379
$(call do_gcc_devels,n32)
381
$(binary_stamp)-libx32gcc-dev: $(install_dependencies)
382
$(call do_gcc_devels,x32)
384
$(binary_stamp)-libhfgcc-dev: $(install_dependencies)
385
$(call do_gcc_devels,hf)
387
$(binary_stamp)-libsfgcc-dev: $(install_dependencies)
388
$(call do_gcc_devels,sf)