summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-08-16 22:42:07 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-12 15:13:38 +0100
commit86ae51246f1187841120be8f149578bc6bffd296 (patch)
tree87825eb4f68543bc4d4d3ff73dad872d72ebf3af /meta/recipes-devtools/gcc
parented9bb94f352945d0aef2dd25e03bdc7e2bdeab25 (diff)
downloadpoky-86ae51246f1187841120be8f149578bc6bffd296.tar.gz
gcc-4.7: Fix build for armv4/EABI and ppc/Os
arm patch is a forward port from OE/classic ppc patch should help in building images with Os (From OE-Core rev: ac9ebcea4a2b778f6dd103a729831d9a9be281df) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7.inc4
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7/gcc-armv4-pass-fix-v4bx-to-ld.patch31
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch72
3 files changed, 106 insertions, 1 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.7.inc b/meta/recipes-devtools/gcc/gcc-4.7.inc
index 84c230c30b..ab07862b36 100644
--- a/meta/recipes-devtools/gcc/gcc-4.7.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.7.inc
@@ -1,6 +1,6 @@
1require gcc-common.inc 1require gcc-common.inc
2 2
3PR = "r11" 3PR = "r12"
4 4
5# Third digit in PV should be incremented after a minor release 5# Third digit in PV should be incremented after a minor release
6# happens from this branch on gcc e.g. currently its 4.7.1 6# happens from this branch on gcc e.g. currently its 4.7.1
@@ -75,6 +75,8 @@ SRC_URI = "git://github.com/mirrors/gcc.git;branch=${BRANCH};protocol=git \
75 file://fix-g++-sysroot.patch \ 75 file://fix-g++-sysroot.patch \
76 file://disablesdt.patch \ 76 file://disablesdt.patch \
77 file://libtool.patch \ 77 file://libtool.patch \
78 file://gcc-armv4-pass-fix-v4bx-to-ld.patch \
79 file://ppc_no_crtsavres.patch \
78 " 80 "
79 81
80S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/git" 82S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/git"
diff --git a/meta/recipes-devtools/gcc/gcc-4.7/gcc-armv4-pass-fix-v4bx-to-ld.patch b/meta/recipes-devtools/gcc/gcc-4.7/gcc-armv4-pass-fix-v4bx-to-ld.patch
new file mode 100644
index 0000000000..7e03a3a8a8
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.7/gcc-armv4-pass-fix-v4bx-to-ld.patch
@@ -0,0 +1,31 @@
1The LINK_SPEC for linux gets overwritten by linux-eabi.h which
2means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result
3the option is not passed to linker when chosing march=armv4
4This patch redefines this in linux-eabi.h and reinserts it
5for eabi defaulting toolchains.
6
7We might want to send it upstream
8
9Upstream-Status: Pending
10
11-Khem
12Index: gcc-4_7-branch/gcc/config/arm/linux-eabi.h
13===================================================================
14--- gcc-4_7-branch.orig/gcc/config/arm/linux-eabi.h 2012-08-21 22:54:12.448453417 -0700
15+++ gcc-4_7-branch/gcc/config/arm/linux-eabi.h 2012-08-21 23:05:18.008478722 -0700
16@@ -78,10 +78,14 @@
17 %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
18 %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
19
20+/* For armv4 we pass --fix-v4bx to linker to support EABI */
21+#undef TARGET_FIX_V4BX_SPEC
22+#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
23+
24 /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
25 use the GNU/Linux version, not the generic BPABI version. */
26 #undef LINK_SPEC
27-#define LINK_SPEC BE8_LINK_SPEC \
28+#define LINK_SPEC BE8_LINK_SPEC TARGET_FIX_V4BX_SPEC \
29 LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
30 LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
31
diff --git a/meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch b/meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch
new file mode 100644
index 0000000000..92a5d9e176
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch
@@ -0,0 +1,72 @@
1Upstream-Status: Backport
2
3Signed-off-by: Khem Raj
4
5Source-url: http://gcc.gnu.org/ml/gcc-patches/2012-05/msg01362.html
6
7Currently, powerpc-linux gcc -Os -mno-multiple uses out-of-linux gpr
8save and restore functions when saving/restoring just one gpr. That's
9quite silly since the function call requires more instructions and is
10slower than an inline save/restore. The only case where it might win
11is when no fprs are restored and the restore function can tear down
12the frame and exit (also loading up lr on ppc64). I guess that's how
13GP_SAVE_INLINE came to be like it is, ie. it's optimised for the
14common case using ldm in the prologue and no fprs. Still, it isn't
15difficult to choose the best combination in all cases, but it does
16mean different logic is needed for restores. I could have implemented
17GP_RESTORE_INLINE and FP_RESORE_INLINE macros but it seemed simpler to
18just move everything into the one place the macros are invoked. AIX
19and Darwin register cutoff doesn't change with this patch.
20
21This patch also enables out-of-line restores in cases that were
22previously disabled due to using inline saves.
23
24Bootstrapped and regression tested powerpc-linux. OK to apply?
25
26 * aix.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete.
27 * darwin.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete.
28 * sysv4.h (FP_SAVE_INLINE, GP_SAVE_INLINE, V_SAVE_INLINE): Delete.
29 * config/rs6000/rs6000.c (V_SAVE_INLINE): Delete.
30 (rs6000_savres_strategy): Reimplement GP/FP/V_SAVE_INLINE logic.
31 For ELF targets, use out-of-line restores for -Os and any number
32 of regs if the restore exits, and out-of-line gp save for two or
33 more regs. Use save_reg_p to test for holes in reg restore set.
34 Replace "#if" with "if".
35
36Index: gcc-4_7-branch/gcc/config/rs6000/aix.h
37===================================================================
38--- gcc-4_7-branch.orig/gcc/config/rs6000/aix.h 2012-09-07 12:35:35.000000000 -0700
39+++ gcc-4_7-branch/gcc/config/rs6000/aix.h 2012-09-07 15:27:55.215290315 -0700
40@@ -207,11 +207,6 @@
41 { "link_syscalls", LINK_SYSCALLS_SPEC }, \
42 { "link_libg", LINK_LIBG_SPEC }
43
44-/* Define cutoff for using external functions to save floating point. */
45-#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == 62 || (FIRST_REG) == 63)
46-/* And similarly for general purpose registers. */
47-#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32)
48-
49 #define PROFILE_HOOK(LABEL) output_profile_hook (LABEL)
50
51 /* No version of AIX fully supports AltiVec or 64-bit instructions in
52Index: gcc-4_7-branch/gcc/config/rs6000/darwin.h
53===================================================================
54--- gcc-4_7-branch.orig/gcc/config/rs6000/darwin.h 2012-09-07 12:35:35.000000000 -0700
55+++ gcc-4_7-branch/gcc/config/rs6000/darwin.h 2012-09-07 15:27:55.223290316 -0700
56@@ -173,16 +173,6 @@
57 (RS6000_ALIGN (crtl->outgoing_args_size, 16) \
58 + (STACK_POINTER_OFFSET))
59
60-/* Define cutoff for using out-of-line functions to save registers.
61- Currently on Darwin, we implement FP and GPR out-of-line-saves plus the
62- special routine for 'save everything'. */
63-
64-#undef FP_SAVE_INLINE
65-#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) > 60 && (FIRST_REG) < 64)
66-
67-#undef GP_SAVE_INLINE
68-#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) > 29 && (FIRST_REG) < 32)
69-
70 /* Darwin uses a function call if everything needs to be saved/restored. */
71
72 #undef WORLD_SAVE_P