diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-04-21 02:28:06 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-04-21 02:28:06 +0000 |
commit | 2d1126e823dcd472b2ac9d20252c56cb3cbef372 (patch) | |
tree | 836400fb1f6d15fb167c5ac9f58be0aac09cfbd5 /4.5.4 | |
parent | Minimal patch to make setup_multilib_osdirnames() from the eclass work. (diff) | |
download | gcc-patches-2d1126e823dcd472b2ac9d20252c56cb3cbef372.tar.gz gcc-patches-2d1126e823dcd472b2ac9d20252c56cb3cbef372.tar.bz2 gcc-patches-2d1126e823dcd472b2ac9d20252c56cb3cbef372.zip |
fix default armv4 linking behavior
Diffstat (limited to '4.5.4')
-rw-r--r-- | 4.5.4/gentoo/30_all_gcc-4.5_arm_armv4-no-thumb-fix-link.patch | 54 | ||||
-rw-r--r-- | 4.5.4/gentoo/README.history | 3 |
2 files changed, 57 insertions, 0 deletions
diff --git a/4.5.4/gentoo/30_all_gcc-4.5_arm_armv4-no-thumb-fix-link.patch b/4.5.4/gentoo/30_all_gcc-4.5_arm_armv4-no-thumb-fix-link.patch new file mode 100644 index 0000000..89d4149 --- /dev/null +++ b/4.5.4/gentoo/30_all_gcc-4.5_arm_armv4-no-thumb-fix-link.patch @@ -0,0 +1,54 @@ +From 73aa8c34427a4282930ca8667165d844ee698859 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Fri, 19 Apr 2013 16:32:28 -0400 +Subject: [PATCH] gcc: arm: linux-eabi: fix handling of armv4 bx fixups when + linking + +The bpabi.h header already sets up defines to automatically use the +--fix-v4bx flag with the assembler & linker as needed, and creates a +default assembly & linker spec which uses those. Unfortunately, the +linux-eabi.h header clobbers the LINK_SPEC define and doesn't include +the v4bx define when setting up its own. So while the assembler spec +is retained and works fine to generate the right relocs, building for +armv4 targets doesn't invoke the linker correctly so all the relocs +get processed as if we had an armv4t target. + +You can see this with -dumpspecs when configuring gcc for an armv4 +target and using --with-arch=armv4: +$ armv4l-unknown-linux-gnueabi-gcc -dumpspecs |& grep -B 1 fix-v4bx +*subtarget_extra_asm_spec: +.... %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx} ... + +With this fix in place, we also get the link spec: +$ armv4l-unknown-linux-gnueabi-gcc -dumpspecs |& grep -B 1 fix-v4bx +*link: +... %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx} ... + +And all my hello world tests / glibc builds automatically turn the +bx insn into the 'mov pc, lr' insn and all is right in the world. + +Signed-off-by: Mike Frysinger <vapier@gentoo.org> + +2013-04-19 Mike Frysinger <vapier@gentoo.org> + + * config/arm/linux-eabi.h (LINK_SPEC): Add TARGET_FIX_V4BX_SPEC. +--- + gcc/config/arm/linux-eabi.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h +index 4a425c8..8b7ebb2 100644 +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -80,7 +80,7 @@ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC LINUX_TARGET_LINK_SPEC BE8_LINK_SPEC ++#define LINK_SPEC LINUX_TARGET_LINK_SPEC TARGET_FIX_V4BX_SPEC BE8_LINK_SPEC + + /* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we + do not use -lfloat. */ +-- +1.8.2.1 + diff --git a/4.5.4/gentoo/README.history b/4.5.4/gentoo/README.history index 3535eaa..99d061d 100644 --- a/4.5.4/gentoo/README.history +++ b/4.5.4/gentoo/README.history @@ -1,3 +1,6 @@ +1.2 19 Apr 2013 + + 30_all_gcc-4.5_arm_armv4-no-thumb-fix-link.patch + 1.1 21 Dec 2012 - 03_all_gcc43-java-nomulti.patch + 15_all_libgfortran-Werror.patch |