File: rules.defs

package info (click to toggle)
binutils 2.45.90.20260201-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 383,188 kB
  • sloc: ansic: 1,521,533; asm: 829,347; cpp: 216,692; exp: 80,514; makefile: 73,160; sh: 25,606; yacc: 15,060; lisp: 13,632; perl: 13,404; lex: 1,714; ada: 1,681; python: 1,520; pascal: 1,446; cs: 879; java: 478; sed: 191; xml: 95; awk: 25
file content (236 lines) | stat: -rw-r--r-- 8,857 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# these macros are also used for binutils & gcc combined builds
# these must not conflict with definitions in the gcc packaging

# GCC must use: BINUTILS_GCCCONF BINUTILS_GCCENV

# macros that have to be defined before inclusion:
# DEB_HOST_ARCH, BASE_VERSION (GCC)

# only used in the GCC sources
bd_binutils_only = file, help2man, libjansson-dev,

# Map a Debian architecture alias to a GNU type or a multiarch path component.
run_dpkg_arch = $(or $(dpkg_arch_$1),$(eval \
  dpkg_arch_$1 := $(shell dpkg-architecture -f -a$1))$(dpkg_arch_$1))
_gnu_type  = $(call vafilt,$(run_dpkg_arch),DEB_HOST_GNU_TYPE)
_multiarch = $(call vafilt,$(run_dpkg_arch),DEB_HOST_MULTIARCH)

gprofng_archs = amd64 i386 arm64 x32 riscv64

ifneq (,$(filter $(DEB_HOST_ARCH), $(gprofng_archs)))
  with_gprofng = yes
  CONF_GPROFNG = --enable-gprofng
  ifeq (,$(findstring pkg.binutils.nojava, $(DEB_BUILD_PROFILES)))
    CONF_GPROFNG += --with-jdk=/usr/lib/jvm/default-java
  endif
endif

gold_targets = \
	amd64 arm64 armel armhf i386 \
	powerpc ppc64 ppc64el sparc sparc64 s390x \
	x32 hurd-amd64 hurd-i386
# cannot handles gnu hashstyle
#gold_targets += \
	mips mipsel mipsn32 mipsn32el mips64 mips64el \
	mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el

gold_build = deprecated

ifeq ($(gold_build),included)
  ifneq (,$(filter $(DEB_HOST_ARCH), $(gold_targets)))
    with_gold = yes
    gold_substvars = -Vgold:Provides=binutils-gold
    gold_natsubstvars =
  endif
else ifeq ($(gold_build),split)
  ifneq (,$(filter $(DEB_HOST_ARCH), $(gold_targets)))
    with_gold =
    gold_substvars = -Vgold:Depends=binutils-gold
    gold_natsubstvars = -Vgoldnat:Depends=binutils-gold-$(subst _,-,$(DEB_HOST_GNU_TYPE))
  endif
else ifeq ($(gold_build),deprecated)
  ifneq (,$(filter $(DEB_HOST_ARCH), $(gold_targets)))
    with_gold =
    gold_substvars = -Vgold:Suggests=binutils-gold
    gold_natsubstvars = -Vgoldnat:Suggests=binutils-gold-$(subst _,-,$(DEB_HOST_GNU_TYPE))
  endif
else ifeq ($(gold_build),removed)
  with_gold =
  gold_substvars =
  gold_natsubstvars =
endif

binutils_programs = addr2line ar as c++filt elfedit gprof ld ld.bfd
binutils_programs += nm objcopy objdump ranlib readelf size strings strip
ifeq ($(with_gold),yes)
  binutils_programs += gold ld.gold dwp
endif

BINUTILS_BASECONF = \
	--disable-silent-rules \
	--enable-obsolete \
	--enable-plugins \
	--enable-threads \
	--enable-jansson \
	--enable-default-hash-style=gnu \
	--enable-deterministic-archives \
	--disable-compressed-debug-sections \
	--enable-new-dtags \
	--disable-x86-used-note \
	--disable-default-execstack \
	--with-gold-ldflags=-static-libstdc++

DEB_TARGET_MULTIARCH32_amd64		= i386-linux-gnu
DEB_TARGET_MULTIARCHX32_amd64		= x86_64-linux-gnux32

DEB_TARGET_MULTIARCH32_x32		= i386-linux-gnu
DEB_TARGET_MULTIARCH64_x32		= x86_64-linux-gnu

DEB_TARGET_MULTIARCH32_powerpc		= powerpc-linux-gnu

DEB_TARGET_MULTIARCH32_s390x		= s390-linux-gnu

DEB_TARGET_MULTIARCH32_sparc64		= sparc-linux-gnu

DEB_TARGET_MULTIARCH64_i386		= x86_64-linux-gnu
DEB_TARGET_MULTIARCHX32_i386		= x86_64-linux-gnux32

DEB_TARGET_MULTIARCH64_powerpc		= powerpc64-linux-gnu

DEB_TARGET_MULTIARCH64_sparc		= sparc64-linux-gnu

DEB_TARGET_MULTIARCH64_s390		= s390x-linux-gnu

DEB_TARGET_MULTIARCH64_mips		= mips64-linux-gnuabi64
DEB_TARGET_MULTIARCHN32_mips		= mips64-linux-gnuabin32

DEB_TARGET_MULTIARCH64_mipsel		= mips64el-linux-gnuabi64
DEB_TARGET_MULTIARCHN32_mipsel		= mips64el-linux-gnuabin32

DEB_TARGET_MULTIARCH64_mipsn32		= mips64-linux-gnuabi64
DEB_TARGET_MULTIARCH32_mipsn32		= mips-linux-gnu

DEB_TARGET_MULTIARCH64_mipsn32el 	= mips64el-linux-gnuabi64
DEB_TARGET_MULTIARCH32_mipsn32el 	= mipsel-linux-gnu

DEB_TARGET_MULTIARCH32_mips64		= mips-linux-gnu
DEB_TARGET_MULTIARCHN32_mips64		= mips64-linux-gnuabin32

DEB_TARGET_MULTIARCH32_mips64el		= mipsel-linux-gnu
DEB_TARGET_MULTIARCHN32_mips64el	= mips64el-linux-gnuabin32

DEB_TARGET_MULTIARCH64_mipsr6		= mipsisa64r6-linux-gnuabi64
DEB_TARGET_MULTIARCHN32_mipsr6	= mipsisa64r6-linux-gnuabin32

DEB_TARGET_MULTIARCH64_mipsr6el	= mipsisa64r6el-linux-gnuabi64
DEB_TARGET_MULTIARCHN32_mipsr6el	= mipsisa64r6el-linux-gnuabin32

DEB_TARGET_MULTIARCH64_mipsn32r6	= mipsisa64r6-linux-gnuabi64
DEB_TARGET_MULTIARCH32_mipsn32r6	= mipsisa32r6-linux-gnu

DEB_TARGET_MULTIARCH64_mipsn32r6el 	= mipsisa64r6el-linux-gnuabi64
DEB_TARGET_MULTIARCH32_mipsn32r6el 	= mipsisa32r6el-linux-gnu

DEB_TARGET_MULTIARCH32_mips64r6		= mipsisa32r6-linux-gnu
DEB_TARGET_MULTIARCHN32_mips64r6	= mipsisa64r6-linux-gnuabin32

DEB_TARGET_MULTIARCH32_mips64r6el	= mipsisa32r6el-linux-gnu
DEB_TARGET_MULTIARCHN32_mips64r6el	= mipsisa64r6el-linux-gnuabin32

DEB_TARGET_MULTIARCH32_arm64		= aarch64_ilp32-linux-gnu

SET_BINUTILS_MULTIARCH_ENV = \
	DEB_TARGET_MULTIARCH=$(call _multiarch,$1) \
	$(if $(DEB_TARGET_MULTIARCH32_$1) ,DEB_TARGET_MULTIARCH32=$(DEB_TARGET_MULTIARCH32_$1)) \
	$(if $(DEB_TARGET_MULTIARCH64_$1) ,DEB_TARGET_MULTIARCH64=$(DEB_TARGET_MULTIARCH64_$1)) \
	$(if $(DEB_TARGET_MULTIARCHX32_$1),DEB_TARGET_MULTIARCHX32=$(DEB_TARGET_MULTIARCHX32_$1)) \
	$(if $(DEB_TARGET_MULTIARCHN32_$1),DEB_TARGET_MULTIARCHN32=$(DEB_TARGET_MULTIARCHN32_$1))

# see https://bugs.debian.org/1098970,
# --enable-warn-rwx-segments not enabled on hppa, sparc, sparc64

CONFARGS_TARGET_sparc		= --enable-targets=sparc64-linux-gnu
CONFLICTS_TARGET_sparc		= -VextraConflicts="libc6-dev-sparc64 (<< 2.2.5-7)"

CONFARGS_TARGET_sparc64		= --enable-targets=sparc-linux-gnu
CONFLICTS_TARGET_sparc64	= -VextraConflicts="libc6-dev-sparc64 (<< 2.2.5-7)"

CONFARGS_TARGET_powerpc		= --enable-targets=powerpc64-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_ppc64		= --enable-targets=powerpc-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_ppc64el		= --enable-targets=powerpc-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_s390		= --enable-targets=s390x-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_s390x		= --enable-targets=s390-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_amd64		= --enable-targets=i686-linux-gnu,x86_64-linux-gnux32,x86_64-pep \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_i386		= --enable-targets=x86_64-linux-gnu,x86_64-linux-gnux32,x86_64-pep \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_x32		= --enable-targets=i686-linux-gnu,x86_64-linux-gnu,x86_64-pep \
				  --enable-warn-rwx-segments

CONFLICTS_TARGET_amd64		= -VextraConflicts="binutils-mingw-w64-i686 (<< 2.23.52.20130612-1+3), binutils-mingw-w64-x86-64 (<< 2.23.52.20130612-1+3)"
CONFLICTS_TARGET_i386 = $(CONFLICTS_TARGET_amd64)
CONFLICTS_TARGET_x32  = $(CONFLICTS_TARGET_amd64)

CONFARGS_TARGET_riscv64		= --with-isa-spec=2.2  --enable-warn-rwx-segments

CONFARGS_TARGET_mips		= --enable-targets=mips64-linux-gnuabi64,mips64-linux-gnuabin32 \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_mipsel		= --enable-targets=mips64el-linux-gnuabi64,mips64el-linux-gnuabin32 \
				  --enable-mips-fix-loongson3-llsc=yes --enable-warn-rwx-segments

CONFARGS_TARGET_mipsn32		= --enable-targets=mips64-linux-gnuabi64,mips-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_mipsn32el	= --enable-targets=mips64el-linux-gnuabi64,mipsel-linux-gnu \
				  --enable-mips-fix-loongson3-llsc=yes --enable-warn-rwx-segments

CONFARGS_TARGET_mips64		= --enable-targets=mips64-linux-gnuabin32,mips-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_mips64el	= --enable-targets=mips64el-linux-gnuabin32,mipsel-linux-gnu \
				  --enable-mips-fix-loongson3-llsc=yes --enable-warn-rwx-segments

CONFARGS_TARGET_mipsr6		= --enable-targets=mipsisa64r6-linux-gnuabi64,mipsisa64r6-linux-gnuabin32 \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_mipsr6el	= --enable-targets=mipsisa64r6el-linux-gnuabi64,mipsisa64r6el-linux-gnuabin32 \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_mipsn32r6	= --enable-targets=mipsisa64r6-linux-gnuabi64,mipsisa32r6-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_mipsn32r6el	= --enable-targets=mipsisa64r6el-linux-gnuabi64,mipsisa32r6el-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_mips64r6	= --enable-targets=mipsisa64r6-linux-gnuabin32,mipsisa32r6-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_mips64r6el	= --enable-targets=mipsisa64r6el-linux-gnuabin32,mipsisa32r6el-linux-gnu \
				  --enable-warn-rwx-segments

CONFARGS_TARGET_aarch64		= --enable-targets=aarch64_be-linux-gnu --enable-warn-rwx-segments

CONFARGS_TARGET_arc		= --with-cpu=hs38_linux --enable-warn-rwx-segments

CONFARGS_TARGET_hppa		= --enable-targets=hppa64-linux-gnu

BINUTILS_GCCCONF = $(BINUTILS_BASECONF) $(CONFARGS_TARGET_$(DEB_HOST_ARCH))
ifeq ($(with_gold),yes)
  BINUTILS_GCCCONF += --enable-ld=default --enable-gold
endif
BINUTILS_GCCCONF += $(CONF_GPROFNG)

BINUTILS_GCCENV = BFD_SOVER_EXT=-tc$(BASE_VERSION) CTF_SOVER_EXT=-tc$(BASE_VERSION)