diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-22 13:22:52 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-23 16:20:14 +0100 |
commit | ae8e3b65755d3941f50bd96d4b5d878e901f08d0 (patch) | |
tree | 760262038bf2f74cafc34853808bb6ed9d5b25a3 | |
parent | 9f67e31ab2ad0a67b0a66f2d2de182cc92bdb8d4 (diff) | |
download | poky-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>
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.8.inc | 2 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.8/0043-cpp.patch | 40 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch | 97 |
3 files changed, 139 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.8.inc b/meta/recipes-devtools/gcc/gcc-4.8.inc index 9d92edabc3..e66bdaf28c 100644 --- a/meta/recipes-devtools/gcc/gcc-4.8.inc +++ b/meta/recipes-devtools/gcc/gcc-4.8.inc | |||
@@ -72,6 +72,8 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \ | |||
72 | file://0040-fix-g++-sysroot.patch \ | 72 | file://0040-fix-g++-sysroot.patch \ |
73 | file://0041-libtool-avoid-libdir.patch \ | 73 | file://0041-libtool-avoid-libdir.patch \ |
74 | file://0042-pr57748.patch \ | 74 | file://0042-pr57748.patch \ |
75 | file://0043-cpp.patch \ | ||
76 | file://0044-gengtypes.patch \ | ||
75 | " | 77 | " |
76 | SRC_URI[md5sum] = "3b2386c114cd74185aa3754b58a79304" | 78 | SRC_URI[md5sum] = "3b2386c114cd74185aa3754b58a79304" |
77 | SRC_URI[sha256sum] = "545b44be3ad9f2c4e90e6880f5c9d4f0a8f0e5f67e1ffb0d45da9fa01bb05813" | 79 | SRC_URI[sha256sum] = "545b44be3ad9f2c4e90e6880f5c9d4f0a8f0e5f67e1ffb0d45da9fa01bb05813" |
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 @@ | |||
1 | The OE environment sets and exports CPP as being the target gcc. When building | ||
2 | gcc-cross-canadian for a mingw targetted sdk, the following can be found in | ||
3 | build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log: | ||
4 | |||
5 | configure:3641: checking for _FILE_OFFSET_BITS value needed for large files | ||
6 | configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5 | ||
7 | configure:3666: $? = 0 | ||
8 | configure:3698: result: no | ||
9 | configure:3786: checking how to run the C preprocessor | ||
10 | configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 | ||
11 | configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c | ||
12 | configure:3876: $? = 0 | ||
13 | |||
14 | Note this is a *build* target (in build-x86_64-linux) so it should be using | ||
15 | the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32 headers are | ||
16 | very different, using the wrong cpp is a real problem. It is leaking into | ||
17 | configure through the CPP variable. Ultimately this leads to build failures | ||
18 | related to not being able to include a process.h file for pem-unix.c. | ||
19 | |||
20 | The fix is to ensure we export a sane CPP value into the build environment when | ||
21 | using build targets. We could define a CPP_FOR_BUILD value which may be the version | ||
22 | which needs to be upstreamed but for now, this fix is good enough to avoid the | ||
23 | problem. | ||
24 | |||
25 | RP 22/08/2013 | ||
26 | |||
27 | Upstream-Status: Pending | ||
28 | |||
29 | Index: 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 @@ | |||
1 | gengtype is generated for both the build system and the target. -DGENERATOR_FILE | ||
2 | was added in the patch http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00273.html | ||
3 | and was applied to both versions of gengtype. | ||
4 | |||
5 | Unfortunately the presence of this flag triggers the build configuration (bconfig.h) | ||
6 | to be included for the target build of gengtype. Compiling gengtype with the target | ||
7 | compiler and bconfig.h can result in errors if the build and target systems are | ||
8 | dissimilar. An example case this fails is cross compiling gcc on linux for a darwin | ||
9 | target system: | ||
10 | |||
11 | In 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 | |||
16 | which occurs since auto-build.h and auto-host.h have differnet values of | ||
17 | HAVE_FPUTC_UNLOCKED: | ||
18 | |||
19 | #define HAVE_FPUTC_UNLOCKED 1 | ||
20 | /* #undef HAVE_FPUTS_UNLOCKED */ | ||
21 | |||
22 | The obvious fix is to only include the flag on build/ targets which this patch does, however | ||
23 | this also leads to compile errors due to const_tree being undefined but used in double_int.h | ||
24 | |||
25 | I added a GENERATOR_FILE2 flag to workaround those in the | ||
26 | target case and allow the build to succeed. | ||
27 | |||
28 | Only the build/gengtypes should have the -DGENERATOR_FILE | ||
29 | |||
30 | RP 22/8/2013 | ||
31 | |||
32 | Upstream-Status: Pending | ||
33 | |||
34 | Index: 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 | } | ||
81 | Index: 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 */ | ||