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

« back to all changes in this revision

Viewing changes to debian/rules.patch.r6582

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