summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.8
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-22 13:22:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-23 16:20:14 +0100
commitae8e3b65755d3941f50bd96d4b5d878e901f08d0 (patch)
tree760262038bf2f74cafc34853808bb6ed9d5b25a3 /meta/recipes-devtools/gcc/gcc-4.8
parent9f67e31ab2ad0a67b0a66f2d2de182cc92bdb8d4 (diff)
downloadpoky-ae8e3b65755d3941f50bd96d4b5d878e901f08d0.tar.gz
gcc-4.8: Add two patches to deal with cross-canadian build failures
See the patch headers for more information about the cross-canadian build failures these patches avoid. (From OE-Core rev: 2bae60b8a3cb7783c06e35a2962e56110e876957) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.8')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8/0043-cpp.patch40
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch97
2 files changed, 137 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0043-cpp.patch b/meta/recipes-devtools/gcc/gcc-4.8/0043-cpp.patch
new file mode 100644
index 0000000000..eaf8646f97
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0043-cpp.patch
@@ -0,0 +1,40 @@
1The OE environment sets and exports CPP as being the target gcc. When building
2gcc-cross-canadian for a mingw targetted sdk, the following can be found in
3build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log:
4
5configure:3641: checking for _FILE_OFFSET_BITS value needed for large files
6configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5
7configure:3666: $? = 0
8configure:3698: result: no
9configure:3786: checking how to run the C preprocessor
10configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32
11configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c
12configure:3876: $? = 0
13
14Note this is a *build* target (in build-x86_64-linux) so it should be using
15the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32 headers are
16very different, using the wrong cpp is a real problem. It is leaking into
17configure through the CPP variable. Ultimately this leads to build failures
18related to not being able to include a process.h file for pem-unix.c.
19
20The fix is to ensure we export a sane CPP value into the build environment when
21using build targets. We could define a CPP_FOR_BUILD value which may be the version
22which needs to be upstreamed but for now, this fix is good enough to avoid the
23problem.
24
25RP 22/08/2013
26
27Upstream-Status: Pending
28
29Index: gcc-4.8.1/Makefile.in
30===================================================================
31--- gcc-4.8.1.orig/Makefile.in 2013-03-30 11:25:03.000000000 +0000
32+++ gcc-4.8.1/Makefile.in 2013-08-13 12:03:17.151988882 +0000
33@@ -149,6 +149,7 @@
34 AR="$(AR_FOR_BUILD)"; export AR; \
35 AS="$(AS_FOR_BUILD)"; export AS; \
36 CC="$(CC_FOR_BUILD)"; export CC; \
37+ CPP="$(CC_FOR_BUILD) -E"; export CPP; \
38 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
39 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
40 CXX="$(CXX_FOR_BUILD)"; export CXX; \
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch b/meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch
new file mode 100644
index 0000000000..e38761d4c9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch
@@ -0,0 +1,97 @@
1gengtype is generated for both the build system and the target. -DGENERATOR_FILE
2was added in the patch http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00273.html
3and was applied to both versions of gengtype.
4
5Unfortunately the presence of this flag triggers the build configuration (bconfig.h)
6to be included for the target build of gengtype. Compiling gengtype with the target
7compiler and bconfig.h can result in errors if the build and target systems are
8dissimilar. An example case this fails is cross compiling gcc on linux for a darwin
9target system:
10
11In file included from /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c:25:0:
12| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c: In function 'void parse_error(const char*, ...)':
13| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/system.h:93:53: error: 'fputc_unlocked' was not declared in this scope
14| # define fputc(C, Stream) fputc_unlocked (C, Stream)
15
16which occurs since auto-build.h and auto-host.h have differnet values of
17HAVE_FPUTC_UNLOCKED:
18
19#define HAVE_FPUTC_UNLOCKED 1
20/* #undef HAVE_FPUTS_UNLOCKED */
21
22The obvious fix is to only include the flag on build/ targets which this patch does, however
23this also leads to compile errors due to const_tree being undefined but used in double_int.h
24
25I added a GENERATOR_FILE2 flag to workaround those in the
26target case and allow the build to succeed.
27
28Only the build/gengtypes should have the -DGENERATOR_FILE
29
30RP 22/8/2013
31
32Upstream-Status: Pending
33
34Index: gcc-4.8.1/gcc/Makefile.in
35===================================================================
36--- gcc-4.8.1.orig/gcc/Makefile.in 2013-08-19 11:40:36.844014424 +0000
37+++ gcc-4.8.1/gcc/Makefile.in 2013-08-19 11:40:37.784014402 +0000
38@@ -3903,27 +3903,29 @@
39
40 gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
41 gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H)
42-CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
43+CFLAGS-build/gengtype-lex.o += -DGENERATOR_FILE
44 build/gengtype-lex.o: $(BCONFIG_H)
45
46 gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
47 $(SYSTEM_H)
48 gengtype-parse.o: $(CONFIG_H)
49-CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
50+CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
51 build/gengtype-parse.o: $(BCONFIG_H)
52
53 gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
54 gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
55 $(XREGEX_H)
56 gengtype-state.o: $(CONFIG_H)
57-CFLAGS-gengtype-state.o += -DGENERATOR_FILE
58+CFLAGS-gengtype-state.o += -DGENERATOR_FILE2
59+CFLAGS-build/gengtype-state.o += -DGENERATOR_FILE
60 build/gengtype-state.o: $(BCONFIG_H)
61
62 gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \
63 rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
64 $(OBSTACK_H) $(XREGEX_H)
65 gengtype.o: $(CONFIG_H)
66-CFLAGS-gengtype.o += -DGENERATOR_FILE
67+CFLAGS-gengtype.o += -DGENERATOR_FILE2
68+CFLAGS-build/gengtype.o += -DGENERATOR_FILE
69 build/gengtype.o: $(BCONFIG_H)
70
71 build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
72@@ -3988,7 +3990,7 @@
73 # any system header is included.
74 gengtype-lex.c : gengtype-lex.l
75 -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \
76- echo '#include "bconfig.h"' > $@.tmp; \
77+ echo '' > $@.tmp; \
78 cat $@ >> $@.tmp; \
79 mv $@.tmp $@; \
80 }
81Index: gcc-4.8.1/gcc/double-int.h
82===================================================================
83--- gcc-4.8.1.orig/gcc/double-int.h 2013-01-30 11:04:30.000000000 +0000
84+++ gcc-4.8.1/gcc/double-int.h 2013-08-19 11:41:51.564012719 +0000
85@@ -448,10 +448,12 @@
86
87
88 #ifndef GENERATOR_FILE
89+#ifndef GENERATOR_FILE2
90 /* Conversion to and from GMP integer representations. */
91
92 void mpz_set_double_int (mpz_t, double_int, bool);
93 double_int mpz_get_double_int (const_tree, mpz_t, bool);
94 #endif
95+#endif
96
97 #endif /* DOUBLE_INT_H */