diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-01-22 14:50:00 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-29 15:36:47 +0000 |
commit | 8bef63373d605576779adef3ebd34c52f72632ef (patch) | |
tree | 9f9400723a0594e3ec1114f1a2344154ab7f645e /meta/recipes-devtools | |
parent | a3dbfc82ed6796ce2e198e50c478bc4231ca86ff (diff) | |
download | poky-8bef63373d605576779adef3ebd34c52f72632ef.tar.gz |
gcc: ensure target gcc headers can be included
There are a few headers installed as part of gcc-runtime (omp.h,
ssp/*.h). Being installed from a recipe built for the target
architecture, these are within the target sysroot and not
cross/nativesdk; thus they weren't able to be found by gcc with the
existing search paths. Add support for picking up these headers
under the sysroot supplied on the gcc command line in order to
resolve this.
Thanks to Richard Purdie for giving me a number of pointers during
fixing this issue.
Fixes [YOCTO #7141].
(From OE-Core rev: 5c87bb9ac2b35b3f8cf2b7d3e4507e7013115162)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.8.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch | 81 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.9.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.9/target-gcc-includedir.patch | 81 |
4 files changed, 164 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.8.inc b/meta/recipes-devtools/gcc/gcc-4.8.inc index 18a6692687..06e6982d93 100644 --- a/meta/recipes-devtools/gcc/gcc-4.8.inc +++ b/meta/recipes-devtools/gcc/gcc-4.8.inc | |||
@@ -73,6 +73,7 @@ SRC_URI = "\ | |||
73 | file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \ | 73 | file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \ |
74 | file://0050-PR-target-58595.patch \ | 74 | file://0050-PR-target-58595.patch \ |
75 | file://0052-PR-rtl-optimization-61801.patch \ | 75 | file://0052-PR-rtl-optimization-61801.patch \ |
76 | file://target-gcc-includedir.patch \ | ||
76 | " | 77 | " |
77 | SRC_URI[md5sum] = "a3d7d63b9cb6b6ea049469a0c4a43c9d" | 78 | SRC_URI[md5sum] = "a3d7d63b9cb6b6ea049469a0c4a43c9d" |
78 | SRC_URI[sha256sum] = "09dc2276c73424bbbfda1dbddc62bbbf900c9f185acf7f3e1d773ce2d7e3cdc8" | 79 | SRC_URI[sha256sum] = "09dc2276c73424bbbfda1dbddc62bbbf900c9f185acf7f3e1d773ce2d7e3cdc8" |
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch b/meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch new file mode 100644 index 0000000000..f48c66dcac --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | Ensure target gcc headers can be included | ||
2 | |||
3 | There are a few headers installed as part of the OpenEmbedded | ||
4 | gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe | ||
5 | built for the target architecture, these are within the target | ||
6 | sysroot and not cross/nativesdk; thus they weren't able to be | ||
7 | found by gcc with the existing search paths. Add support for | ||
8 | picking up these headers under the sysroot supplied on the gcc | ||
9 | command line in order to resolve this. | ||
10 | |||
11 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
12 | |||
13 | Upstream-Status: Pending | ||
14 | |||
15 | --- a/gcc/Makefile.in 2014-12-23 11:57:33.327873331 +0000 | ||
16 | +++ b/gcc/Makefile.in 2015-01-21 11:32:35.447305394 +0000 | ||
17 | @@ -587,6 +587,7 @@ | ||
18 | |||
19 | # Directory in which the compiler finds libraries etc. | ||
20 | libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version) | ||
21 | +libsubdir_target = gcc/$(target_noncanonical)/$(version) | ||
22 | # Directory in which the compiler finds executables | ||
23 | libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version) | ||
24 | # Directory in which all plugin resources are installed | ||
25 | @@ -2534,6 +2535,7 @@ | ||
26 | |||
27 | PREPROCESSOR_DEFINES = \ | ||
28 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | ||
29 | + -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \ | ||
30 | -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \ | ||
31 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ | ||
32 | -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \ | ||
33 | --- a/gcc/cppdefault.c 2015-01-13 17:40:26.131012725 +0000 | ||
34 | +++ b/gcc/cppdefault.c 2015-01-21 11:30:08.928426492 +0000 | ||
35 | @@ -59,6 +59,10 @@ | ||
36 | /* This is the dir for gcc's private headers. */ | ||
37 | { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, | ||
38 | #endif | ||
39 | +#ifdef GCC_INCLUDE_SUBDIR_TARGET | ||
40 | + /* This is the dir for gcc's private headers under the specified sysroot. */ | ||
41 | + { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 }, | ||
42 | +#endif | ||
43 | #ifdef LOCAL_INCLUDE_DIR | ||
44 | /* /usr/local/include comes before the fixincluded header files. */ | ||
45 | { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, | ||
46 | diff --git a/gcc/defaults.h b/gcc/defaults.h | ||
47 | index f94ae17..d98b40b 100644 | ||
48 | --- a/gcc/defaults.h | ||
49 | +++ b/gcc/defaults.h | ||
50 | @@ -1390,4 +1390,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | ||
51 | |||
52 | #endif /* GCC_INSN_FLAGS_H */ | ||
53 | |||
54 | +/* Default prefixes to attach to command names. */ | ||
55 | + | ||
56 | +#ifndef STANDARD_STARTFILE_PREFIX_1 | ||
57 | +#define STANDARD_STARTFILE_PREFIX_1 "/lib/" | ||
58 | +#endif | ||
59 | +#ifndef STANDARD_STARTFILE_PREFIX_2 | ||
60 | +#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" | ||
61 | +#endif | ||
62 | + | ||
63 | #endif /* ! GCC_DEFAULTS_H */ | ||
64 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
65 | index 9f0b781..174fca8 100644 | ||
66 | --- a/gcc/gcc.c | ||
67 | +++ b/gcc/gcc.c | ||
68 | @@ -1189,13 +1189,6 @@ static const char *gcc_libexec_prefix; | ||
69 | |||
70 | /* Default prefixes to attach to command names. */ | ||
71 | |||
72 | -#ifndef STANDARD_STARTFILE_PREFIX_1 | ||
73 | -#define STANDARD_STARTFILE_PREFIX_1 "/lib/" | ||
74 | -#endif | ||
75 | -#ifndef STANDARD_STARTFILE_PREFIX_2 | ||
76 | -#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" | ||
77 | -#endif | ||
78 | - | ||
79 | #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */ | ||
80 | #undef MD_EXEC_PREFIX | ||
81 | #undef MD_STARTFILE_PREFIX | ||
diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc index 2568e995ac..0f407b7d5d 100644 --- a/meta/recipes-devtools/gcc/gcc-4.9.inc +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc | |||
@@ -74,6 +74,7 @@ SRC_URI = "\ | |||
74 | file://0057-aarch64-config.patch \ | 74 | file://0057-aarch64-config.patch \ |
75 | file://0058-gcc-r212171.patch \ | 75 | file://0058-gcc-r212171.patch \ |
76 | file://0059-gcc-PR-rtl-optimization-63348.patch \ | 76 | file://0059-gcc-PR-rtl-optimization-63348.patch \ |
77 | file://target-gcc-includedir.patch \ | ||
77 | " | 78 | " |
78 | SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1" | 79 | SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1" |
79 | SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e" | 80 | SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e" |
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/target-gcc-includedir.patch b/meta/recipes-devtools/gcc/gcc-4.9/target-gcc-includedir.patch new file mode 100644 index 0000000000..f48c66dcac --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.9/target-gcc-includedir.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | Ensure target gcc headers can be included | ||
2 | |||
3 | There are a few headers installed as part of the OpenEmbedded | ||
4 | gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe | ||
5 | built for the target architecture, these are within the target | ||
6 | sysroot and not cross/nativesdk; thus they weren't able to be | ||
7 | found by gcc with the existing search paths. Add support for | ||
8 | picking up these headers under the sysroot supplied on the gcc | ||
9 | command line in order to resolve this. | ||
10 | |||
11 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
12 | |||
13 | Upstream-Status: Pending | ||
14 | |||
15 | --- a/gcc/Makefile.in 2014-12-23 11:57:33.327873331 +0000 | ||
16 | +++ b/gcc/Makefile.in 2015-01-21 11:32:35.447305394 +0000 | ||
17 | @@ -587,6 +587,7 @@ | ||
18 | |||
19 | # Directory in which the compiler finds libraries etc. | ||
20 | libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version) | ||
21 | +libsubdir_target = gcc/$(target_noncanonical)/$(version) | ||
22 | # Directory in which the compiler finds executables | ||
23 | libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version) | ||
24 | # Directory in which all plugin resources are installed | ||
25 | @@ -2534,6 +2535,7 @@ | ||
26 | |||
27 | PREPROCESSOR_DEFINES = \ | ||
28 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | ||
29 | + -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \ | ||
30 | -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \ | ||
31 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ | ||
32 | -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \ | ||
33 | --- a/gcc/cppdefault.c 2015-01-13 17:40:26.131012725 +0000 | ||
34 | +++ b/gcc/cppdefault.c 2015-01-21 11:30:08.928426492 +0000 | ||
35 | @@ -59,6 +59,10 @@ | ||
36 | /* This is the dir for gcc's private headers. */ | ||
37 | { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, | ||
38 | #endif | ||
39 | +#ifdef GCC_INCLUDE_SUBDIR_TARGET | ||
40 | + /* This is the dir for gcc's private headers under the specified sysroot. */ | ||
41 | + { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 }, | ||
42 | +#endif | ||
43 | #ifdef LOCAL_INCLUDE_DIR | ||
44 | /* /usr/local/include comes before the fixincluded header files. */ | ||
45 | { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, | ||
46 | diff --git a/gcc/defaults.h b/gcc/defaults.h | ||
47 | index f94ae17..d98b40b 100644 | ||
48 | --- a/gcc/defaults.h | ||
49 | +++ b/gcc/defaults.h | ||
50 | @@ -1390,4 +1390,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | ||
51 | |||
52 | #endif /* GCC_INSN_FLAGS_H */ | ||
53 | |||
54 | +/* Default prefixes to attach to command names. */ | ||
55 | + | ||
56 | +#ifndef STANDARD_STARTFILE_PREFIX_1 | ||
57 | +#define STANDARD_STARTFILE_PREFIX_1 "/lib/" | ||
58 | +#endif | ||
59 | +#ifndef STANDARD_STARTFILE_PREFIX_2 | ||
60 | +#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" | ||
61 | +#endif | ||
62 | + | ||
63 | #endif /* ! GCC_DEFAULTS_H */ | ||
64 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
65 | index 9f0b781..174fca8 100644 | ||
66 | --- a/gcc/gcc.c | ||
67 | +++ b/gcc/gcc.c | ||
68 | @@ -1189,13 +1189,6 @@ static const char *gcc_libexec_prefix; | ||
69 | |||
70 | /* Default prefixes to attach to command names. */ | ||
71 | |||
72 | -#ifndef STANDARD_STARTFILE_PREFIX_1 | ||
73 | -#define STANDARD_STARTFILE_PREFIX_1 "/lib/" | ||
74 | -#endif | ||
75 | -#ifndef STANDARD_STARTFILE_PREFIX_2 | ||
76 | -#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" | ||
77 | -#endif | ||
78 | - | ||
79 | #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */ | ||
80 | #undef MD_EXEC_PREFIX | ||
81 | #undef MD_STARTFILE_PREFIX | ||