summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2004-04-30 00:31:55 +0000
committerMike Frysinger <vapier@gentoo.org>2004-04-30 00:31:55 +0000
commit836d626d63139cecc4d4c5414db215eea01c86cd (patch)
tree782adce8a2fff09d2978d3b2bad5e02d8daac848 /sys-devel
parentversion bump (Manifest recommit) (diff)
downloadgentoo-2-836d626d63139cecc4d4c5414db215eea01c86cd.tar.gz
gentoo-2-836d626d63139cecc4d4c5414db215eea01c86cd.tar.bz2
gentoo-2-836d626d63139cecc4d4c5414db215eea01c86cd.zip
arm!
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/gcc/ChangeLog7
-rw-r--r--sys-devel/gcc/files/3.3.3/gcc333-debian-arm-getoff.patch110
-rw-r--r--sys-devel/gcc/files/3.3.3/gcc333-debian-arm-ldm.patch124
-rw-r--r--sys-devel/gcc/gcc-3.3.3-r3.ebuild10
4 files changed, 248 insertions, 3 deletions
diff --git a/sys-devel/gcc/ChangeLog b/sys-devel/gcc/ChangeLog
index 73877ee4100c..d2a0c21c5ae5 100644
--- a/sys-devel/gcc/ChangeLog
+++ b/sys-devel/gcc/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-devel/gcc
# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/ChangeLog,v 1.228 2004/04/28 22:26:57 lv Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/ChangeLog,v 1.229 2004/04/30 00:31:55 vapier Exp $
+
+ 29 Apr 2004; Mike Frysinger <vapier@gentoo.org> gcc-3.3.3-r3.ebuild,
+ +files/3.3.3/gcc333-debian-arm-getoff.patch,
+ +files/3.3.3/gcc333-debian-arm-ldm.patch:
+ Take two patches from debian gcc-3.3.3 so that it works nicely on arm.
28 Apr 2004; Travis Tilley <lv@gentoo.org>
+files/3.4.0/gcc-3.4.0-fno-for-scope.patch, gcc-3.4.0.ebuild:
diff --git a/sys-devel/gcc/files/3.3.3/gcc333-debian-arm-getoff.patch b/sys-devel/gcc/files/3.3.3/gcc333-debian-arm-getoff.patch
new file mode 100644
index 000000000000..86704f98c473
--- /dev/null
+++ b/sys-devel/gcc/files/3.3.3/gcc333-debian-arm-getoff.patch
@@ -0,0 +1,110 @@
+--- gcc/config/arm/arm.c 2003-06-14 15:20:53.000000000 +0100
++++ gcc/config/arm/arm.c 2004-03-06 15:15:32.000000000 +0000
+@@ -2364,6 +2394,40 @@
+ return 1;
+ }
+
++/* Return true if OP is a symbolic operand that resolves locally. */
++
++static int
++local_symbolic_operand (op, mode)
++ rtx op;
++ enum machine_mode mode ATTRIBUTE_UNUSED;
++{
++ if (GET_CODE (op) == CONST
++ && GET_CODE (XEXP (op, 0)) == PLUS
++ && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT)
++ op = XEXP (XEXP (op, 0), 0);
++
++ if (GET_CODE (op) == LABEL_REF)
++ return 1;
++
++ if (GET_CODE (op) != SYMBOL_REF)
++ return 0;
++
++ /* These we've been told are local by varasm and encode_section_info
++ respectively. */
++ if (CONSTANT_POOL_ADDRESS_P (op) || ENCODED_LOCAL_BINDING_ATTR_P (XSTR (op, 0)))
++ return 1;
++
++ /* There is, however, a not insubstantial body of code in the rest of
++ the compiler that assumes it can just stick the results of
++ ASM_GENERATE_INTERNAL_LABEL in a symbol_ref and have done. */
++ /* ??? This is a hack. Should update the body of the compiler to
++ always create a DECL an invoke targetm.encode_section_info. */
++ if (strncmp (arm_strip_name_encoding (XSTR (op, 0)), ".L", 2) == 0)
++ return 1;
++
++ return 0;
++}
++
+ rtx
+ legitimize_pic_address (orig, mode, reg)
+ rtx orig;
+@@ -2404,10 +2468,7 @@
+ else
+ emit_insn (gen_pic_load_addr_thumb (address, orig));
+
+- if ((GET_CODE (orig) == LABEL_REF
+- || (GET_CODE (orig) == SYMBOL_REF &&
+- ENCODED_SHORT_CALL_ATTR_P (XSTR (orig, 0))))
+- && NEED_GOT_RELOC)
++ if (local_symbolic_operand (orig, Pmode) && NEED_GOT_RELOC)
+ pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address);
+ else
+ {
+@@ -8804,11 +8911,7 @@
+ if (NEED_GOT_RELOC && flag_pic && making_const_table &&
+ (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF))
+ {
+- if (GET_CODE (x) == SYMBOL_REF
+- && (CONSTANT_POOL_ADDRESS_P (x)
+- || ENCODED_SHORT_CALL_ATTR_P (XSTR (x, 0))))
+- fputs ("(GOTOFF)", asm_out_file);
+- else if (GET_CODE (x) == LABEL_REF)
++ if (local_symbolic_operand (x, Pmode))
+ fputs ("(GOTOFF)", asm_out_file);
+ else
+ fputs ("(GOT)", asm_out_file);
+@@ -11335,6 +11418,11 @@
+ else if (! TREE_PUBLIC (decl))
+ arm_encode_call_attribute (decl, SHORT_CALL_FLAG_CHAR);
+ }
++
++ if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd'
++ && flag_pic
++ && (*targetm.binds_local_p) (decl))
++ arm_encode_call_attribute (decl, LOCAL_BINDING_FLAG_CHAR);
+ }
+ #endif /* !ARM_PE */
+
+
+--- gcc/config/arm/arm.h Fri Mar 5 18:49:44 2004
++++ gcc/config/arm/arm.h Fri Mar 5 15:04:31 2004
+@@ -1870,6 +1870,7 @@
+ Note, '@' and '*' have already been taken. */
+ #define SHORT_CALL_FLAG_CHAR '^'
+ #define LONG_CALL_FLAG_CHAR '#'
++#define LOCAL_BINDING_FLAG_CHAR '%'
+
+ #define ENCODED_SHORT_CALL_ATTR_P(SYMBOL_NAME) \
+ (*(SYMBOL_NAME) == SHORT_CALL_FLAG_CHAR)
+@@ -1877,6 +1878,9 @@
+ #define ENCODED_LONG_CALL_ATTR_P(SYMBOL_NAME) \
+ (*(SYMBOL_NAME) == LONG_CALL_FLAG_CHAR)
+
++#define ENCODED_LOCAL_BINDING_ATTR_P(SYMBOL_NAME) \
++ (*(SYMBOL_NAME) == LOCAL_BINDING_FLAG_CHAR)
++
+ #ifndef SUBTARGET_NAME_ENCODING_LENGTHS
+ #define SUBTARGET_NAME_ENCODING_LENGTHS
+ #endif
+@@ -1888,6 +1892,7 @@
+ #define ARM_NAME_ENCODING_LENGTHS \
+ case SHORT_CALL_FLAG_CHAR: return 1; \
+ case LONG_CALL_FLAG_CHAR: return 1; \
++ case LOCAL_BINDING_FLAG_CHAR: return 1; \
+ case '*': return 1; \
+ SUBTARGET_NAME_ENCODING_LENGTHS
+
+
diff --git a/sys-devel/gcc/files/3.3.3/gcc333-debian-arm-ldm.patch b/sys-devel/gcc/files/3.3.3/gcc333-debian-arm-ldm.patch
new file mode 100644
index 000000000000..eb94347b144a
--- /dev/null
+++ b/sys-devel/gcc/files/3.3.3/gcc333-debian-arm-ldm.patch
@@ -0,0 +1,124 @@
+--- gcc/config/arm/arm.c Fri Mar 5 18:49:42 2004
++++ gcc/config/arm/arm.c Fri Mar 5 16:00:21 2004
+@@ -7598,6 +7629,26 @@
+ return_used_this_function = 0;
+ }
+
++/* Return the number (counting from 0) of
++ the least significant set bit in MASK. */
++
++#ifdef __GNUC__
++inline
++#endif
++static int
++number_of_first_bit_set (mask)
++ int mask;
++{
++ int bit;
++
++ for (bit = 0;
++ (mask & (1 << bit)) == 0;
++ ++bit)
++ continue;
++
++ return bit;
++}
++
+ const char *
+ arm_output_epilogue (really_return)
+ int really_return;
+@@ -7788,27 +7839,47 @@
+ saved_regs_mask |= (1 << PC_REGNUM);
+ }
+
+- /* Load the registers off the stack. If we only have one register
+- to load use the LDR instruction - it is faster. */
+- if (saved_regs_mask == (1 << LR_REGNUM))
+- {
+- /* The exception handler ignores the LR, so we do
+- not really need to load it off the stack. */
+- if (eh_ofs)
+- asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
+- else
+- asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM);
+- }
+- else if (saved_regs_mask)
++ if (saved_regs_mask)
+ {
+- if (saved_regs_mask & (1 << SP_REGNUM))
+- /* Note - write back to the stack register is not enabled
+- (ie "ldmfd sp!..."). We know that the stack pointer is
+- in the list of registers and if we add writeback the
+- instruction becomes UNPREDICTABLE. */
+- print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
++ /* Load the registers off the stack. If we only have one register
++ to load use the LDR instruction - it is faster. */
++ if (bit_count (saved_regs_mask) == 1)
++ {
++ int reg = number_of_first_bit_set (saved_regs_mask);
++
++ switch (reg)
++ {
++ case SP_REGNUM:
++ /* Mustn't use base writeback when loading SP. */
++ asm_fprintf (f, "\tldr\t%r, [%r]\n", SP_REGNUM, SP_REGNUM);
++ break;
++
++ case LR_REGNUM:
++ if (eh_ofs)
++ {
++ /* The exception handler ignores the LR, so we do
++ not really need to load it off the stack. */
++ asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
++ break;
++ }
++ /* else fall through */
++
++ default:
++ asm_fprintf (f, "\tldr\t%r, [%r], #4\n", reg, SP_REGNUM);
++ break;
++ }
++ }
+ else
+- print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
++ {
++ if (saved_regs_mask & (1 << SP_REGNUM))
++ /* Note - write back to the stack register is not enabled
++ (ie "ldmfd sp!..."). We know that the stack pointer is
++ in the list of registers and if we add writeback the
++ instruction becomes UNPREDICTABLE. */
++ print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
++ else
++ print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
++ }
+ }
+
+ if (current_function_pretend_args_size)
+@@ -9610,26 +9677,6 @@
+ }
+ }
+
+-/* Return the number (counting from 0) of
+- the least significant set bit in MASK. */
+-
+-#ifdef __GNUC__
+-inline
+-#endif
+-static int
+-number_of_first_bit_set (mask)
+- int mask;
+-{
+- int bit;
+-
+- for (bit = 0;
+- (mask & (1 << bit)) == 0;
+- ++bit)
+- continue;
+-
+- return bit;
+-}
+-
+ /* Generate code to return from a thumb function.
+ If 'reg_containing_return_addr' is -1, then the return address is
+ actually on the stack, at the stack pointer. */
+
diff --git a/sys-devel/gcc/gcc-3.3.3-r3.ebuild b/sys-devel/gcc/gcc-3.3.3-r3.ebuild
index 38be0059c168..51a3476b3eb5 100644
--- a/sys-devel/gcc/gcc-3.3.3-r3.ebuild
+++ b/sys-devel/gcc/gcc-3.3.3-r3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.3.3-r3.ebuild,v 1.4 2004/04/28 16:36:07 solar Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.3.3-r3.ebuild,v 1.5 2004/04/30 00:31:55 vapier Exp $
IUSE="static nls bootstrap java build X multilib gcj f77 objc hardened uclibc"
@@ -109,7 +109,7 @@ HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html"
LICENSE="GPL-2 LGPL-2.1"
-KEYWORDS="~x86 ~mips ~sparc ~amd64 -hppa ~alpha ~ia64 ~ppc64 s390"
+KEYWORDS="~x86 ~sparc ~mips ~alpha arm -hppa ~amd64 ~ia64 ~ppc64 s390"
# Ok, this is a hairy one again, but lets assume that we
# are not cross compiling, than we want SLOT to only contain
@@ -325,6 +325,12 @@ src_unpack() {
epatch ${FILESDIR}/3.3.2/gcc332-altivec-fix.patch
fi
+ if [ "${ARCH}" = "arm" ]
+ then
+ epatch ${FILESDIR}/3.3.3/gcc333-debian-arm-getoff.patch
+ epatch ${FILESDIR}/3.3.3/gcc333-debian-arm-ldm.patch
+ fi
+
# non-default SSP and PIE support.
if [ "${ARCH}" != "hppa" -a "${ARCH}" != "hppa64" -a -n "${PP_VER}" ]
then