~ubuntu-branches/ubuntu/trusty/gcc-snapshot/trusty

« back to all changes in this revision

Viewing changes to debian/rules.patch.r6578

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-20 22:11:07 UTC
  • Revision ID: package-import@ubuntu.com-20130120221107-ef4j9mkxm9vu5dw4
Tags: 20130120-0ubuntu2
Fix build failure on armhf.

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