~angelsl/ubuntu/wily/gcc-5/mips-cross

« back to all changes in this revision

Viewing changes to debian/rules.patch

  • Committer: angelsl
  • Date: 2015-10-30 03:30:35 UTC
  • Revision ID: angelsl-20151030033035-rmug41zm8hyjgisg
Original import

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