~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/ff/ff7486e74dea0530acbc0a80b8f2ded27c33c24d.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- makefile -*-
 
2
# rules to patch the unpacked files in the source directory
 
3
# ---------------------------------------------------------------------------
 
4
# various rules to unpack addons and (un)apply patches.
 
5
#       - patch / apply-patches
 
6
#       - unpatch / reverse-patches
 
7
 
 
8
.NOTPARALLEL:
 
9
 
 
10
patchdir        ?= debian/patches
 
11
series_file     ?= $(patchdir)/series
 
12
 
 
13
# which patches should be applied?
 
14
 
 
15
debian_patches = \
 
16
        svn-updates
 
17
 
 
18
#       $(if $(with_linaro_branch),gcc-linaro) \
 
19
#       svn-updates$(if $(with_linaro_branch),-linaro) \
 
20
 
 
21
ifeq ($(with_java),yes)
 
22
#  debian_patches += \
 
23
#       svn-class-updates
 
24
endif
 
25
 
 
26
ifneq ($(GFDL_INVARIANT_FREE),yes)
 
27
  debian_patches += \
 
28
        rename-info-files \
 
29
 
 
30
#       $(if $(with_linaro_branch),gcc-linaro-doc) \
 
31
#       $(if $(with_linaro_branch),,svn-doc-updates) \
 
32
 
 
33
else
 
34
endif
 
35
debian_patches += \
 
36
        gcc-gfdl-build
 
37
 
 
38
#       boehm-gc-nocheck: seems to work on the buildds \
 
39
 
 
40
debian_patches += \
 
41
        gcc-textdomain \
 
42
        gcc-driver-extra-langs
 
43
 
 
44
ifeq ($(distribution),Ubuntu)
 
45
  ifneq (,$(filter $(distrelease),dapper hardy intrepid jaunty karmic lucid))
 
46
    debian_patches += gcc-hash-style-both
 
47
  else
 
48
    debian_patches += gcc-hash-style-gnu
 
49
  endif
 
50
else
 
51
  debian_patches += gcc-hash-style-both
 
52
endif
 
53
 
 
54
debian_patches += \
 
55
        libstdc++-pic \
 
56
        libstdc++-doclink \
 
57
        libstdc++-man-3cxx \
 
58
        libstdc++-test-installed \
 
59
        libjava-stacktrace \
 
60
        libjava-jnipath \
 
61
        libjava-sjlj \
 
62
        libjava-disable-plugin \
 
63
        alpha-no-ev4-directive \
 
64
        boehm-gc-getnprocs \
 
65
        note-gnu-stack \
 
66
        libgomp-omp_h-multilib \
 
67
        sparc-force-cpu \
 
68
        pr24619 \
 
69
        gccgo-version \
 
70
        pr47818 \
 
71
        pr49940 \
 
72
        pr49944 \
 
73
        gcc-base-version \
 
74
        mudflapth-link \
 
75
        libmudflap-x32 \
 
76
        libgo-testsuite \
 
77
        gcc-target-include-asm \
 
78
        libgo-revert-timeout-exp \
 
79
        arm-sanitizer \
 
80
 
 
81
#       $(if $(filter yes, $(DEB_CROSS)),,gcc-print-file-name) \
 
82
#       libstdc++-nothumb-check \
 
83
# TODO: update ...
 
84
#       gcc-cloog-dl \
 
85
#       libjava-rpath \
 
86
 
 
87
hardening_patches =
 
88
ifneq ($(distribution),Debian)
 
89
  ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
 
90
    # FIXME: bootstrap failure building the target libstdc++ library
 
91
    #hardening_patches += gcc-default-format-security
 
92
    hardening_patches += \
 
93
        gcc-default-fortify-source \
 
94
        gcc-default-relro \
 
95
        testsuite-hardening-format \
 
96
        testsuite-hardening-printf-types
 
97
  endif
 
98
endif
 
99
ifeq ($(with_ssp)-$(with_ssp_default),yes-yes)
 
100
  hardening_patches += gcc-default-ssp
 
101
endif
 
102
 
 
103
# FIXME 4.5: Drop and adjust symbols files
 
104
ifneq (,$(findstring 4.4, $(PKGSOURCE)))
 
105
  debian_patches += pr39491
 
106
endif
 
107
 
 
108
ifeq ($(with_ada),yes)
 
109
  debian_patches += \
 
110
        ada-driver-check \
 
111
        ada-gcc-name \
 
112
        ada-default-project-path \
 
113
        ada-symbolic-tracebacks \
 
114
        ada-library-project-files-soname
 
115
 
 
116
  ifeq ($(biarch64),yes)
 
117
    debian_patches += \
 
118
        ada-nobiarch-check
 
119
  endif
 
120
 
 
121
  ifeq ($(with_libgnat),yes)
 
122
    debian_patches += \
 
123
        ada-link-lib \
 
124
        ada-libgnatvsn \
 
125
        ada-libgnatprj \
 
126
        ada-acats
 
127
    ifeq ($(with_gnat_zcx)-$(with_gnat_sjlj),yes-yes)
 
128
      debian_patches += \
 
129
        ada-sjlj
 
130
    endif
 
131
  endif
 
132
 
 
133
  ifneq (,$(findstring $(DEB_TARGET_ARCH_OS),kfreebsd hurd))
 
134
    debian_patches += ada-kfreebsd-gnu \
 
135
        ada-bug564232
 
136
  endif
 
137
 
 
138
  ifeq ($(DEB_TARGET_ARCH_OS),hurd)
 
139
    debian_patches += \
 
140
        gcc_ada_gcc-interface_Makefile.in \
 
141
        ada-s-osinte-gnu.adb \
 
142
        ada-s-osinte-gnu.ads \
 
143
        ada-s-taprop-gnu.adb
 
144
  endif
 
145
 
 
146
endif
 
147
 
 
148
ifeq ($(with_d),yes)
 
149
  debian_patches += \
 
150
        gdc-4.8 \
 
151
        gdc-versym-cpu \
 
152
        gdc-versym-os
 
153
#       gdc-doc \
 
154
 
 
155
  ifeq ($(with_libphobos),yes)
 
156
    debian_patches += gdc-libphobos-build
 
157
  else
 
158
    debian_patches += gdc-driver-nophobos
 
159
  endif
 
160
 
 
161
else
 
162
  debian_patches += gcc-d-lang
 
163
endif
 
164
 
 
165
ifeq ($(DEB_TARGET_ARCH),alpha)
 
166
  debian_patches += alpha-ieee mudflap-nocheck
 
167
  ifneq ($(GFDL_INVARIANT_FREE),yes)
 
168
    debian_patches += alpha-ieee-doc
 
169
  endif
 
170
endif
 
171
 
 
172
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm armel armhf))
 
173
  debian_patches += libjava-armel-unwind
 
174
endif
 
175
 
 
176
ifeq ($(DEB_TARGET_ARCH),armhf)
 
177
 debian_patches += gcj-arm-mode
 
178
else ifeq ($(DEB_TARGET_ARCH),armel)
 
179
  ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
 
180
    debian_patches += gcj-arm-mode
 
181
  endif
 
182
endif
 
183
 
 
184
ifeq ($(DEB_TARGET_ARCH),m68k)
 
185
  debian_patches +=
 
186
endif
 
187
 
 
188
ifeq ($(DEB_TARGET_ARCH),powerpcspe)
 
189
  debian_patches += powerpc_remove_many
 
190
  debian_patches += powerpc_nofprs
 
191
endif
 
192
 
 
193
ifeq ($(DEB_TARGET_ARCH),ppc64)
 
194
  ifeq ($(distribution),Ubuntu)
 
195
    #debian_patches += ibm-branch
 
196
  endif
 
197
endif
 
198
 
 
199
spu_patches = cross-install-location
 
200
 
 
201
#debian_patches += link-libs
 
202
 
 
203
# all patches below this line are applied for gcc-snapshot builds as well
 
204
 
 
205
ifeq ($(single_package),yes)
 
206
  spu_patches =
 
207
  debian_patches =
 
208
endif
 
209
 
 
210
debian_patches += gcc-sysroot
 
211
debian_patches += \
 
212
        ada-kfreebsd \
 
213
 
 
214
ifeq ($(with_softfloat),yes)
 
215
  debian_patches += arm-multilib-soft-float
 
216
else ifeq ($(multilib),yes)
 
217
  ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
 
218
    debian_patches += arm-multilib-softfp
 
219
  else
 
220
    debian_patches += arm-multilib-soft
 
221
  endif
 
222
endif
 
223
debian_patches += arm-multilib-defaults
 
224
 
 
225
ifeq ($(DEB_CROSS),yes)
 
226
  debian_patches += cross-fixes
 
227
  ifeq ($(with_deps_on_target_arch_pkgs),yes)
 
228
    debian_patches += cross-ma-install-location
 
229
  else
 
230
    debian_patches += cross-install-location
 
231
    spu_patches := $(filter-out cross-install-location,$(spu_patches))
 
232
  endif
 
233
endif
 
234
 
 
235
ifeq ($(DEB_TARGET_ARCH_OS),hurd)
 
236
  debian_patches += hurd-changes
 
237
endif
 
238
 
 
239
debian_patches += gcc-ice-hack gcc-ice-apport
 
240
#FIXME
 
241
#debian_patches += gold-and-ld
 
242
 
 
243
debian_patches += libjava-fixed-symlinks
 
244
debian_patches += libstdc++-arm-wno-abi
 
245
 
 
246
ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel))
 
247
  # timeouts on the buildd's, Debian
 
248
  debian_patches += libstdc++-no-testsuite
 
249
else ifeq ($(distribution),Ubuntu)
 
250
  # timeouts on the buildd's, Ubuntu only
 
251
  ifneq (,$(filter $(DEB_TARGET_ARCH), armel ia64))
 
252
    debian_patches += libstdc++-no-testsuite
 
253
  endif
 
254
endif
 
255
debian_patches += ada-mips
 
256
debian_patches += libffi-ro-eh_frame_sect
 
257
 
 
258
debian_patches += gcc-multiarch
 
259
ifeq ($(with_multiarch_lib),yes)
 
260
  ifneq ($(single_package),yes)
 
261
    debian_patches += libjava-multiarch
 
262
  endif
 
263
endif
 
264
debian_patches += libjava-nobiarch-check
 
265
debian_patches += config-ml
 
266
ifneq ($(single_package),yes)
 
267
  ifeq ($(with_multiarch_cxxheaders),yes)
 
268
    debian_patches += g++-multiarch-incdir
 
269
  endif
 
270
endif
 
271
ifeq ($(DEB_CROSS),yes)
 
272
  debian_patches += cross-no-locale-include
 
273
endif
 
274
ifeq ($(biarch64),yes)
 
275
  ifeq ($(DEB_CROSS),yes)
 
276
    debian_patches += cross-biarch
 
277
  endif
 
278
endif
 
279
debian_patches += gcc-multilib-multiarch
 
280
 
 
281
ifeq (,$(filter $(distrelease),lenny squeeze wheezy sid experimental dapper hardy intrepid jaunty karmic lucid maverick))
 
282
  debian_patches += gcc-as-needed
 
283
endif
 
284
debian_patches += mips-fix-loongson2f-nop
 
285
ifeq ($(distribution),Ubuntu)
 
286
  ifeq ($(DEB_TARGET_ARCH),ppc64)
 
287
    debian_patches += gcc-ppc64-O3
 
288
  endif
 
289
endif
 
290
debian_patches += libgomp-kfreebsd-testsuite
 
291
 
 
292
 
 
293
series_stamp = $(stampdir)/02-series-stamp
 
294
series: $(series_stamp)
 
295
$(series_stamp):
 
296
        echo $(strip $(addsuffix .diff,$(debian_patches))) \
 
297
          | sed -r 's/  +/ /g' | tr " " "\n" > $(series_file)
 
298
ifneq (,$(strip $(hardening_patches)))
 
299
  ifneq ($(trunk_build),yes)
 
300
        echo $(strip $(addsuffix .diff,$(hardening_patches))) \
 
301
          | sed -r 's/  +/ /g' | tr " " "\n" >> $(series_file)
 
302
  endif
 
303
endif
 
304
        sed -r 's/(.)$$/\1 -p1/' -i $(series_file)
 
305
        touch $@
 
306
 
 
307
autotools_files := $(addprefix ./,$(foreach file,$(shell lsdiff --no-filename \
 
308
        $(foreach patch,$(debian_patches),$(patchdir)/$(patch).diff) \
 
309
        | sed -r 's:[^/]+/src/:src/:' | sort | uniq),$(shell echo $(file) \
 
310
        | egrep 'configure\.(ac|in)|Makefile\.(am|in)|acinclude.m4')))
 
311
 
 
312
autoconf_version = 2.64
 
313
ifeq ($(trunk_build),yes)
 
314
  # The actual version depends on the build-dependencies set by
 
315
  # variable AUTO_BUILD_DEP in rules.conf.  Here, we assume the
 
316
  # correct version is installed.
 
317
  #autoconf_version =
 
318
endif
 
319
 
 
320
# FIXME: the auto* stuff is done every time for every subdir, which
 
321
# leads to build errors. Idea: record the auto* calls in the patch
 
322
# files (AUTO <dir> <auto-command with options>) and run them separately,
 
323
# maybe only once per directory).
 
324
$(patch_stamp): $(unpack_stamp) $(series_stamp)
 
325
        QUILT_PATCHES=$(patchdir) \
 
326
          quilt --quiltrc /dev/null push -a || test $$? = 2
 
327
 
 
328
ifneq (,$(filter svn-updates, $(debian_patches)))
 
329
        awk '/^EOF/ {exit} p==1 {print} /EOF$$/ {p=1}' \
 
330
          $(patchdir)/svn-updates.diff > src/LAST_UPDATED
 
331
endif
 
332
 
 
333
        if ! test -f stamps/autotools_files ; then touch stamps/autotools_files ; fi
 
334
 
 
335
        cd $(srcdir)/fixincludes && ./genfixes
 
336
 
 
337
        for f in $(autotools_files) ; \
 
338
          do case $$f in \
 
339
            */classpath/m4/acinclude.m4) \
 
340
                : ;; \
 
341
            */configure.*|*/acinclude.m4) \
 
342
                if grep ^"$$(md5sum $$f)"$$ stamps/autotools_files >/dev/null ; \
 
343
                  then echo "Skipping already regenerated file $$f." ; \
 
344
                else \
 
345
                  echo "Running autoconf$(autoconf_version) in $$(dirname $$f)..." ; \
 
346
                  dir="$(CURDIR)"; cd $(CURDIR)/$$(dirname $$f) \
 
347
                    && AUTOM4TE=/usr/bin/autom4te$(autoconf_version) autoconf$(autoconf_version) \
 
348
                    && cd $$dir \
 
349
                    && echo "$$(md5sum $$f)" >> stamps/autotools_files ; \
 
350
                fi ;; \
 
351
            */Makefile.*) ;; \
 
352
            *) echo "Unknown file: $$f"; false; \
 
353
          esac; \
 
354
        done
 
355
 
 
356
        for i in $(debian_patches); do \
 
357
          echo -e "\n$$i:" >> pxxx; \
 
358
          sed -n 's/^# *DP: */  /p' $(patchdir)/$$i.diff >> pxxx; \
 
359
        done
 
360
#       -$(srcdir)/move-if-change pxxx $@
 
361
        mv pxxx $@
 
362
 
 
363
unpatch:
 
364
        QUILT_PATCHES=$(patchdir) \
 
365
          quilt --quiltrc /dev/null pop -a -R || test $$? = 2
 
366
        rm -rf .pc
 
367
        for f in $(autotools_files); do \
 
368
          rm -f $$(echo $$f | sed -r 's/\.(ac|am|in)$$//'); \
 
369
        done
 
370
 
 
371
$(src_spu_stamp): $(patch_stamp)
 
372
        rm -rf src-spu
 
373
ifeq (,$(strip $(hardening_patches)$(spu_patches)))
 
374
        ln -s src src-spu
 
375
else
 
376
        cp -a src src-spu
 
377
endif
 
378
        set -e; \
 
379
        for p in $(hardening_patches); do \
 
380
          list="$$p $$list"; \
 
381
        done; \
 
382
        for p in $$list; do \
 
383
          echo "Revert for spu build: $$p"; \
 
384
          patch -d src-spu -p2 -R < debian/patches/$$p.diff; \
 
385
        done
 
386
        set -e; \
 
387
        for p in $(spu_patches); do \
 
388
          echo "Apply for spu build: $$p"; \
 
389
          patch -d src-spu -p2 < debian/patches/$$p.diff; \
 
390
        done
 
391
        touch $@
 
392
 
 
393
update-patches: $(series_stamp)
 
394
        export QUILT_PATCHES=$(patchdir); \
 
395
        export QUILT_REFRESH_ARGS="--no-timestamps --no-index -pab"; \
 
396
        export QUILT_DIFF_ARGS="--no-timestamps --no-index -pab"; \
 
397
        while quilt push; do quilt refresh; done
 
398
 
 
399
patch: $(patch_stamp)
 
400
.PHONY: patch series quilt autotools