mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 05:23:34 +08:00
Resync new repository with old repo r5166
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5153 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
--- gcc-3.3.2-old/configure.in 2003-08-09 01:57:21.000000000 -0500
|
||||
+++ gcc-3.3.2/configure.in 2004-01-15 12:46:29.000000000 -0600
|
||||
@@ -1418,6 +1418,11 @@
|
||||
fi
|
||||
|
||||
FLAGS_FOR_TARGET=
|
||||
+case " $targargs " in
|
||||
+ *" --nfp "* | *" --without-float "*)
|
||||
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -msoft-float'
|
||||
+ ;;
|
||||
+esac
|
||||
case " $target_configdirs " in
|
||||
*" newlib "*)
|
||||
case " $targargs " in
|
||||
@@ -0,0 +1,10 @@
|
||||
--- gcc/gcc/loop.c 14 Feb 2004 14:46:03 -0000 1.488.2.3
|
||||
+++ gcc/gcc/loop.c 28 Apr 2004 22:02:53 -0000
|
||||
@@ -929,6 +929,7 @@
|
||||
|| (! (GET_CODE (SET_SRC (set)) == REG
|
||||
&& (REGNO (SET_SRC (set))
|
||||
< FIRST_PSEUDO_REGISTER))))
|
||||
+ && regno >= FIRST_PSEUDO_REGISTER
|
||||
/* This test is not redundant; SET_SRC (set) might be
|
||||
a call-clobbered register and the life of REGNO
|
||||
might span a call. */
|
||||
@@ -0,0 +1,68 @@
|
||||
By Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Adds support for arm*b-linux* big-endian ARM targets
|
||||
|
||||
See http://gcc.gnu.org/PR16350
|
||||
|
||||
--- gcc-3.3.5-dist/gcc/config/arm/linux-elf.h
|
||||
+++ gcc-3.3.5/gcc/config/arm/linux-elf.h
|
||||
@@ -30,17 +30,34 @@
|
||||
/* Do not assume anything about header files. */
|
||||
#define NO_IMPLICIT_EXTERN_C
|
||||
|
||||
+/*
|
||||
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
|
||||
+ * (big endian) configurations.
|
||||
+ */
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT
|
||||
+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
|
||||
+#define TARGET_ENDIAN_OPTION "mbig-endian"
|
||||
+#define TARGET_LINKER_EMULATION "armelfb_linux"
|
||||
+#else
|
||||
+#define TARGET_ENDIAN_DEFAULT 0
|
||||
+#define TARGET_ENDIAN_OPTION "mlittle-endian"
|
||||
+#define TARGET_LINKER_EMULATION "armelf_linux"
|
||||
+#endif
|
||||
+
|
||||
/* Default is to use APCS-32 mode. */
|
||||
#undef TARGET_DEFAULT
|
||||
-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
|
||||
+#define TARGET_DEFAULT \
|
||||
+ ( ARM_FLAG_APCS_32 | \
|
||||
+ ARM_FLAG_MMU_TRAPS | \
|
||||
+ TARGET_ENDIAN_DEFAULT )
|
||||
|
||||
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
|
||||
|
||||
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
|
||||
+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
|
||||
|
||||
#undef MULTILIB_DEFAULTS
|
||||
#define MULTILIB_DEFAULTS \
|
||||
- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
|
||||
+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
|
||||
|
||||
#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
|
||||
|
||||
@@ -100,7 +117,7 @@
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
|
||||
-X \
|
||||
- %{mbig-endian:-EB}" \
|
||||
+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
|
||||
SUBTARGET_EXTRA_LINK_SPEC
|
||||
#endif
|
||||
|
||||
--- gcc-3.3.5-dist/gcc/config.gcc
|
||||
+++ gcc-3.3.5/gcc/config.gcc
|
||||
@@ -710,6 +710,11 @@
|
||||
;;
|
||||
arm*-*-linux*) # ARM GNU/Linux with ELF
|
||||
tm_file="dbxelf.h elfos.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
|
||||
+ case $target in
|
||||
+ arm*b-*)
|
||||
+ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
|
||||
+ ;;
|
||||
+ esac
|
||||
tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
|
||||
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
|
||||
gnu_ld=yes
|
||||
@@ -0,0 +1,6 @@
|
||||
--- gcc.orig/gcc/config/mips/t-linux 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ gcc/gcc/config/mips/t-linux 2004-08-26 18:28:12.000000000 +0200
|
||||
@@ -0,0 +1,3 @@
|
||||
+# Compile crtbegin/end with xgot so it works for both
|
||||
+# normal and large GOTs.
|
||||
+CRTSTUFF_T_CFLAGS = -Wa,-xgot
|
||||
@@ -0,0 +1,59 @@
|
||||
From: cgd at broadcom dot com
|
||||
To: gcc-patches at gcc dot gnu dot org
|
||||
Cc: mark at codesourcery dot com
|
||||
Date: 13 Jun 2004 22:51:30 -0700
|
||||
Subject: [trunk + 3.4-branch RFA] don't use empic relocs for mips-linuxeh
|
||||
|
||||
This patch changes mips-linux to avoid using embedded-pic relocs for
|
||||
its eh data. (Support for generating these for new code is removed in
|
||||
current binutils srcs.)
|
||||
|
||||
Relating to this, previously, mips-linux and mips64-linux would use
|
||||
different representations for their EH data (even for mips64-linux o32
|
||||
abi), due to the mips64-linux n32/64 BFDs not supporting the
|
||||
embedded-pic relocs. This was a bug.
|
||||
|
||||
For more explanation, see the thread of the URL quoted in the comment
|
||||
in linux.h.
|
||||
|
||||
|
||||
Tested the same w/ sources of about a week ago for c/c++ for
|
||||
mips-linux (native) before/after. Also verified .o compatibility
|
||||
before/after just to be sure.
|
||||
|
||||
I'd like this approved for the branch as well, so 3.4.1 will work
|
||||
nicely w/ the next major binutils release.
|
||||
|
||||
|
||||
thanks,
|
||||
|
||||
chris
|
||||
|
||||
2004-06-13 Chris Demetriou <cgd@broadcom.com>
|
||||
|
||||
* config/mips/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): Redefine
|
||||
to return DW_EH_PE_absptr.
|
||||
|
||||
Index: config/mips/linux.h
|
||||
===================================================================
|
||||
RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
|
||||
retrieving revision 1.77
|
||||
diff -u -p -r1.77 linux.h
|
||||
--- gcc/gcc/config/mips/linux.h 19 Feb 2004 22:07:51 -0000 1.77
|
||||
+++ gcc/gcc/config/mips/linux.h 14 Jun 2004 05:49:51 -0000
|
||||
@@ -170,10 +170,11 @@ Boston, MA 02111-1307, USA. */
|
||||
#undef FUNCTION_NAME_ALREADY_DECLARED
|
||||
#define FUNCTION_NAME_ALREADY_DECLARED 1
|
||||
|
||||
-#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
|
||||
- (flag_pic \
|
||||
- ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\
|
||||
- : DW_EH_PE_absptr)
|
||||
+/* If possible, we should attempt to use GP-relative relocs for this
|
||||
+ (see <a href="http://sources.redhat.com/ml/binutils/2004-05/msg00227.html">http://sources.redhat.com/ml/binutils/2004-05/msg00227.html</a>).
|
||||
+ However, until that is implement, this just uses standard, absolute
|
||||
+ references. */
|
||||
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr
|
||||
|
||||
/* The glibc _mcount stub will save $v0 for us. Don't mess with saving
|
||||
it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
|
||||
@@ -0,0 +1,16 @@
|
||||
Index: gcc/gcse.c
|
||||
===================================================================
|
||||
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
|
||||
retrieving revision 1.288.2.9
|
||||
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.288.2.9 gcse.c
|
||||
--- gcc/gcc/gcse.c 30 Oct 2004 18:02:53 -0000 1.288.2.9
|
||||
+++ gcc/gcc/gcse.c 14 Jul 2005 13:19:57 -0000
|
||||
@@ -6445,7 +6445,7 @@ hoist_code (void)
|
||||
insn_inserted_p = 0;
|
||||
|
||||
/* These tests should be the same as the tests above. */
|
||||
- if (TEST_BIT (hoist_vbeout[bb->index], i))
|
||||
+ if (TEST_BIT (hoist_exprs[bb->index], i))
|
||||
{
|
||||
/* We've found a potentially hoistable expression, now
|
||||
we look at every block BB dominates to see if it
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
--- gcc-3.3.6/gcc/collect2.c 2011-04-06 18:36:17.269806677 -0600
|
||||
+++ gcc-3.3.6/gcc/collect2.c 2011-04-06 18:36:34.385799826 -0600
|
||||
@@ -1580,7 +1580,7 @@
|
||||
if (redir)
|
||||
{
|
||||
/* Open response file. */
|
||||
- redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
|
||||
+ redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, 0666);
|
||||
|
||||
/* Duplicate the stdout and stderr file handles
|
||||
so they can be restored later. */
|
||||
@@ -0,0 +1,47 @@
|
||||
# DP: Build and install libstdc++_pic.a library.
|
||||
|
||||
--- gcc/libstdc++-v3/src/Makefile.am
|
||||
+++ gcc/libstdc++-v3/src/Makefile.am
|
||||
@@ -224,6 +224,10 @@
|
||||
@OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
|
||||
+install-exec-local:
|
||||
+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
|
||||
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
|
||||
+
|
||||
# Added bits to build debug library.
|
||||
if GLIBCPP_BUILD_DEBUG
|
||||
all-local: build_debug
|
||||
|
||||
--- gcc/libstdc++-v3/src/Makefile.in
|
||||
+++ gcc/libstdc++-v3/src/Makefile.in
|
||||
@@ -585,7 +585,7 @@
|
||||
|
||||
install-data-am: install-data-local
|
||||
|
||||
-install-exec-am: install-toolexeclibLTLIBRARIES
|
||||
+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
distclean-tags distdir dvi dvi-am info info-am install \
|
||||
install-am install-data install-data-am install-data-local \
|
||||
install-exec install-exec-am install-info install-info-am \
|
||||
+ install-exec-local \
|
||||
install-man install-strip install-toolexeclibLTLIBRARIES \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
@@ -707,6 +708,11 @@
|
||||
install_debug:
|
||||
(cd ${debugdir} && $(MAKE) \
|
||||
toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
|
||||
+
|
||||
+install-exec-local:
|
||||
+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
|
||||
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
|
||||
+
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,24 @@
|
||||
--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps 2006-03-24 01:49:51 +0100
|
||||
+++ gcc-4.1.0/libstdc++-v3/include/ext/rope 2006-03-24 01:49:37 +0100
|
||||
@@ -59,6 +59,9 @@
|
||||
#include <bits/allocator.h>
|
||||
#include <ext/hash_fun.h>
|
||||
|
||||
+/* cope w/ index defined as macro, SuSv3 proposal */
|
||||
+#undef index
|
||||
+
|
||||
# ifdef __GC
|
||||
# define __GC_CONST const
|
||||
# else
|
||||
--- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps 2006-03-24 01:50:04 +0100
|
||||
+++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h 2006-03-24 01:50:28 +0100
|
||||
@@ -53,6 +53,9 @@
|
||||
#include <ext/memory> // For uninitialized_copy_n
|
||||
#include <ext/numeric> // For power
|
||||
|
||||
+/* cope w/ index defined as macro, SuSv3 proposal */
|
||||
+#undef index
|
||||
+
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
using std::size_t;
|
||||
@@ -0,0 +1,65 @@
|
||||
--- gcc-3.4.0/gcc/config/arm/arm.md.arm-ldm-peephole 2004-01-13 08:24:37.000000000 -0500
|
||||
+++ gcc-3.4.0/gcc/config/arm/arm.md 2004-04-24 18:18:04.000000000 -0400
|
||||
@@ -8810,13 +8810,16 @@
|
||||
(set_attr "length" "4,8,8")]
|
||||
)
|
||||
|
||||
+; Try to convert LDR+LDR+arith into [add+]LDM+arith
|
||||
+; On XScale, LDM is always slower than two LDRs, so only do this if
|
||||
+; optimising for size.
|
||||
(define_insn "*arith_adjacentmem"
|
||||
[(set (match_operand:SI 0 "s_register_operand" "=r")
|
||||
(match_operator:SI 1 "shiftable_operator"
|
||||
[(match_operand:SI 2 "memory_operand" "m")
|
||||
(match_operand:SI 3 "memory_operand" "m")]))
|
||||
(clobber (match_scratch:SI 4 "=r"))]
|
||||
- "TARGET_ARM && adjacent_mem_locations (operands[2], operands[3])"
|
||||
+ "TARGET_ARM && (!arm_tune_xscale || optimize_size) && adjacent_mem_locations (operands[2], operands[3])"
|
||||
"*
|
||||
{
|
||||
rtx ldm[3];
|
||||
@@ -8851,6 +8854,8 @@
|
||||
}
|
||||
if (val1 && val2)
|
||||
{
|
||||
+ /* This would be a loss on a Harvard core, but adjacent_mem_locations()
|
||||
+ will prevent it from happening. */
|
||||
rtx ops[3];
|
||||
ldm[0] = ops[0] = operands[4];
|
||||
ops[1] = XEXP (XEXP (operands[2], 0), 0);
|
||||
--- gcc-3.4.0/gcc/config/arm/arm.c.arm-ldm-peephole 2004-04-24 18:16:25.000000000 -0400
|
||||
+++ gcc-3.4.0/gcc/config/arm/arm.c 2004-04-24 18:18:04.000000000 -0400
|
||||
@@ -4838,6 +4841,11 @@
|
||||
*load_offset = unsorted_offsets[order[0]];
|
||||
}
|
||||
|
||||
+ /* For XScale a two-word LDM is a performance loss, so only do this if
|
||||
+ size is more important. See comments in arm_gen_load_multiple. */
|
||||
+ if (nops == 2 && arm_tune_xscale && !optimize_size)
|
||||
+ return 0;
|
||||
+
|
||||
if (unsorted_offsets[order[0]] == 0)
|
||||
return 1; /* ldmia */
|
||||
|
||||
@@ -5064,6 +5072,11 @@
|
||||
*load_offset = unsorted_offsets[order[0]];
|
||||
}
|
||||
|
||||
+ /* For XScale a two-word LDM is a performance loss, so only do this if
|
||||
+ size is more important. See comments in arm_gen_load_multiple. */
|
||||
+ if (nops == 2 && arm_tune_xscale && !optimize_size)
|
||||
+ return 0;
|
||||
+
|
||||
if (unsorted_offsets[order[0]] == 0)
|
||||
return 1; /* stmia */
|
||||
|
||||
--- gcc-3.4.0/gcc/genpeep.c.arm-ldm-peephole 2003-07-05 01:27:22.000000000 -0400
|
||||
+++ gcc-3.4.0/gcc/genpeep.c 2004-04-24 18:18:04.000000000 -0400
|
||||
@@ -381,6 +381,7 @@
|
||||
printf ("#include \"recog.h\"\n");
|
||||
printf ("#include \"except.h\"\n\n");
|
||||
printf ("#include \"function.h\"\n\n");
|
||||
+ printf ("#include \"flags.h\"\n\n");
|
||||
|
||||
printf ("#ifdef HAVE_peephole\n");
|
||||
printf ("extern rtx peep_operand[];\n\n");
|
||||
@@ -0,0 +1,42 @@
|
||||
The 30_all_gcc34-arm-ldm-peephole.patch from Debian was conflicting
|
||||
with the newer 36_all_pr16201-fix.patch, so i cut out the hunk from
|
||||
it that was causing problems and grabbed an updated version from
|
||||
upstream cvs.
|
||||
|
||||
Index: gcc/config/arm/arm.c
|
||||
===================================================================
|
||||
RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm.c,v
|
||||
retrieving revision 1.432
|
||||
retrieving revision 1.433
|
||||
diff -u -r1.432 -r1.433
|
||||
--- gcc-3.4.4/gcc/config/arm/arm.c 29 Mar 2005 03:00:23 -0000 1.432
|
||||
+++ gcc-3.4.4/gcc/config/arm/arm.c 1 Apr 2005 11:02:22 -0000 1.433
|
||||
@@ -5139,6 +5139,10 @@
|
||||
int
|
||||
adjacent_mem_locations (rtx a, rtx b)
|
||||
{
|
||||
+ /* We don't guarantee to preserve the order of these memory refs. */
|
||||
+ if (volatile_refs_p (a) || volatile_refs_p (b))
|
||||
+ return 0;
|
||||
+
|
||||
if ((GET_CODE (XEXP (a, 0)) == REG
|
||||
|| (GET_CODE (XEXP (a, 0)) == PLUS
|
||||
&& GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT))
|
||||
@@ -5178,6 +5182,17 @@
|
||||
return 0;
|
||||
|
||||
val_diff = val1 - val0;
|
||||
+
|
||||
+ if (arm_ld_sched)
|
||||
+ {
|
||||
+ /* If the target has load delay slots, then there's no benefit
|
||||
+ to using an ldm instruction unless the offset is zero and
|
||||
+ we are optimizing for size. */
|
||||
+ return (optimize_size && (REGNO (reg0) == REGNO (reg1))
|
||||
+ && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4)
|
||||
+ && (val_diff == 4 || val_diff == -4));
|
||||
+ }
|
||||
+
|
||||
return ((REGNO (reg0) == REGNO (reg1))
|
||||
&& (val_diff == 4 || val_diff == -4));
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
--- gcc-3.4.0/gcc/config/arm/arm.c.arm-ldm 2004-02-27 09:51:05.000000000 -0500
|
||||
+++ gcc-3.4.0/gcc/config/arm/arm.c 2004-04-24 18:16:25.000000000 -0400
|
||||
@@ -8520,6 +8520,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 (rtx sibling)
|
||||
{
|
||||
@@ -8753,27 +8773,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)
|
||||
@@ -11401,22 +11441,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
-/* Return the number (counting from 0) of
|
||||
- the least significant set bit in MASK. */
|
||||
-
|
||||
-inline static int
|
||||
-number_of_first_bit_set (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. */
|
||||
@@ -0,0 +1,22 @@
|
||||
--- gcc-3.4.1/libstdc++-v3/libmath/Makefile.am~ 2003-08-27 22:29:42.000000000 +0100
|
||||
+++ gcc-3.4.1/libstdc++-v3/libmath/Makefile.am 2004-07-22 16:41:45.152130128 +0100
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
libmath_la_SOURCES = stubs.c
|
||||
|
||||
-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
|
||||
+AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
|
||||
|
||||
# Only compiling "C" sources in this directory.
|
||||
LIBTOOL = @LIBTOOL@ --tag CC
|
||||
--- gcc-3.4.1/libstdc++-v3/fragment.am.old 2004-07-22 18:24:58.024083656 +0100
|
||||
+++ gcc-3.4.1/libstdc++-v3/fragment.am 2004-07-22 18:24:59.019932264 +0100
|
||||
@@ -18,7 +18,7 @@
|
||||
$(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
|
||||
|
||||
# -I/-D flags to pass when compiling.
|
||||
-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
|
||||
+AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
See http://gcc.gnu.org/PR15068
|
||||
|
||||
Fixes error
|
||||
|
||||
../sysdeps/generic/s_fmax.c: In function `__fmax':
|
||||
../sysdeps/generic/s_fmax.c:28: internal compiler error: in elim_reg_cond, at flow.c:3257
|
||||
Please submit a full bug report,
|
||||
with preprocessed source if appropriate.
|
||||
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
|
||||
make[2]: *** [/home/dank/wk/crosstool-0.28-rc35/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/math/s_fmax.o] Error 1
|
||||
make[2]: Leaving directory `/home/dank/wk/crosstool-0.28-rc35/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040822/math'
|
||||
make[1]: *** [math/others] Error 2
|
||||
make[1]: Leaving directory `/home/dank/wk/crosstool-0.28-rc35/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040822'
|
||||
make: *** [all] Error 2
|
||||
|
||||
[ rediffed against gcc-3.4.1, with elbow grease, ending up with same thing as
|
||||
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.563.4.2&r2=1.563.4.3 ]
|
||||
|
||||
--- gcc-3.4.1/gcc/flow.c.old 2004-02-27 19:39:19.000000000 -0800
|
||||
+++ gcc-3.4.1/gcc/flow.c 2004-08-26 07:29:46.000000000 -0700
|
||||
@@ -1878,6 +1878,7 @@
|
||||
rtx set_src = SET_SRC (pc_set (BB_END (bb)));
|
||||
rtx cond_true = XEXP (set_src, 0);
|
||||
rtx reg = XEXP (cond_true, 0);
|
||||
+ enum rtx_code inv_cond;
|
||||
|
||||
if (GET_CODE (reg) == SUBREG)
|
||||
reg = SUBREG_REG (reg);
|
||||
@@ -1886,11 +1887,13 @@
|
||||
in the form of a comparison of a register against zero.
|
||||
If the condition is more complex than that, then it is safe
|
||||
not to record any information. */
|
||||
- if (GET_CODE (reg) == REG
|
||||
+ inv_cond = reversed_comparison_code (cond_true, BB_END (bb));
|
||||
+ if (inv_cond != UNKNOWN
|
||||
+ && GET_CODE (reg) == REG
|
||||
&& XEXP (cond_true, 1) == const0_rtx)
|
||||
{
|
||||
rtx cond_false
|
||||
- = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond_true)),
|
||||
+ = gen_rtx_fmt_ee (inv_cond,
|
||||
GET_MODE (cond_true), XEXP (cond_true, 0),
|
||||
XEXP (cond_true, 1));
|
||||
if (GET_CODE (XEXP (set_src, 1)) == PC)
|
||||
@@ -0,0 +1,43 @@
|
||||
--- gcc/gcc/config/sh/sh.c
|
||||
+++ gcc/gcc/config/sh/sh.c
|
||||
@@ -9106,6 +9106,15 @@ sh_output_mi_thunk (FILE *file, tree thu
|
||||
}
|
||||
this = FUNCTION_ARG (cum, Pmode, ptr_type_node, 1);
|
||||
|
||||
+ /* In PIC case, we set PIC register to compute the target address. We
|
||||
+ can use a scratch register to save and restore the original value
|
||||
+ except for SHcompact. For SHcompact, use stack. */
|
||||
+ if (flag_pic && TARGET_SHCOMPACT)
|
||||
+ {
|
||||
+ push (PIC_OFFSET_TABLE_REGNUM);
|
||||
+ emit_insn (gen_GOTaddr2picreg ());
|
||||
+ }
|
||||
+
|
||||
/* For SHcompact, we only have r0 for a scratch register: r1 is the
|
||||
static chain pointer (even if you can't have nested virtual functions
|
||||
right now, someone might implement them sometime), and the rest of the
|
||||
@@ -9188,8 +9197,24 @@ sh_output_mi_thunk (FILE *file, tree thu
|
||||
assemble_external (function);
|
||||
TREE_USED (function) = 1;
|
||||
}
|
||||
+ /* We can use scratch1 to save and restore the original value of
|
||||
+ PIC register except for SHcompact. */
|
||||
+ if (flag_pic && ! TARGET_SHCOMPACT)
|
||||
+ {
|
||||
+ emit_move_insn (scratch1,
|
||||
+ gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM));
|
||||
+ emit_insn (gen_GOTaddr2picreg ());
|
||||
+ }
|
||||
funexp = XEXP (DECL_RTL (function), 0);
|
||||
emit_move_insn (scratch2, funexp);
|
||||
+ if (flag_pic)
|
||||
+ {
|
||||
+ if (! TARGET_SHCOMPACT)
|
||||
+ emit_move_insn (gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM),
|
||||
+ scratch1);
|
||||
+ else
|
||||
+ pop (PIC_OFFSET_TABLE_REGNUM);
|
||||
+ }
|
||||
funexp = gen_rtx_MEM (FUNCTION_MODE, scratch2);
|
||||
sibcall = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX));
|
||||
SIBLING_CALL_P (sibcall) = 1;
|
||||
@@ -0,0 +1,13 @@
|
||||
--- g/gcc/config/sh/sh.h
|
||||
+++ g/gcc/config/sh/sh.h
|
||||
@@ -422,6 +422,10 @@
|
||||
do { \
|
||||
if (LEVEL) \
|
||||
flag_omit_frame_pointer = -1; \
|
||||
+ if (LEVEL <= 2) \
|
||||
+ { \
|
||||
+ flag_reorder_blocks = 0; \
|
||||
+ } \
|
||||
if (SIZE) \
|
||||
target_flags |= SPACE_BIT; \
|
||||
if (TARGET_SHMEDIA && LEVEL > 1) \
|
||||
@@ -0,0 +1,28 @@
|
||||
2005-03-24 J"orn Rennecke <joern.rennecke@st.com>
|
||||
|
||||
Band aid for PR target/20617:
|
||||
* config/sh/lib1funcs.asm (FUNC, ALIAS): Add .hidden directive.
|
||||
|
||||
--- g/gcc/config/sh/lib1funcs.asm
|
||||
+++ g/gcc/config/sh/lib1funcs.asm
|
||||
@@ -37,9 +37,19 @@ Boston, MA 02111-1307, USA. */
|
||||
ELF local label prefixes by J"orn Rennecke
|
||||
amylaar@cygnus.com */
|
||||
|
||||
+#define ALIAS(X,Y) .global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y)
|
||||
+
|
||||
#ifdef __ELF__
|
||||
#define LOCAL(X) .L_##X
|
||||
-#define FUNC(X) .type X,@function
|
||||
+
|
||||
+#if 1 /* ??? The export list mechanism is broken, everything that is not
|
||||
+ hidden is exported. */
|
||||
+#undef FUNC
|
||||
+#define FUNC(X) .type X,@function; .hidden X
|
||||
+#undef ALIAS
|
||||
+#define ALIAS(X,Y) .global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y); .hidden GLOBAL(X)
|
||||
+#endif
|
||||
+
|
||||
#define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X
|
||||
#define ENDFUNC(X) ENDFUNC0(X)
|
||||
#else
|
||||
@@ -0,0 +1,68 @@
|
||||
By Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Adds support for arm*b-linux* big-endian ARM targets
|
||||
|
||||
See http://gcc.gnu.org/PR16350
|
||||
|
||||
--- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h
|
||||
+++ gcc-3.4.1/gcc/config/arm/linux-elf.h
|
||||
@@ -30,17 +30,34 @@
|
||||
/* Do not assume anything about header files. */
|
||||
#define NO_IMPLICIT_EXTERN_C
|
||||
|
||||
+/*
|
||||
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
|
||||
+ * (big endian) configurations.
|
||||
+ */
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT
|
||||
+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
|
||||
+#define TARGET_ENDIAN_OPTION "mbig-endian"
|
||||
+#define TARGET_LINKER_EMULATION "armelfb_linux"
|
||||
+#else
|
||||
+#define TARGET_ENDIAN_DEFAULT 0
|
||||
+#define TARGET_ENDIAN_OPTION "mlittle-endian"
|
||||
+#define TARGET_LINKER_EMULATION "armelf_linux"
|
||||
+#endif
|
||||
+
|
||||
/* Default is to use APCS-32 mode. */
|
||||
#undef TARGET_DEFAULT
|
||||
-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
|
||||
+#define TARGET_DEFAULT \
|
||||
+ ( ARM_FLAG_APCS_32 | \
|
||||
+ ARM_FLAG_MMU_TRAPS | \
|
||||
+ TARGET_ENDIAN_DEFAULT )
|
||||
|
||||
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
|
||||
|
||||
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
|
||||
+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
|
||||
|
||||
#undef MULTILIB_DEFAULTS
|
||||
#define MULTILIB_DEFAULTS \
|
||||
- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
|
||||
+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
|
||||
|
||||
#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
|
||||
|
||||
@@ -101,7 +118,7 @@
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
|
||||
-X \
|
||||
- %{mbig-endian:-EB}" \
|
||||
+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
|
||||
SUBTARGET_EXTRA_LINK_SPEC
|
||||
#endif
|
||||
|
||||
--- gcc-3.4.1-dist/gcc/config.gcc
|
||||
+++ gcc-3.4.1/gcc/config.gcc
|
||||
@@ -672,6 +672,11 @@
|
||||
;;
|
||||
arm*-*-linux*) # ARM GNU/Linux with ELF
|
||||
tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
|
||||
+ case $target in
|
||||
+ arm*b-*)
|
||||
+ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
|
||||
+ ;;
|
||||
+ esac
|
||||
tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
|
||||
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
|
||||
gnu_ld=yes
|
||||
@@ -0,0 +1,6 @@
|
||||
--- gcc.orig/gcc/config/mips/t-linux 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ gcc/gcc/config/mips/t-linux 2004-08-26 18:28:12.000000000 +0200
|
||||
@@ -0,0 +1,3 @@
|
||||
+# Compile crtbegin/end with xgot so it works for both
|
||||
+# normal and large GOTs.
|
||||
+CRTSTUFF_T_CFLAGS = -mxgot
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
diff -u gcc-3.4.6/gcc/collect2.c.orig gcc-3.4.6/gcc/collect2.c
|
||||
--- gcc-3.4.6/gcc/collect2.c.orig 2009-05-05 20:37:56.000000000 -0600
|
||||
+++ gcc-3.4.6/gcc/collect2.c 2009-05-05 20:39:06.000000000 -0600
|
||||
@@ -1534,7 +1534,7 @@
|
||||
if (redir)
|
||||
{
|
||||
/* Open response file. */
|
||||
- redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
|
||||
+ redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, 0666);
|
||||
|
||||
/* Duplicate the stdout and stderr file handles
|
||||
so they can be restored later. */
|
||||
@@ -0,0 +1,270 @@
|
||||
Note... modified my mjn3 to not conflict with the big endian arm patch.
|
||||
Warning!!! Only the linux target is aware of TARGET_ENDIAN_DEFAULT.
|
||||
Also changed
|
||||
#define SUBTARGET_EXTRA_ASM_SPEC "\
|
||||
%{!mcpu=*:-mcpu=xscale} \
|
||||
%{mhard-float:-mfpu=fpa} \
|
||||
%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
|
||||
to
|
||||
#define SUBTARGET_EXTRA_ASM_SPEC "\
|
||||
%{mhard-float:-mfpu=fpa} \
|
||||
%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
|
||||
in gcc/config/arm/linux-elf.h.
|
||||
#
|
||||
# Submitted:
|
||||
#
|
||||
# Dimitry Andric <dimitry@andric.com>, 2004-05-01
|
||||
#
|
||||
# Description:
|
||||
#
|
||||
# Nicholas Pitre released this patch for gcc soft-float support here:
|
||||
# http://lists.arm.linux.org.uk/pipermail/linux-arm/2003-October/006436.html
|
||||
#
|
||||
# This version has been adapted to work with gcc 3.4.0.
|
||||
#
|
||||
# The original patch doesn't distinguish between softfpa and softvfp modes
|
||||
# in the way Nicholas Pitre probably meant. His description is:
|
||||
#
|
||||
# "Default is to use APCS-32 mode with soft-vfp. The old Linux default for
|
||||
# floats can be achieved with -mhard-float or with the configure
|
||||
# --with-float=hard option. If -msoft-float or --with-float=soft is used then
|
||||
# software float support will be used just like the default but with the legacy
|
||||
# big endian word ordering for double float representation instead."
|
||||
#
|
||||
# Which means the following:
|
||||
#
|
||||
# * If you compile without -mhard-float or -msoft-float, you should get
|
||||
# software floating point, using the VFP format. The produced object file
|
||||
# should have these flags in its header:
|
||||
#
|
||||
# private flags = 600: [APCS-32] [VFP float format] [software FP]
|
||||
#
|
||||
# * If you compile with -mhard-float, you should get hardware floating point,
|
||||
# which always uses the FPA format. Object file header flags should be:
|
||||
#
|
||||
# private flags = 0: [APCS-32] [FPA float format]
|
||||
#
|
||||
# * If you compile with -msoft-float, you should get software floating point,
|
||||
# using the FPA format. This is done for compatibility reasons with many
|
||||
# existing distributions. Object file header flags should be:
|
||||
#
|
||||
# private flags = 200: [APCS-32] [FPA float format] [software FP]
|
||||
#
|
||||
# The original patch from Nicholas Pitre contained the following constructs:
|
||||
#
|
||||
# #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
|
||||
# %{mhard-float:-mfpu=fpa} \
|
||||
# %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
|
||||
#
|
||||
# However, gcc doesn't accept this ";:" notation, used in the 3rd line. This
|
||||
# is probably the reason Robert Schwebel modified it to:
|
||||
#
|
||||
# #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
|
||||
# %{mhard-float:-mfpu=fpa} \
|
||||
# %{!mhard-float: %{msoft-float:-mfpu=softfpa -mfpu=softvfp}}"
|
||||
#
|
||||
# But this causes the following behaviour:
|
||||
#
|
||||
# * If you compile without -mhard-float or -msoft-float, the compiler generates
|
||||
# software floating point instructions, but *nothing* is passed to the
|
||||
# assembler, which results in an object file which has flags:
|
||||
#
|
||||
# private flags = 0: [APCS-32] [FPA float format]
|
||||
#
|
||||
# This is not correct!
|
||||
#
|
||||
# * If you compile with -mhard-float, the compiler generates hardware floating
|
||||
# point instructions, and passes "-mfpu=fpa" to the assembler, which results
|
||||
# in an object file which has the same flags as in the previous item, but now
|
||||
# those *are* correct.
|
||||
#
|
||||
# * If you compile with -msoft-float, the compiler generates software floating
|
||||
# point instructions, and passes "-mfpu=softfpa -mfpu=softvfp" (in that
|
||||
# order) to the assembler, which results in an object file with flags:
|
||||
#
|
||||
# private flags = 600: [APCS-32] [VFP float format] [software FP]
|
||||
#
|
||||
# This is not correct, because the last "-mfpu=" option on the assembler
|
||||
# command line determines the actual FPU convention used (which should be FPA
|
||||
# in this case).
|
||||
#
|
||||
# Therefore, I modified this patch to get the desired behaviour. Every
|
||||
# instance of the notation:
|
||||
#
|
||||
# %{msoft-float:-mfpu=softfpa -mfpu=softvfp}
|
||||
#
|
||||
# was changed to:
|
||||
#
|
||||
# %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}
|
||||
#
|
||||
# I also did the following:
|
||||
#
|
||||
# * Modified all TARGET_DEFAULT macros I could find to include ARM_FLAG_VFP, to
|
||||
# be consistent with Nicholas' original patch.
|
||||
# * Removed any "msoft-float" or "mhard-float" from all MULTILIB_DEFAULTS
|
||||
# macros I could find. I think that if you compile without any options, you
|
||||
# would like to get the defaults. :)
|
||||
# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
|
||||
# anymore. (The required functions are now in libgcc.)
|
||||
|
||||
diff -urN gcc-3.4.1-old/gcc/config/arm/coff.h gcc-3.4.1/gcc/config/arm/coff.h
|
||||
--- gcc-3.4.1-old/gcc/config/arm/coff.h 2004-02-24 08:25:22.000000000 -0600
|
||||
+++ gcc-3.4.1/gcc/config/arm/coff.h 2004-09-02 21:51:15.000000000 -0500
|
||||
@@ -31,11 +31,16 @@
|
||||
#define TARGET_VERSION fputs (" (ARM/coff)", stderr)
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
|
||||
+#define TARGET_DEFAULT \
|
||||
+ ( ARM_FLAG_SOFT_FLOAT \
|
||||
+ | ARM_FLAG_VFP \
|
||||
+ | ARM_FLAG_APCS_32 \
|
||||
+ | ARM_FLAG_APCS_FRAME \
|
||||
+ | ARM_FLAG_MMU_TRAPS )
|
||||
|
||||
#ifndef MULTILIB_DEFAULTS
|
||||
#define MULTILIB_DEFAULTS \
|
||||
- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
|
||||
+ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
|
||||
#endif
|
||||
|
||||
/* This is COFF, but prefer stabs. */
|
||||
diff -urN gcc-3.4.1-old/gcc/config/arm/elf.h gcc-3.4.1/gcc/config/arm/elf.h
|
||||
--- gcc-3.4.1-old/gcc/config/arm/elf.h 2004-02-24 08:25:22.000000000 -0600
|
||||
+++ gcc-3.4.1/gcc/config/arm/elf.h 2004-09-02 21:51:15.000000000 -0500
|
||||
@@ -46,7 +46,9 @@
|
||||
|
||||
#ifndef SUBTARGET_ASM_FLOAT_SPEC
|
||||
#define SUBTARGET_ASM_FLOAT_SPEC "\
|
||||
-%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
|
||||
+%{mapcs-float:-mfloat} \
|
||||
+%{mhard-float:-mfpu=fpa} \
|
||||
+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
|
||||
#endif
|
||||
|
||||
#ifndef ASM_SPEC
|
||||
@@ -106,12 +108,17 @@
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DEFAULT
|
||||
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
|
||||
+#define TARGET_DEFAULT \
|
||||
+ ( ARM_FLAG_SOFT_FLOAT \
|
||||
+ | ARM_FLAG_VFP \
|
||||
+ | ARM_FLAG_APCS_32 \
|
||||
+ | ARM_FLAG_APCS_FRAME \
|
||||
+ | ARM_FLAG_MMU_TRAPS )
|
||||
#endif
|
||||
|
||||
#ifndef MULTILIB_DEFAULTS
|
||||
#define MULTILIB_DEFAULTS \
|
||||
- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
|
||||
+ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
|
||||
#endif
|
||||
|
||||
#define TARGET_ASM_FILE_START_APP_OFF true
|
||||
diff -urN gcc-3.4.1-old/gcc/config/arm/linux-elf.h gcc-3.4.1/gcc/config/arm/linux-elf.h
|
||||
--- gcc-3.4.1-old/gcc/config/arm/linux-elf.h 2004-09-02 21:50:52.000000000 -0500
|
||||
+++ gcc-3.4.1/gcc/config/arm/linux-elf.h 2004-09-02 22:00:49.000000000 -0500
|
||||
@@ -44,12 +44,26 @@
|
||||
#define TARGET_LINKER_EMULATION "armelf_linux"
|
||||
#endif
|
||||
|
||||
-/* Default is to use APCS-32 mode. */
|
||||
+/*
|
||||
+ * Default is to use APCS-32 mode with soft-vfp.
|
||||
+ * The old Linux default for floats can be achieved with -mhard-float
|
||||
+ * or with the configure --with-float=hard option.
|
||||
+ * If -msoft-float or --with-float=soft is used then software float
|
||||
+ * support will be used just like the default but with the legacy
|
||||
+ * big endian word ordering for double float representation instead.
|
||||
+ */
|
||||
#undef TARGET_DEFAULT
|
||||
-#define TARGET_DEFAULT \
|
||||
- ( ARM_FLAG_APCS_32 | \
|
||||
- ARM_FLAG_MMU_TRAPS | \
|
||||
- TARGET_ENDIAN_DEFAULT )
|
||||
+#define TARGET_DEFAULT \
|
||||
+ ( ARM_FLAG_APCS_32 \
|
||||
+ | ARM_FLAG_SOFT_FLOAT \
|
||||
+ | TARGET_ENDIAN_DEFAULT \
|
||||
+ | ARM_FLAG_VFP \
|
||||
+ | ARM_FLAG_MMU_TRAPS )
|
||||
+
|
||||
+#undef SUBTARGET_EXTRA_ASM_SPEC
|
||||
+#define SUBTARGET_EXTRA_ASM_SPEC "\
|
||||
+%{mhard-float:-mfpu=fpa} \
|
||||
+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
|
||||
|
||||
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
|
||||
|
||||
@@ -57,7 +71,7 @@
|
||||
|
||||
#undef MULTILIB_DEFAULTS
|
||||
#define MULTILIB_DEFAULTS \
|
||||
- { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
|
||||
+ { "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" }
|
||||
|
||||
#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
|
||||
|
||||
@@ -72,7 +86,7 @@
|
||||
%{shared:-lc} \
|
||||
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
|
||||
|
||||
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
|
||||
+#define LIBGCC_SPEC "-lgcc"
|
||||
|
||||
/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
|
||||
the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
|
||||
diff -urN gcc-3.4.1-old/gcc/config/arm/t-linux gcc-3.4.1/gcc/config/arm/t-linux
|
||||
--- gcc-3.4.1-old/gcc/config/arm/t-linux 2003-09-20 16:09:07.000000000 -0500
|
||||
+++ gcc-3.4.1/gcc/config/arm/t-linux 2004-09-02 21:51:15.000000000 -0500
|
||||
@@ -4,7 +4,10 @@
|
||||
LIBGCC2_DEBUG_CFLAGS = -g0
|
||||
|
||||
LIB1ASMSRC = arm/lib1funcs.asm
|
||||
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
|
||||
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
|
||||
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
|
||||
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
|
||||
+ _fixsfsi _fixunssfsi
|
||||
|
||||
# MULTILIB_OPTIONS = mhard-float/msoft-float
|
||||
# MULTILIB_DIRNAMES = hard-float soft-float
|
||||
diff -urN gcc-3.4.1-old/gcc/config/arm/unknown-elf.h gcc-3.4.1/gcc/config/arm/unknown-elf.h
|
||||
--- gcc-3.4.1-old/gcc/config/arm/unknown-elf.h 2004-02-24 08:25:22.000000000 -0600
|
||||
+++ gcc-3.4.1/gcc/config/arm/unknown-elf.h 2004-09-02 21:51:15.000000000 -0500
|
||||
@@ -30,7 +30,12 @@
|
||||
|
||||
/* Default to using APCS-32 and software floating point. */
|
||||
#ifndef TARGET_DEFAULT
|
||||
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
|
||||
+#define TARGET_DEFAULT \
|
||||
+ ( ARM_FLAG_SOFT_FLOAT \
|
||||
+ | ARM_FLAG_VFP \
|
||||
+ | ARM_FLAG_APCS_32 \
|
||||
+ | ARM_FLAG_APCS_FRAME \
|
||||
+ | ARM_FLAG_MMU_TRAPS )
|
||||
#endif
|
||||
|
||||
/* Now we define the strings used to build the spec file. */
|
||||
diff -urN gcc-3.4.1-old/gcc/config/arm/xscale-elf.h gcc-3.4.1/gcc/config/arm/xscale-elf.h
|
||||
--- gcc-3.4.1-old/gcc/config/arm/xscale-elf.h 2003-07-01 18:26:43.000000000 -0500
|
||||
+++ gcc-3.4.1/gcc/config/arm/xscale-elf.h 2004-09-02 21:51:15.000000000 -0500
|
||||
@@ -49,11 +49,12 @@
|
||||
endian, regardless of the endian-ness of the memory
|
||||
system. */
|
||||
|
||||
-#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
|
||||
- %{mhard-float:-mfpu=fpa} \
|
||||
- %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
|
||||
+#define SUBTARGET_EXTRA_ASM_SPEC "\
|
||||
+%{!mcpu=*:-mcpu=xscale} \
|
||||
+%{mhard-float:-mfpu=fpa} \
|
||||
+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
|
||||
|
||||
#ifndef MULTILIB_DEFAULTS
|
||||
#define MULTILIB_DEFAULTS \
|
||||
- { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
|
||||
+ { "mlittle-endian", "mno-thumb-interwork", "marm" }
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
# DP: Build and install libstdc++_pic.a library.
|
||||
|
||||
--- gcc/libstdc++-v3/src/Makefile.am
|
||||
+++ gcc/libstdc++-v3/src/Makefile.am
|
||||
@@ -214,6 +214,12 @@
|
||||
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
|
||||
+install-exec-local:
|
||||
+ifeq ($(enable_shared),yes)
|
||||
+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
|
||||
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
|
||||
+endif
|
||||
+
|
||||
# Added bits to build debug library.
|
||||
if GLIBCXX_BUILD_DEBUG
|
||||
all-local: build_debug
|
||||
--- gcc/libstdc++-v3/src/Makefile.in
|
||||
+++ gcc/libstdc++-v3/src/Makefile.in
|
||||
@@ -627,7 +627,7 @@
|
||||
|
||||
install-data-am: install-data-local
|
||||
|
||||
-install-exec-am: install-toolexeclibLTLIBRARIES
|
||||
+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
@@ -660,6 +660,7 @@
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-data-local install-exec \
|
||||
+ install-exec-local \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip install-toolexeclibLTLIBRARIES installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
@@ -743,6 +743,13 @@
|
||||
install_debug:
|
||||
(cd ${debugdir} && $(MAKE) \
|
||||
toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
|
||||
+
|
||||
+install-exec-local:
|
||||
+ifeq ($(enable_shared),yes)
|
||||
+ $(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
|
||||
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
|
||||
+endif
|
||||
+
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,24 @@
|
||||
--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps 2006-03-24 01:49:51 +0100
|
||||
+++ gcc-4.1.0/libstdc++-v3/include/ext/rope 2006-03-24 01:49:37 +0100
|
||||
@@ -59,6 +59,9 @@
|
||||
#include <bits/allocator.h>
|
||||
#include <ext/hash_fun.h>
|
||||
|
||||
+/* cope w/ index defined as macro, SuSv3 proposal */
|
||||
+#undef index
|
||||
+
|
||||
# ifdef __GC
|
||||
# define __GC_CONST const
|
||||
# else
|
||||
--- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps 2006-03-24 01:50:04 +0100
|
||||
+++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h 2006-03-24 01:50:28 +0100
|
||||
@@ -53,6 +53,9 @@
|
||||
#include <ext/memory> // For uninitialized_copy_n
|
||||
#include <ext/numeric> // For power
|
||||
|
||||
+/* cope w/ index defined as macro, SuSv3 proposal */
|
||||
+#undef index
|
||||
+
|
||||
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
|
||||
using std::size_t;
|
||||
@@ -0,0 +1,49 @@
|
||||
Index: gcc-4.2/libmudflap/mf-hooks2.c
|
||||
===================================================================
|
||||
--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
|
||||
+++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
|
||||
@@ -427,7 +427,7 @@
|
||||
{
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
|
||||
- bzero (s, n);
|
||||
+ memset (s, 0, n);
|
||||
}
|
||||
|
||||
|
||||
@@ -437,7 +437,7 @@
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
|
||||
MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
|
||||
- bcopy (src, dest, n);
|
||||
+ memmove (dest, src, n);
|
||||
}
|
||||
|
||||
|
||||
@@ -447,7 +447,7 @@
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
|
||||
MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
|
||||
- return bcmp (s1, s2, n);
|
||||
+ return n == 0 ? 0 : memcmp (s1, s2, n);
|
||||
}
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@
|
||||
size_t n = strlen (s);
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
|
||||
- return index (s, c);
|
||||
+ return strchr (s, c);
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@
|
||||
size_t n = strlen (s);
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
|
||||
- return rindex (s, c);
|
||||
+ return strrchr (s, c);
|
||||
}
|
||||
|
||||
/* XXX: stpcpy, memccpy */
|
||||
@@ -0,0 +1,26 @@
|
||||
This patch fixes a bug into ostream::operator<<(double) due to the wrong size
|
||||
passed into the __convert_from_v method. The wrong size is then passed to
|
||||
std::snprintf function, that, on uClibc, doens't handle sized 0 buffer.
|
||||
|
||||
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
||||
|
||||
--- gcc-4.2.1/libstdc++-v3/include/bits/locale_facets.tcc 2006-10-17 18:43:47.000000000 +0200
|
||||
+++ gcc-4.2.1-st/libstdc++-v3/include/bits/locale_facets.tcc 2007-08-22 18:54:23.000000000 +0200
|
||||
@@ -1143,7 +1143,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
||||
const int __cs_size = __fixed ? __max_exp + __prec + 4
|
||||
: __max_digits * 2 + __prec;
|
||||
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
|
||||
- __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
|
||||
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf,
|
||||
__prec, __v);
|
||||
#endif
|
||||
|
||||
@@ -1777,7 +1777,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
||||
// max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
|
||||
const int __cs_size = numeric_limits<long double>::max_exponent10 + 3;
|
||||
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
|
||||
- int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf",
|
||||
+ int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, "%.*Lf",
|
||||
0, __units);
|
||||
#endif
|
||||
string_type __digits(__len, char_type());
|
||||
@@ -0,0 +1,13 @@
|
||||
Index: gcc-4.2/gcc/Makefile.in
|
||||
===================================================================
|
||||
--- gcc-4.2/gcc/Makefile.in (revision 121758)
|
||||
+++ gcc-4.2/gcc/Makefile.in (working copy)
|
||||
@@ -2658,7 +2658,7 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H)
|
||||
# FIXME: writing proper dependencies for this is a *LOT* of work.
|
||||
libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
|
||||
insn-config.h insn-flags.h insn-codes.h insn-constants.h \
|
||||
- insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
|
||||
+ insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
|
||||
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
|
||||
-DTARGET_NAME=\"$(target_noncanonical)\" \
|
||||
-DLOCALEDIR=\"$(localedir)\" \
|
||||
@@ -0,0 +1,67 @@
|
||||
By Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Adds support for arm*b-linux* big-endian ARM targets
|
||||
|
||||
See http://gcc.gnu.org/PR16350
|
||||
|
||||
--- gcc-4.2.0/gcc/config/arm/linux-elf.h
|
||||
+++ gcc-4.2.0/gcc/config/arm/linux-elf.h
|
||||
@@ -28,19 +28,33 @@
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
|
||||
|
||||
+/*
|
||||
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
|
||||
+ * (big endian) configurations.
|
||||
+ */
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT
|
||||
+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
|
||||
+#define TARGET_ENDIAN_OPTION "mbig-endian"
|
||||
+#define TARGET_LINKER_EMULATION "armelfb_linux"
|
||||
+#else
|
||||
+#define TARGET_ENDIAN_DEFAULT 0
|
||||
+#define TARGET_ENDIAN_OPTION "mlittle-endian"
|
||||
+#define TARGET_LINKER_EMULATION "armelf_linux"
|
||||
+#endif
|
||||
+
|
||||
#undef TARGET_DEFAULT_FLOAT_ABI
|
||||
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
-#define TARGET_DEFAULT (0)
|
||||
+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
|
||||
|
||||
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
|
||||
|
||||
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
|
||||
+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
|
||||
|
||||
#undef MULTILIB_DEFAULTS
|
||||
#define MULTILIB_DEFAULTS \
|
||||
- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
|
||||
+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
|
||||
|
||||
/* Now we define the strings used to build the spec file. */
|
||||
#undef LIB_SPEC
|
||||
@@ -61,7 +75,7 @@
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
|
||||
-X \
|
||||
- %{mbig-endian:-EB}" \
|
||||
+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
|
||||
SUBTARGET_EXTRA_LINK_SPEC
|
||||
|
||||
#undef LINK_SPEC
|
||||
--- gcc-4.2.0/gcc/config.gcc.orig 2006-09-22 14:53:41.000000000 +0200
|
||||
+++ gcc-4.2.0/gcc/config.gcc 2006-09-25 10:45:21.000000000 +0200
|
||||
@@ -696,6 +696,11 @@
|
||||
tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
|
||||
tmake_file="${tmake_file} t-linux arm/t-arm"
|
||||
case ${target} in
|
||||
+ arm*b-*)
|
||||
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
|
||||
+ ;;
|
||||
+ esac
|
||||
+ case ${target} in
|
||||
arm*-*-linux-*eabi)
|
||||
tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
|
||||
tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
|
||||
@@ -0,0 +1,153 @@
|
||||
Hi,
|
||||
|
||||
The attached patch makes sure that we create smaller object code for
|
||||
simple switch statements. We just make sure to flatten the switch
|
||||
statement into an if-else chain, basically.
|
||||
|
||||
This fixes a size-regression as compared to gcc-3.4, as can be seen
|
||||
below.
|
||||
|
||||
2007-04-15 Bernhard Fischer <..>
|
||||
|
||||
* stmt.c (expand_case): Do not create a complex binary tree when
|
||||
optimizing for size but rather use the simple ordered list.
|
||||
(emit_case_nodes): do not emit jumps to the default_label when
|
||||
optimizing for size.
|
||||
|
||||
Not regtested so far.
|
||||
Comments?
|
||||
|
||||
Attached is the test switch.c mentioned below.
|
||||
|
||||
$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
|
||||
gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
|
||||
$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
|
||||
gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
|
||||
|
||||
$ size switch-*.o
|
||||
text data bss dec hex filename
|
||||
169 0 0 169 a9 switch-2.95.o
|
||||
115 0 0 115 73 switch-3.3.o
|
||||
103 0 0 103 67 switch-3.4.o
|
||||
124 0 0 124 7c switch-4.0.o
|
||||
124 0 0 124 7c switch-4.1.o
|
||||
124 0 0 124 7c switch-4.2.orig-HEAD.o
|
||||
95 0 0 95 5f switch-4.3-HEAD.o
|
||||
124 0 0 124 7c switch-4.3.orig-HEAD.o
|
||||
166 0 0 166 a6 switch-CHAIN-2.95.o
|
||||
111 0 0 111 6f switch-CHAIN-3.3.o
|
||||
95 0 0 95 5f switch-CHAIN-3.4.o
|
||||
95 0 0 95 5f switch-CHAIN-4.0.o
|
||||
95 0 0 95 5f switch-CHAIN-4.1.o
|
||||
95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
|
||||
95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
|
||||
95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
|
||||
|
||||
|
||||
Content-Type: text/x-diff; charset=us-ascii
|
||||
Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
|
||||
|
||||
Index: gcc-4.2.0/gcc/stmt.c
|
||||
===================================================================
|
||||
--- gcc-4.2.0.orig/gcc/stmt.c (revision 123843)
|
||||
+++ gcc-4.2.0/gcc/stmt.c (working copy)
|
||||
@@ -2517,7 +2517,11 @@ expand_case (tree exp)
|
||||
use_cost_table
|
||||
= (TREE_CODE (orig_type) != ENUMERAL_TYPE
|
||||
&& estimate_case_costs (case_list));
|
||||
- balance_case_nodes (&case_list, NULL);
|
||||
+ /* When optimizing for size, we want a straight list to avoid
|
||||
+ jumps as much as possible. This basically creates an if-else
|
||||
+ chain. */
|
||||
+ if (!optimize_size)
|
||||
+ balance_case_nodes (&case_list, NULL);
|
||||
emit_case_nodes (index, case_list, default_label, index_type);
|
||||
emit_jump (default_label);
|
||||
}
|
||||
@@ -3075,6 +3079,7 @@ emit_case_nodes (rtx index, case_node_pt
|
||||
{
|
||||
if (!node_has_low_bound (node, index_type))
|
||||
{
|
||||
+ if (!optimize_size) /* don't jl to the .default_label. */
|
||||
emit_cmp_and_jump_insns (index,
|
||||
convert_modes
|
||||
(mode, imode,
|
||||
|
||||
|
||||
Content-Type: text/x-csrc; charset=us-ascii
|
||||
Content-Disposition: attachment; filename="switch.c"
|
||||
|
||||
int
|
||||
commutative_tree_code (int code)
|
||||
{
|
||||
#define CASE(val, ret) case val:/* __asm__("# val="#val ",ret="#ret);*/ return ret;
|
||||
#ifndef CHAIN
|
||||
switch (code)
|
||||
{
|
||||
# if 1
|
||||
CASE(1,3)
|
||||
CASE(3,2)
|
||||
CASE(5,8)
|
||||
CASE(7,1)
|
||||
CASE(33,4)
|
||||
CASE(44,9)
|
||||
CASE(55,10)
|
||||
CASE(66,-1)
|
||||
CASE(77,99)
|
||||
CASE(666,0)
|
||||
# else
|
||||
case 1:
|
||||
return 3;
|
||||
case 3:
|
||||
return 2;
|
||||
case 5:
|
||||
return 8;
|
||||
case 7:
|
||||
return 1;
|
||||
case 33:
|
||||
return 4;
|
||||
case 44:
|
||||
return 9;
|
||||
case 55:
|
||||
return 10;
|
||||
case 66:
|
||||
return -1;
|
||||
case 77:
|
||||
return 99;
|
||||
case 666:
|
||||
return 0;
|
||||
# endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 4711;
|
||||
|
||||
#else
|
||||
if (code == 1)
|
||||
return 3;
|
||||
else if (code == 3)
|
||||
return 2;
|
||||
else if (code == 5)
|
||||
return 8;
|
||||
else if (code == 7)
|
||||
return 1;
|
||||
else if (code == 33)
|
||||
return 4;
|
||||
else if (code == 44)
|
||||
return 9;
|
||||
else if (code == 55)
|
||||
return 10;
|
||||
else if (code == 66)
|
||||
return -1;
|
||||
else if (code == 77)
|
||||
return 99;
|
||||
else if (code == 666)
|
||||
return 0;
|
||||
else
|
||||
return 4711;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
--AhhlLboLdkugWU4S--
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
--- gcc-4.2-20061205/gcc/config/arm/t-linux 2006-12-08 15:18:33.000000000 -0800
|
||||
+++ gcc-4.2-20061205/gcc/config/arm/t-linux 2006-12-08 15:18:33.000000000 -0800
|
||||
@@ -4,7 +4,10 @@
|
||||
LIBGCC2_DEBUG_CFLAGS = -g0
|
||||
|
||||
LIB1ASMSRC = arm/lib1funcs.asm
|
||||
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
|
||||
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
|
||||
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
|
||||
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
|
||||
+ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf
|
||||
|
||||
# MULTILIB_OPTIONS = mhard-float/msoft-float
|
||||
# MULTILIB_DIRNAMES = hard-float soft-float
|
||||
|
||||
--- gcc-4.2-20061205/gcc/config/arm/linux-elf.h 2006-12-08 15:18:33.000000000 -0800
|
||||
+++ gcc-4.2-20061205/gcc/config/arm/linux-elf.h 2006-12-08 15:18:33.000000000 -0800
|
||||
@@ -63,7 +63,7 @@
|
||||
%{shared:-lc} \
|
||||
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
|
||||
|
||||
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
|
||||
+#define LIBGCC_SPEC "-lgcc"
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
|
||||
--- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c 2007-03-05 11:54:00.000000000 -0500
|
||||
+++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c 2008-01-31 17:51:24.000000000 -0500
|
||||
@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
|
||||
but GCC currently generates poor code when a union is used to turn
|
||||
a long double into a pair of doubles. */
|
||||
|
||||
+#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
|
||||
+
|
||||
long double __gcc_qadd (double, double, double, double);
|
||||
long double __gcc_qsub (double, double, double, double);
|
||||
long double __gcc_qmul (double, double, double, double);
|
||||
@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
|
||||
return z.ldval;
|
||||
}
|
||||
|
||||
-#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
|
||||
-
|
||||
long double __gcc_qneg (double, double);
|
||||
int __gcc_qeq (double, double, double, double);
|
||||
int __gcc_qne (double, double, double, double);
|
||||
@@ -0,0 +1,30 @@
|
||||
At present, libstdc++ will not build. My understanding is that it needs to have
|
||||
the NuttX libc characterized in crossconfig.m4. This is a first attempt to do that --
|
||||
unfortunately, it still does not work.
|
||||
|
||||
diff -u gcc-4.2.4/libstdc++-v3/configure.orig gcc-4.2.4/libstdc++-v3/configure
|
||||
--- gcc-4.2.4/libstdc++-v3/configure.orig 2009-01-05 17:52:11.000000000 -0600
|
||||
+++ gcc-4.2.4/libstdc++-v3/configure 2009-01-05 17:52:43.000000000 -0600
|
||||
@@ -108515,9 +108515,7 @@
|
||||
|
||||
;;
|
||||
*)
|
||||
- { { echo "$as_me:$LINENO: error: No support for this host/target combination." >&5
|
||||
-echo "$as_me: error: No support for this host/target combination." >&2;}
|
||||
- { (exit 1); exit 1; }; }
|
||||
+ # Assume bare hardware
|
||||
;;
|
||||
esac
|
||||
|
||||
diff -u gcc-4.2.4/libstdc++-v3/crossconfig.m4.orig gcc-4.2.4/libstdc++-v3/crossconfig.m4
|
||||
--- gcc-4.2.4/libstdc++-v3/crossconfig.m4.orig 2009-01-05 17:51:07.000000000 -0600
|
||||
+++ gcc-4.2.4/libstdc++-v3/crossconfig.m4 2009-01-05 17:52:02.000000000 -0600
|
||||
@@ -412,7 +412,7 @@
|
||||
AC_DEFINE(HAVE_TANHL)
|
||||
;;
|
||||
*)
|
||||
- AC_MSG_ERROR([No support for this host/target combination.])
|
||||
+ # Assume bare hardware
|
||||
;;
|
||||
esac
|
||||
])
|
||||
@@ -0,0 +1,13 @@
|
||||
--- gcc-4.2.4/configure.orig 2009-04-18 18:07:18.250951700 -0400
|
||||
+++ gcc-4.2.4/configure 2009-04-18 18:20:20.369521100 -0400
|
||||
@@ -1649,6 +1649,10 @@
|
||||
;;
|
||||
esac
|
||||
|
||||
+# If we are building against NuttX, then don't attempt to build libstdc++
|
||||
+# (should be conditioned on --with-nuttx)
|
||||
+noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3"
|
||||
+
|
||||
# If we aren't building newlib, then don't build libgloss, since libgloss
|
||||
# depends upon some newlib header files.
|
||||
case "${noconfigdirs}" in
|
||||
@@ -0,0 +1,49 @@
|
||||
Index: gcc-4.2/libmudflap/mf-hooks2.c
|
||||
===================================================================
|
||||
--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
|
||||
+++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
|
||||
@@ -427,7 +427,7 @@
|
||||
{
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
|
||||
- bzero (s, n);
|
||||
+ memset (s, 0, n);
|
||||
}
|
||||
|
||||
|
||||
@@ -437,7 +437,7 @@
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
|
||||
MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
|
||||
- bcopy (src, dest, n);
|
||||
+ memmove (dest, src, n);
|
||||
}
|
||||
|
||||
|
||||
@@ -447,7 +447,7 @@
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
|
||||
MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
|
||||
- return bcmp (s1, s2, n);
|
||||
+ return n == 0 ? 0 : memcmp (s1, s2, n);
|
||||
}
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@
|
||||
size_t n = strlen (s);
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
|
||||
- return index (s, c);
|
||||
+ return strchr (s, c);
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@
|
||||
size_t n = strlen (s);
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
|
||||
- return rindex (s, c);
|
||||
+ return strrchr (s, c);
|
||||
}
|
||||
|
||||
/* XXX: stpcpy, memccpy */
|
||||
@@ -0,0 +1,29 @@
|
||||
Index: gcc-4.3.0/gcc/config/arm/t-linux
|
||||
===================================================================
|
||||
--- gcc-4.3.0/gcc/config/arm/t-linux (revision 129896)
|
||||
+++ gcc-4.3.0/gcc/config/arm/t-linux (working copy)
|
||||
@@ -3,7 +3,10 @@
|
||||
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
|
||||
|
||||
LIB1ASMSRC = arm/lib1funcs.asm
|
||||
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
|
||||
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
|
||||
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
|
||||
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
|
||||
+ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf
|
||||
|
||||
# MULTILIB_OPTIONS = mhard-float/msoft-float
|
||||
# MULTILIB_DIRNAMES = hard-float soft-float
|
||||
Index: gcc-4.3.0/gcc/config/arm/linux-elf.h
|
||||
===================================================================
|
||||
--- gcc-4.3.0/gcc/config/arm/linux-elf.h (revision 129896)
|
||||
+++ gcc-4.3.0/gcc/config/arm/linux-elf.h (working copy)
|
||||
@@ -48,7 +62,7 @@
|
||||
%{shared:-lc} \
|
||||
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
|
||||
|
||||
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
|
||||
+#define LIBGCC_SPEC "-lgcc"
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- gcc-4.3.2.orig/gcc/regrename.c 2007-09-09 04:23:47.000000000 +0200
|
||||
+++ gcc-4.3.2/gcc/regrename.c 2009-02-05 10:23:59.000000000 +0100
|
||||
@@ -813,7 +813,7 @@
|
||||
OP_IN, 0);
|
||||
|
||||
for (i = 0; i < recog_data.n_dups; i++)
|
||||
- *recog_data.dup_loc[i] = copy_rtx (old_dups[i]);
|
||||
+ *recog_data.dup_loc[i] = old_dups[i];
|
||||
for (i = 0; i < n_ops; i++)
|
||||
*recog_data.operand_loc[i] = old_operands[i];
|
||||
if (recog_data.n_dups)
|
||||
@@ -0,0 +1,188 @@
|
||||
Index: gcc-4.3.2/gcc/tree-scalar-evolution.c
|
||||
===================================================================
|
||||
--- gcc-4.3.2.orig/gcc/tree-scalar-evolution.c 2009-01-28 10:14:37.000000000 +0100
|
||||
+++ gcc-4.3.2/gcc/tree-scalar-evolution.c 2009-01-28 10:17:50.000000000 +0100
|
||||
@@ -2716,6 +2716,50 @@
|
||||
scalar_evolution_info = NULL;
|
||||
}
|
||||
|
||||
+/* Returns true if the expression EXPR is considered to be too expensive
|
||||
+ for scev_const_prop. */
|
||||
+
|
||||
+bool
|
||||
+expression_expensive_p (tree expr)
|
||||
+{
|
||||
+ enum tree_code code;
|
||||
+
|
||||
+ if (is_gimple_val (expr))
|
||||
+ return false;
|
||||
+
|
||||
+ code = TREE_CODE (expr);
|
||||
+ if (code == TRUNC_DIV_EXPR
|
||||
+ || code == CEIL_DIV_EXPR
|
||||
+ || code == FLOOR_DIV_EXPR
|
||||
+ || code == ROUND_DIV_EXPR
|
||||
+ || code == TRUNC_MOD_EXPR
|
||||
+ || code == CEIL_MOD_EXPR
|
||||
+ || code == FLOOR_MOD_EXPR
|
||||
+ || code == ROUND_MOD_EXPR
|
||||
+ || code == EXACT_DIV_EXPR)
|
||||
+ {
|
||||
+ /* Division by power of two is usually cheap, so we allow it.
|
||||
+ Forbid anything else. */
|
||||
+ if (!integer_pow2p (TREE_OPERAND (expr, 1)))
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ switch (TREE_CODE_CLASS (code))
|
||||
+ {
|
||||
+ case tcc_binary:
|
||||
+ case tcc_comparison:
|
||||
+ if (expression_expensive_p (TREE_OPERAND (expr, 1)))
|
||||
+ return true;
|
||||
+
|
||||
+ /* Fallthru. */
|
||||
+ case tcc_unary:
|
||||
+ return expression_expensive_p (TREE_OPERAND (expr, 0));
|
||||
+
|
||||
+ default:
|
||||
+ return true;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* Replace ssa names for that scev can prove they are constant by the
|
||||
appropriate constants. Also perform final value replacement in loops,
|
||||
in case the replacement expressions are cheap.
|
||||
@@ -2802,12 +2846,6 @@
|
||||
continue;
|
||||
|
||||
niter = number_of_latch_executions (loop);
|
||||
- /* We used to check here whether the computation of NITER is expensive,
|
||||
- and avoided final value elimination if that is the case. The problem
|
||||
- is that it is hard to evaluate whether the expression is too
|
||||
- expensive, as we do not know what optimization opportunities the
|
||||
- the elimination of the final value may reveal. Therefore, we now
|
||||
- eliminate the final values of induction variables unconditionally. */
|
||||
if (niter == chrec_dont_know)
|
||||
continue;
|
||||
|
||||
@@ -2838,7 +2876,15 @@
|
||||
/* Moving the computation from the loop may prolong life range
|
||||
of some ssa names, which may cause problems if they appear
|
||||
on abnormal edges. */
|
||||
- || contains_abnormal_ssa_name_p (def))
|
||||
+ || contains_abnormal_ssa_name_p (def)
|
||||
+ /* Do not emit expensive expressions. The rationale is that
|
||||
+ when someone writes a code like
|
||||
+
|
||||
+ while (n > 45) n -= 45;
|
||||
+
|
||||
+ he probably knows that n is not large, and does not want it
|
||||
+ to be turned into n %= 45. */
|
||||
+ || expression_expensive_p (def))
|
||||
continue;
|
||||
|
||||
/* Eliminate the PHI node and replace it by a computation outside
|
||||
Index: gcc-4.3.2/gcc/tree-scalar-evolution.h
|
||||
===================================================================
|
||||
--- gcc-4.3.2.orig/gcc/tree-scalar-evolution.h 2009-01-28 10:22:47.000000000 +0100
|
||||
+++ gcc-4.3.2/gcc/tree-scalar-evolution.h 2009-01-28 10:23:10.000000000 +0100
|
||||
@@ -35,6 +35,7 @@
|
||||
extern void scev_analysis (void);
|
||||
unsigned int scev_const_prop (void);
|
||||
|
||||
+bool expression_expensive_p (tree);
|
||||
extern bool simple_iv (struct loop *, tree, tree, affine_iv *, bool);
|
||||
|
||||
/* Returns the loop of the polynomial chrec CHREC. */
|
||||
Index: gcc-4.3.2/gcc/testsuite/gcc.dg/pr34027-1.c
|
||||
===================================================================
|
||||
--- gcc-4.3.2.orig/gcc/testsuite/gcc.dg/pr34027-1.c 2009-01-28 10:24:09.000000000 +0100
|
||||
+++ gcc-4.3.2/gcc/testsuite/gcc.dg/pr34027-1.c 2009-01-28 10:24:43.000000000 +0100
|
||||
@@ -8,5 +8,9 @@
|
||||
return ns;
|
||||
}
|
||||
|
||||
-/* { dg-final { scan-tree-dump "ns % 10000" "optimized" } } */
|
||||
+/* This test was originally introduced to test that we transform
|
||||
+ to ns % 10000. See the discussion of PR 32044 why we do not do
|
||||
+ that anymore. */
|
||||
+/* { dg-final { scan-tree-dump-times "%" 0 "optimized" } } */
|
||||
+/* { dg-final { scan-tree-dump-times "/" 0 "optimized" } } */
|
||||
/* { dg-final { cleanup-tree-dump "optimized" } } */
|
||||
Index: gcc-4.3.2/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ gcc-4.3.2/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c 2009-01-28 10:25:50.000000000 +0100
|
||||
@@ -0,0 +1,55 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -fdump-tree-empty -fdump-tree-final_cleanup" } */
|
||||
+
|
||||
+int foo (int n)
|
||||
+{
|
||||
+ while (n >= 45)
|
||||
+ n -= 45;
|
||||
+
|
||||
+ return n;
|
||||
+}
|
||||
+
|
||||
+int bar (int n)
|
||||
+{
|
||||
+ while (n >= 64)
|
||||
+ n -= 64;
|
||||
+
|
||||
+ return n;
|
||||
+}
|
||||
+
|
||||
+int bla (int n)
|
||||
+{
|
||||
+ int i = 0;
|
||||
+
|
||||
+ while (n >= 45)
|
||||
+ {
|
||||
+ i++;
|
||||
+ n -= 45;
|
||||
+ }
|
||||
+
|
||||
+ return i;
|
||||
+}
|
||||
+
|
||||
+int baz (int n)
|
||||
+{
|
||||
+ int i = 0;
|
||||
+
|
||||
+ while (n >= 64)
|
||||
+ {
|
||||
+ i++;
|
||||
+ n -= 64;
|
||||
+ }
|
||||
+
|
||||
+ return i;
|
||||
+}
|
||||
+
|
||||
+/* The loops computing division/modulo by 64 should be eliminated. */
|
||||
+/* { dg-final { scan-tree-dump-times "Removing empty loop" 2 "empty" } } */
|
||||
+
|
||||
+/* There should be no division/modulo in the final dump (division and modulo
|
||||
+ by 64 are done using bit operations). */
|
||||
+/* { dg-final { scan-tree-dump-times "/" 0 "final_cleanup" } } */
|
||||
+/* { dg-final { scan-tree-dump-times "%" 0 "final_cleanup" } } */
|
||||
+
|
||||
+/* { dg-final { cleanup-tree-dump "empty" } } */
|
||||
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
|
||||
Index: gcc-4.3.2/gcc/tree-ssa-loop-ivopts.c
|
||||
===================================================================
|
||||
--- gcc-4.3.2.orig/gcc/tree-ssa-loop-ivopts.c 2009-01-28 10:26:04.000000000 +0100
|
||||
+++ gcc-4.3.2/gcc/tree-ssa-loop-ivopts.c 2009-01-28 10:27:09.000000000 +0100
|
||||
@@ -3778,7 +3778,12 @@
|
||||
return false;
|
||||
|
||||
cand_value_at (loop, cand, use->stmt, nit, &bnd);
|
||||
+
|
||||
*bound = aff_combination_to_tree (&bnd);
|
||||
+ /* It is unlikely that computing the number of iterations using division
|
||||
+ would be more profitable than keeping the original induction variable. */
|
||||
+ if (expression_expensive_p (*bound))
|
||||
+ return false;
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
gcc/ChangeLog
|
||||
2007-11-27 Bernhard Fischer <>
|
||||
|
||||
* config/arm/arm-protos.h (arm_vector_mode_supported_p,
|
||||
arm_hard_regno_mode_ok, const_ok_for_arm): Do not hide non-rtx related
|
||||
function prototypes in RTX_CODE.
|
||||
* genopinit.c: Include tm_p.h.
|
||||
|
||||
Index: gcc-4.3.0/gcc/config/arm/arm-protos.h
|
||||
===================================================================
|
||||
--- gcc-4.3.0/gcc/config/arm/arm-protos.h (revision 130463)
|
||||
+++ gcc-4.3.0/gcc/config/arm/arm-protos.h (working copy)
|
||||
@@ -40,15 +40,14 @@
|
||||
unsigned int);
|
||||
extern unsigned int arm_dbx_register_number (unsigned int);
|
||||
extern void arm_output_fn_unwind (FILE *, bool);
|
||||
-
|
||||
|
||||
#ifdef TREE_CODE
|
||||
extern int arm_return_in_memory (const_tree);
|
||||
#endif
|
||||
-#ifdef RTX_CODE
|
||||
extern bool arm_vector_mode_supported_p (enum machine_mode);
|
||||
extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode);
|
||||
extern int const_ok_for_arm (HOST_WIDE_INT);
|
||||
+#ifdef RTX_CODE
|
||||
extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx,
|
||||
HOST_WIDE_INT, rtx, rtx, int);
|
||||
extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, enum machine_mode,
|
||||
Index: gcc-4.3.0/gcc/genopinit.c
|
||||
===================================================================
|
||||
--- gcc-4.3.0/gcc/genopinit.c (revision 130463)
|
||||
+++ gcc-4.3.0/gcc/genopinit.c (working copy)
|
||||
@@ -486,6 +486,7 @@
|
||||
printf ("#include \"expr.h\"\n");
|
||||
printf ("#include \"optabs.h\"\n");
|
||||
printf ("#include \"reload.h\"\n\n");
|
||||
+ printf ("#include \"tm_p.h\"\n\n");
|
||||
|
||||
printf ("void\ninit_all_optabs (void)\n{\n");
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
\\\\
|
||||
\\ gcc PR33200
|
||||
Index: gcc-4.3.0/gcc/config.gcc
|
||||
===================================================================
|
||||
--- gcc-4.3.0/gcc/config.gcc (revision 131628)
|
||||
+++ gcc-4.3.0/gcc/config.gcc (working copy)
|
||||
@@ -2302,7 +2305,7 @@ sh-*-symbianelf* | sh[12346l]*-*-symbian
|
||||
if test x${enable_incomplete_targets} = xyes ; then
|
||||
tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1"
|
||||
fi
|
||||
- use_fixproto=yes
|
||||
+ # XXX: why? use_fixproto=yes
|
||||
;;
|
||||
sh-*-rtemscoff*)
|
||||
tmake_file="sh/t-sh t-rtems sh/t-rtems"
|
||||
@@ -0,0 +1,18 @@
|
||||
\\\\ followup of PR34205; trying to use aapcs-linux
|
||||
\\ gcc/ChangeLog
|
||||
\\
|
||||
\\ 2008-09-18 Bernhard Reutner-Fischer <aldot@>
|
||||
\\
|
||||
\\ * config.gcc (arm*-*-*): Add aapcs-linux to supported ABIs.
|
||||
\\
|
||||
--- gcc-4.3.2.orig/gcc/config.gcc 2008-09-18 20:33:55.000000000 +0200
|
||||
+++ gcc-4.3.2/gcc/config.gcc 2008-09-18 21:38:52.000000000 +0200
|
||||
@@ -2921,7 +2921,7 @@
|
||||
|
||||
case "$with_abi" in
|
||||
"" \
|
||||
- | apcs-gnu | atpcs | aapcs | iwmmxt )
|
||||
+ | apcs-gnu | atpcs | aapcs | iwmmxt | aapcs-linux )
|
||||
#OK
|
||||
;;
|
||||
*)
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
diff -urN gcc-4.3.1.orig/gcc/config/cris/cris.h gcc-4.3.1/gcc/config/cris/cris.h
|
||||
--- gcc-4.3.1.orig/gcc/config/cris/cris.h 2008-02-22 12:11:01.000000000 +0100
|
||||
+++ gcc-4.3.1/gcc/config/cris/cris.h 2008-07-02 10:42:42.000000000 +0200
|
||||
@@ -1529,9 +1529,6 @@
|
||||
|
||||
#define NO_IMPLICIT_EXTERN_C
|
||||
|
||||
-/* No specific purpose other than warningless compatibility. */
|
||||
-#define HANDLE_PRAGMA_PACK_PUSH_POP 1
|
||||
-
|
||||
/*
|
||||
* Local variables:
|
||||
* eval: (c-set-style "gnu")
|
||||
@@ -0,0 +1,16 @@
|
||||
diff -u gcc-4.3.3/gcc/config.gcc.orig gcc-4.3.3/gcc/config.gcc
|
||||
--- gcc-4.3.3/gcc/config.gcc.orig 2009-04-24 22:08:23.523688500 -0400
|
||||
+++ gcc-4.3.3/gcc/config.gcc 2009-04-24 22:13:43.869488700 -0400
|
||||
@@ -2880,9 +2880,9 @@
|
||||
|
||||
case "$with_arch" in
|
||||
"" \
|
||||
- | armv[23456] | armv2a | armv3m | armv4t | armv5t \
|
||||
- | armv5te | armv6j |armv6k | armv6z | armv6zk \
|
||||
- | iwmmxt | ep9312)
|
||||
+ | armv[234567] | armv2a | armv3m | armv4t | armv5t | armv5e \
|
||||
+ | armv5te | armv6j |armv6k | armv6z | armv6zk | armv6t2 \
|
||||
+ | armv7-a | armv7-r | armv7-m | ep9312 | iwmmxt)
|
||||
# OK
|
||||
;;
|
||||
*)
|
||||
@@ -0,0 +1,30 @@
|
||||
At present, libstdc++ will not build. My understanding is that it needs to have
|
||||
the NuttX libc characterized in crossconfig.m4. This is a first attempt to do that --
|
||||
unfortunately, it still does not work.
|
||||
|
||||
diff -u gcc-4.2.4/libstdc++-v3/configure.orig gcc-4.2.4/libstdc++-v3/configure
|
||||
--- gcc-4.2.4/libstdc++-v3/configure.orig 2009-01-05 17:52:11.000000000 -0600
|
||||
+++ gcc-4.2.4/libstdc++-v3/configure 2009-01-05 17:52:43.000000000 -0600
|
||||
@@ -114335,9 +114335,7 @@
|
||||
|
||||
;;
|
||||
*)
|
||||
- { { echo "$as_me:$LINENO: error: No support for this host/target combination." >&5
|
||||
-echo "$as_me: error: No support for this host/target combination." >&2;}
|
||||
- { (exit 1); exit 1; }; }
|
||||
+ # Assume bare hardware
|
||||
;;
|
||||
esac
|
||||
|
||||
diff -u gcc-4.2.4/libstdc++-v3/crossconfig.m4.orig gcc-4.2.4/libstdc++-v3/crossconfig.m4
|
||||
--- gcc-4.2.4/libstdc++-v3/crossconfig.m4.orig 2009-01-05 17:51:07.000000000 -0600
|
||||
+++ gcc-4.2.4/libstdc++-v3/crossconfig.m4 2009-01-05 17:52:02.000000000 -0600
|
||||
@@ -464,7 +464,7 @@
|
||||
AC_DEFINE(HAVE_TANHL)
|
||||
;;
|
||||
*)
|
||||
- AC_MSG_ERROR([No support for this host/target combination.])
|
||||
+ # Assume bare hardware
|
||||
;;
|
||||
esac
|
||||
])
|
||||
@@ -0,0 +1,13 @@
|
||||
--- gcc-4.2.4/configure.orig 2009-04-18 18:07:18.250951700 -0400
|
||||
+++ gcc-4.2.4/configure 2009-04-18 18:20:20.369521100 -0400
|
||||
@@ -2614,6 +2614,10 @@
|
||||
;;
|
||||
esac
|
||||
|
||||
+# If we are building against NuttX, then don't attempt to build libstdc++
|
||||
+# (should be conditioned on --with-nuttx)
|
||||
+noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3"
|
||||
+
|
||||
# If we aren't building newlib, then don't build libgloss, since libgloss
|
||||
# depends upon some newlib header files.
|
||||
case "${noconfigdirs}" in
|
||||
@@ -0,0 +1,22 @@
|
||||
diff -u gcc-4.3.3/configure.orig gcc-4.3.3/configure
|
||||
--- gcc-4.3.3/configure.orig 2009-04-25 08:02:42.953125000 -0400
|
||||
+++ gcc-4.3.3/configure 2009-04-25 08:11:52.453125000 -0400
|
||||
@@ -3346,7 +3346,6 @@
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
-rm -f conftest.o conftest.obj
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
diff -u gcc-4.3.3/libgcc/configure.orig gcc-4.3.3/libgcc/configure
|
||||
--- gcc-4.3.3/libgcc/configure.orig 2009-04-25 08:55:17.656250000 -0400
|
||||
+++ gcc-4.3.3/libgcc/configure 2009-04-25 08:55:42.203125000 -0400
|
||||
@@ -2584,7 +2584,6 @@
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
-rm -f conftest.o conftest.obj
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@@ -0,0 +1,49 @@
|
||||
Index: gcc-4.2/libmudflap/mf-hooks2.c
|
||||
===================================================================
|
||||
--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
|
||||
+++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
|
||||
@@ -427,7 +427,7 @@
|
||||
{
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
|
||||
- bzero (s, n);
|
||||
+ memset (s, 0, n);
|
||||
}
|
||||
|
||||
|
||||
@@ -437,7 +437,7 @@
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
|
||||
MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
|
||||
- bcopy (src, dest, n);
|
||||
+ memmove (dest, src, n);
|
||||
}
|
||||
|
||||
|
||||
@@ -447,7 +447,7 @@
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
|
||||
MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
|
||||
- return bcmp (s1, s2, n);
|
||||
+ return n == 0 ? 0 : memcmp (s1, s2, n);
|
||||
}
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@
|
||||
size_t n = strlen (s);
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
|
||||
- return index (s, c);
|
||||
+ return strchr (s, c);
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@
|
||||
size_t n = strlen (s);
|
||||
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
|
||||
- return rindex (s, c);
|
||||
+ return strrchr (s, c);
|
||||
}
|
||||
|
||||
/* XXX: stpcpy, memccpy */
|
||||
@@ -0,0 +1,38 @@
|
||||
[PATCH] add the correct symbols to libgcc for uclibc arm softfloat
|
||||
|
||||
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
||||
---
|
||||
gcc/config/arm/linux-elf.h | 2 +-
|
||||
gcc/config/arm/t-linux | 6 +++++-
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: gcc-4.4.0/gcc/config/arm/t-linux
|
||||
===================================================================
|
||||
--- gcc-4.4.0.orig/gcc/config/arm/t-linux
|
||||
+++ gcc-4.4.0/gcc/config/arm/t-linux
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
LIB1ASMSRC = arm/lib1funcs.asm
|
||||
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
|
||||
- _arm_addsubdf3 _arm_addsubsf3
|
||||
+ _arm_addsubdf3 _arm_addsubsf3 \
|
||||
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
|
||||
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
|
||||
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
|
||||
+ _arm_fixsfsi _arm_fixunssfsi
|
||||
|
||||
# MULTILIB_OPTIONS = mhard-float/msoft-float
|
||||
# MULTILIB_DIRNAMES = hard-float soft-float
|
||||
Index: gcc-4.4.0/gcc/config/arm/linux-elf.h
|
||||
===================================================================
|
||||
--- gcc-4.4.0.orig/gcc/config/arm/linux-elf.h
|
||||
+++ gcc-4.4.0/gcc/config/arm/linux-elf.h
|
||||
@@ -60,7 +60,7 @@
|
||||
%{shared:-lc} \
|
||||
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
|
||||
|
||||
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
|
||||
+#define LIBGCC_SPEC "-lgcc"
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
|
||||
|
||||
diff -Nura gcc-4.5.1.orig/gcc/config/arm/linux-eabi.h gcc-4.5.1/gcc/config/arm/linux-eabi.h
|
||||
--- gcc-4.5.1.orig/gcc/config/arm/linux-eabi.h 2009-10-30 17:03:09.000000000 -0300
|
||||
+++ gcc-4.5.1/gcc/config/arm/linux-eabi.h 2010-11-02 15:38:25.792208500 -0300
|
||||
@@ -44,7 +44,7 @@
|
||||
The ARM10TDMI core is the default for armv5t, so set
|
||||
SUBTARGET_CPU_DEFAULT to achieve this. */
|
||||
#undef SUBTARGET_CPU_DEFAULT
|
||||
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
|
||||
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
|
||||
|
||||
/* TARGET_BIG_ENDIAN_DEFAULT is set in
|
||||
config.gcc for big endian configurations. */
|
||||
@@ -0,0 +1,345 @@
|
||||
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43440
|
||||
|
||||
--- gcc-4.4.4.orig/gcc/config/arm/aout.h
|
||||
+++ gcc-4.4.4/gcc/config/arm/aout.h
|
||||
@@ -163,34 +163,49 @@
|
||||
{"mvdx12", 39}, \
|
||||
{"mvdx13", 40}, \
|
||||
{"mvdx14", 41}, \
|
||||
- {"mvdx15", 42}, \
|
||||
- {"d0", 63}, {"q0", 63}, \
|
||||
- {"d1", 65}, \
|
||||
- {"d2", 67}, {"q1", 67}, \
|
||||
- {"d3", 69}, \
|
||||
- {"d4", 71}, {"q2", 71}, \
|
||||
- {"d5", 73}, \
|
||||
- {"d6", 75}, {"q3", 75}, \
|
||||
- {"d7", 77}, \
|
||||
- {"d8", 79}, {"q4", 79}, \
|
||||
- {"d9", 81}, \
|
||||
- {"d10", 83}, {"q5", 83}, \
|
||||
- {"d11", 85}, \
|
||||
- {"d12", 87}, {"q6", 87}, \
|
||||
- {"d13", 89}, \
|
||||
- {"d14", 91}, {"q7", 91}, \
|
||||
- {"d15", 93}, \
|
||||
- {"q8", 95}, \
|
||||
- {"q9", 99}, \
|
||||
- {"q10", 103}, \
|
||||
- {"q11", 107}, \
|
||||
- {"q12", 111}, \
|
||||
- {"q13", 115}, \
|
||||
- {"q14", 119}, \
|
||||
- {"q15", 123} \
|
||||
+ {"mvdx15", 42} \
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifndef OVERLAPPING_REGISTER_NAMES
|
||||
+#define OVERLAPPING_REGISTER_NAMES \
|
||||
+{ \
|
||||
+ {"d0", 63, 2}, \
|
||||
+ {"d1", 65, 2}, \
|
||||
+ {"d2", 67, 2}, \
|
||||
+ {"d3", 69, 2}, \
|
||||
+ {"d4", 71, 2}, \
|
||||
+ {"d5", 73, 2}, \
|
||||
+ {"d6", 75, 2}, \
|
||||
+ {"d7", 77, 2}, \
|
||||
+ {"d8", 79, 2}, \
|
||||
+ {"d9", 81, 2}, \
|
||||
+ {"d10", 83, 2}, \
|
||||
+ {"d11", 85, 2}, \
|
||||
+ {"d12", 87, 2}, \
|
||||
+ {"d13", 89, 2}, \
|
||||
+ {"d14", 91, 2}, \
|
||||
+ {"d15", 93, 2}, \
|
||||
+ {"q0", 63, 4}, \
|
||||
+ {"q1", 67, 4}, \
|
||||
+ {"q2", 71, 4}, \
|
||||
+ {"q3", 75, 4}, \
|
||||
+ {"q4", 79, 4}, \
|
||||
+ {"q5", 83, 4}, \
|
||||
+ {"q6", 87, 4}, \
|
||||
+ {"q7", 91, 4}, \
|
||||
+ {"q8", 95, 4}, \
|
||||
+ {"q9", 99, 4}, \
|
||||
+ {"q10", 103, 4}, \
|
||||
+ {"q11", 107, 4}, \
|
||||
+ {"q12", 111, 4}, \
|
||||
+ {"q13", 115, 4}, \
|
||||
+ {"q14", 119, 4}, \
|
||||
+ {"q15", 123, 4} \
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
#ifndef NO_DOLLAR_IN_LABEL
|
||||
#define NO_DOLLAR_IN_LABEL 1
|
||||
#endif
|
||||
--- gcc-4.4.4.orig/gcc/output.h
|
||||
+++ gcc-4.4.4/gcc/output.h
|
||||
@@ -169,6 +169,11 @@
|
||||
Prefixes such as % are optional. */
|
||||
extern int decode_reg_name (const char *);
|
||||
|
||||
+/* Similar to decode_reg_name, but takes an extra parameter that is a
|
||||
+ pointer to the number of (internal) registers described by the
|
||||
+ external name. */
|
||||
+extern int decode_reg_name_and_count (const char *, int *);
|
||||
+
|
||||
extern void assemble_alias (tree, tree);
|
||||
|
||||
extern void default_assemble_visibility (tree, int);
|
||||
--- gcc-4.4.4.orig/gcc/reginfo.c
|
||||
+++ gcc-4.4.4/gcc/reginfo.c
|
||||
@@ -800,39 +800,44 @@
|
||||
fix_register (const char *name, int fixed, int call_used)
|
||||
{
|
||||
int i;
|
||||
+ int reg, nregs;
|
||||
|
||||
/* Decode the name and update the primary form of
|
||||
the register info. */
|
||||
-
|
||||
- if ((i = decode_reg_name (name)) >= 0)
|
||||
+ if ((reg = decode_reg_name_and_count (name, &nregs)) >= 0)
|
||||
{
|
||||
- if ((i == STACK_POINTER_REGNUM
|
||||
+ gcc_assert (nregs >= 1);
|
||||
+ for (i = reg; i < reg + nregs; i++)
|
||||
+ {
|
||||
+ if ((i == STACK_POINTER_REGNUM
|
||||
#ifdef HARD_FRAME_POINTER_REGNUM
|
||||
- || i == HARD_FRAME_POINTER_REGNUM
|
||||
+ || i == HARD_FRAME_POINTER_REGNUM
|
||||
#else
|
||||
- || i == FRAME_POINTER_REGNUM
|
||||
+ || i == FRAME_POINTER_REGNUM
|
||||
#endif
|
||||
- )
|
||||
- && (fixed == 0 || call_used == 0))
|
||||
- {
|
||||
- static const char * const what_option[2][2] = {
|
||||
- { "call-saved", "call-used" },
|
||||
- { "no-such-option", "fixed" }};
|
||||
+ )
|
||||
+ && (fixed == 0 || call_used == 0))
|
||||
+ {
|
||||
+ static const char * const what_option[2][2] = {
|
||||
+ { "call-saved", "call-used" },
|
||||
+ { "no-such-option", "fixed" }};
|
||||
|
||||
- error ("can't use '%s' as a %s register", name,
|
||||
- what_option[fixed][call_used]);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- fixed_regs[i] = fixed;
|
||||
- call_used_regs[i] = call_used;
|
||||
+ error ("can't use '%s' as a %s register", name,
|
||||
+ what_option[fixed][call_used]);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ fixed_regs[i] = fixed;
|
||||
+ call_used_regs[i] = call_used;
|
||||
#ifdef CALL_REALLY_USED_REGISTERS
|
||||
- if (fixed == 0)
|
||||
- call_really_used_regs[i] = call_used;
|
||||
+ if (fixed == 0)
|
||||
+ call_really_used_regs[i] = call_used;
|
||||
#endif
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+
|
||||
{
|
||||
warning (0, "unknown register name: %s", name);
|
||||
}
|
||||
--- gcc-4.4.4.orig/gcc/stmt.c
|
||||
+++ gcc-4.4.4/gcc/stmt.c
|
||||
@@ -681,13 +681,14 @@
|
||||
for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
|
||||
{
|
||||
const char *regname;
|
||||
+ int nregs;
|
||||
|
||||
if (TREE_VALUE (tail) == error_mark_node)
|
||||
return;
|
||||
regname = TREE_STRING_POINTER (TREE_VALUE (tail));
|
||||
|
||||
- i = decode_reg_name (regname);
|
||||
- if (i >= 0 || i == -4)
|
||||
+ i = decode_reg_name_and_count (regname, &nregs);
|
||||
+ if (i == -4)
|
||||
++nclobbers;
|
||||
else if (i == -2)
|
||||
error ("unknown register name %qs in %<asm%>", regname);
|
||||
@@ -695,14 +696,21 @@
|
||||
/* Mark clobbered registers. */
|
||||
if (i >= 0)
|
||||
{
|
||||
- /* Clobbering the PIC register is an error. */
|
||||
- if (i == (int) PIC_OFFSET_TABLE_REGNUM)
|
||||
- {
|
||||
- error ("PIC register %qs clobbered in %<asm%>", regname);
|
||||
- return;
|
||||
- }
|
||||
+ int reg;
|
||||
|
||||
- SET_HARD_REG_BIT (clobbered_regs, i);
|
||||
+ for (reg = i; reg < i + nregs; reg++)
|
||||
+ {
|
||||
+ ++nclobbers;
|
||||
+
|
||||
+ /* Clobbering the PIC register is an error. */
|
||||
+ if (reg == (int) PIC_OFFSET_TABLE_REGNUM)
|
||||
+ {
|
||||
+ error ("PIC register clobbered by %qs in %<asm%>", regname);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ SET_HARD_REG_BIT (clobbered_regs, reg);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1012,8 +1020,9 @@
|
||||
for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
|
||||
{
|
||||
const char *regname = TREE_STRING_POINTER (TREE_VALUE (tail));
|
||||
- int j = decode_reg_name (regname);
|
||||
- rtx clobbered_reg;
|
||||
+ int reg, nregs;
|
||||
+ int j = decode_reg_name_and_count (regname, &nregs);
|
||||
+ rtx clobbered_reg;
|
||||
|
||||
if (j < 0)
|
||||
{
|
||||
@@ -1033,31 +1042,40 @@
|
||||
/* Ignore unknown register, error already signaled. */
|
||||
continue;
|
||||
}
|
||||
-
|
||||
- /* Use QImode since that's guaranteed to clobber just one reg. */
|
||||
- clobbered_reg = gen_rtx_REG (QImode, j);
|
||||
-
|
||||
- /* Do sanity check for overlap between clobbers and respectively
|
||||
- input and outputs that hasn't been handled. Such overlap
|
||||
- should have been detected and reported above. */
|
||||
- if (!clobber_conflict_found)
|
||||
- {
|
||||
- int opno;
|
||||
-
|
||||
- /* We test the old body (obody) contents to avoid tripping
|
||||
- over the under-construction body. */
|
||||
- for (opno = 0; opno < noutputs; opno++)
|
||||
- if (reg_overlap_mentioned_p (clobbered_reg, output_rtx[opno]))
|
||||
- internal_error ("asm clobber conflict with output operand");
|
||||
-
|
||||
- for (opno = 0; opno < ninputs - ninout; opno++)
|
||||
- if (reg_overlap_mentioned_p (clobbered_reg,
|
||||
- ASM_OPERANDS_INPUT (obody, opno)))
|
||||
- internal_error ("asm clobber conflict with input operand");
|
||||
+
|
||||
+ for (reg = j; reg < j + nregs; reg++)
|
||||
+ {
|
||||
+ /* Use QImode since that's guaranteed to clobber just
|
||||
+ * one reg. */
|
||||
+ clobbered_reg = gen_rtx_REG (QImode, reg);
|
||||
+
|
||||
+ /* Do sanity check for overlap between clobbers and
|
||||
+ respectively input and outputs that hasn't been
|
||||
+ handled. Such overlap should have been detected and
|
||||
+ reported above. */
|
||||
+ if (!clobber_conflict_found)
|
||||
+ {
|
||||
+ int opno;
|
||||
+
|
||||
+ /* We test the old body (obody) contents to avoid
|
||||
+ tripping over the under-construction body. */
|
||||
+ for (opno = 0; opno < noutputs; opno++)
|
||||
+ if (reg_overlap_mentioned_p (clobbered_reg,
|
||||
+ output_rtx[opno]))
|
||||
+ internal_error
|
||||
+ ("asm clobber conflict with output operand");
|
||||
+
|
||||
+ for (opno = 0; opno < ninputs - ninout; opno++)
|
||||
+ if (reg_overlap_mentioned_p (clobbered_reg,
|
||||
+ ASM_OPERANDS_INPUT (obody,
|
||||
+ opno)))
|
||||
+ internal_error
|
||||
+ ("asm clobber conflict with input operand");
|
||||
+ }
|
||||
+
|
||||
+ XVECEXP (body, 0, i++)
|
||||
+ = gen_rtx_CLOBBER (VOIDmode, clobbered_reg);
|
||||
}
|
||||
-
|
||||
- XVECEXP (body, 0, i++)
|
||||
- = gen_rtx_CLOBBER (VOIDmode, clobbered_reg);
|
||||
}
|
||||
|
||||
emit_insn (body);
|
||||
--- gcc-4.4.4.orig/gcc/varasm.c
|
||||
+++ gcc-4.4.4/gcc/varasm.c
|
||||
@@ -1031,8 +1031,11 @@
|
||||
Prefixes such as % are optional. */
|
||||
|
||||
int
|
||||
-decode_reg_name (const char *asmspec)
|
||||
+decode_reg_name_and_count (const char *asmspec, int *pnregs)
|
||||
{
|
||||
+ /* Presume just one register is clobbered. */
|
||||
+ *pnregs = 1;
|
||||
+
|
||||
if (asmspec != 0)
|
||||
{
|
||||
int i;
|
||||
@@ -1058,6 +1061,25 @@
|
||||
&& ! strcmp (asmspec, strip_reg_name (reg_names[i])))
|
||||
return i;
|
||||
|
||||
+#ifdef OVERLAPPING_REGISTER_NAMES
|
||||
+ {
|
||||
+ static const struct
|
||||
+ {
|
||||
+ const char *const name;
|
||||
+ const int number;
|
||||
+ const int nregs;
|
||||
+ } table[] = OVERLAPPING_REGISTER_NAMES;
|
||||
+
|
||||
+ for (i = 0; i < (int) ARRAY_SIZE (table); i++)
|
||||
+ if (table[i].name[0]
|
||||
+ && ! strcmp (asmspec, table[i].name))
|
||||
+ {
|
||||
+ *pnregs = table[i].nregs;
|
||||
+ return table[i].number;
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* OVERLAPPING_REGISTER_NAMES */
|
||||
+
|
||||
#ifdef ADDITIONAL_REGISTER_NAMES
|
||||
{
|
||||
static const struct { const char *const name; const int number; } table[]
|
||||
@@ -1081,6 +1103,15 @@
|
||||
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+int
|
||||
+decode_reg_name (const char *name)
|
||||
+{
|
||||
+ int count;
|
||||
+ return decode_reg_name_and_count (name, &count);
|
||||
+}
|
||||
+
|
||||
+
|
||||
|
||||
/* Return true if DECL's initializer is suitable for a BSS section. */
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
>From d0557763b0713a4c006bd2405eede3924569cafd Mon Sep 17 00:00:00 2001
|
||||
From: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
|
||||
Date: Mon, 5 Jul 2010 11:28:49 +0100
|
||||
Subject: [PATCH 2/2] Fix PR44392
|
||||
|
||||
---
|
||||
gcc/config/arm/arm.md | 43 +++++++++++++++++++------------------------
|
||||
1 files changed, 19 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
|
||||
index 2096ec6..f0348f3 100644
|
||||
--- a/gcc/config/arm/arm.md
|
||||
+++ b/gcc/config/arm/arm.md
|
||||
@@ -11318,34 +11318,29 @@
|
||||
(define_expand "bswapsi2"
|
||||
[(set (match_operand:SI 0 "s_register_operand" "=r")
|
||||
(bswap:SI (match_operand:SI 1 "s_register_operand" "r")))]
|
||||
-"TARGET_EITHER"
|
||||
+"TARGET_EITHER && (arm_arch6 || !optimize_size)"
|
||||
"
|
||||
- if (!arm_arch6)
|
||||
- {
|
||||
- if (!optimize_size)
|
||||
- {
|
||||
- rtx op2 = gen_reg_rtx (SImode);
|
||||
- rtx op3 = gen_reg_rtx (SImode);
|
||||
+ if (!arm_arch6)
|
||||
+ {
|
||||
+ rtx op2 = gen_reg_rtx (SImode);
|
||||
+ rtx op3 = gen_reg_rtx (SImode);
|
||||
|
||||
- if (TARGET_THUMB)
|
||||
- {
|
||||
- rtx op4 = gen_reg_rtx (SImode);
|
||||
- rtx op5 = gen_reg_rtx (SImode);
|
||||
+ if (TARGET_THUMB)
|
||||
+ {
|
||||
+ rtx op4 = gen_reg_rtx (SImode);
|
||||
+ rtx op5 = gen_reg_rtx (SImode);
|
||||
|
||||
- emit_insn (gen_thumb_legacy_rev (operands[0], operands[1],
|
||||
- op2, op3, op4, op5));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- emit_insn (gen_arm_legacy_rev (operands[0], operands[1],
|
||||
- op2, op3));
|
||||
- }
|
||||
+ emit_insn (gen_thumb_legacy_rev (operands[0], operands[1],
|
||||
+ op2, op3, op4, op5));
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ emit_insn (gen_arm_legacy_rev (operands[0], operands[1],
|
||||
+ op2, op3));
|
||||
+ }
|
||||
|
||||
- DONE;
|
||||
- }
|
||||
- else
|
||||
- FAIL;
|
||||
- }
|
||||
+ DONE;
|
||||
+ }
|
||||
"
|
||||
)
|
||||
|
||||
--
|
||||
1.6.2
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--- gcc-4.5.2/configure.orig 2011-04-28 17:25:37.091035400 -0600
|
||||
+++ gcc-4.5.2/configure 2011-04-28 17:26:26.868332200 -0600
|
||||
@@ -3741,6 +3741,10 @@
|
||||
;;
|
||||
esac
|
||||
|
||||
+# If we are building against NuttX, then don't attempt to build libstdc++
|
||||
+# (should be conditioned on --with-nuttx)
|
||||
+noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3"
|
||||
+
|
||||
# If we aren't building newlib, then don't build libgloss, since libgloss
|
||||
# depends upon some newlib header files.
|
||||
case "${noconfigdirs}" in
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm
|
||||
index 085e690..2e76c01 100644
|
||||
--- a/gcc/config/arm/lib1funcs.asm
|
||||
+++ b/gcc/config/arm/lib1funcs.asm
|
||||
@@ -641,7 +641,7 @@ pc .req r15
|
||||
subhs \dividend, \dividend, \divisor, lsr #3
|
||||
orrhs \result, \result, \curbit, lsr #3
|
||||
cmp \dividend, #0 @ Early termination?
|
||||
- do_it hs, t
|
||||
+ do_it ne, t
|
||||
movnes \curbit, \curbit, lsr #4 @ No, any more bits to do?
|
||||
movne \divisor, \divisor, lsr #4
|
||||
bne 1b
|
||||
@@ -0,0 +1,106 @@
|
||||
# Choose gcc version.
|
||||
|
||||
comment "GCC Options"
|
||||
|
||||
config BR2_PACKAGE_GCC
|
||||
bool "Build GCC cross-compiler"
|
||||
default n
|
||||
help
|
||||
Build the GCC cross-compiler for the target architecture.
|
||||
|
||||
choice
|
||||
prompt "GCC compiler Version"
|
||||
default BR2_GCC_VERSION_4_3_3 if BR2_cortex_m3
|
||||
default BR2_GCC_VERSION_4_2_4 if !BR2_avr32 && !BR2_cortex_m3 && !BR2_m9s12x
|
||||
default BR2_GCC_VERSION_3_4_6 if BR2_avr32
|
||||
default BR2_GCC_VERSION_3_3_6 if BR2_m9s12x
|
||||
depends on BR2_PACKAGE_GCC
|
||||
help
|
||||
Select the version of gcc you wish to use.
|
||||
|
||||
config BR2_GCC_VERSION_3_3_6
|
||||
depends on BR2_m9s12x
|
||||
bool "gcc 3.3.6"
|
||||
|
||||
config BR2_GCC_VERSION_3_4_6
|
||||
depends on !BR2_m32c && !BR2_cortex_m3 && !BR2_m9s12x
|
||||
bool "gcc 3.4.6"
|
||||
|
||||
config BR2_GCC_VERSION_4_2_4
|
||||
depends on !BR2_avr32 && !BR2_nios2 && !BR2_cortex_m3 && !BR2_m9s12x
|
||||
select BR2_GCC_SUPPORTS_SYSROOT
|
||||
bool "gcc 4.2.4"
|
||||
|
||||
config BR2_GCC_VERSION_4_3_3
|
||||
depends on !BR2_avr32 && !BR2_nios2 && !BR2_m9s12x
|
||||
select BR2_GCC_SUPPORTS_SYSROOT
|
||||
bool "gcc 4.3.3"
|
||||
|
||||
config BR2_GCC_VERSION_4_5_2
|
||||
depends on !BR2_avr32 && !BR2_nios2 && !BR2_m9s12x
|
||||
select BR2_GCC_SUPPORTS_SYSROOT
|
||||
bool "gcc 4.5.2"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_GCC_SUPPORTS_SYSROOT
|
||||
bool
|
||||
default n
|
||||
|
||||
config BR2_GCC_VERSION
|
||||
string
|
||||
default "3.3.6" if BR2_GCC_VERSION_3_3_6
|
||||
default "3.4.6" if BR2_GCC_VERSION_3_4_6
|
||||
default "4.2.4" if BR2_GCC_VERSION_4_2_4
|
||||
default "4.3.3" if BR2_GCC_VERSION_4_3_3
|
||||
default "4.5.2" if BR2_GCC_VERSION_4_5_2
|
||||
|
||||
config BR2_GCC_USE_SJLJ_EXCEPTIONS
|
||||
bool "Enable setjmp/longjmp exceptions?"
|
||||
default n
|
||||
depends on BR2_PACKAGE_GCC
|
||||
help
|
||||
For some platforms, proper stack unwinding works perfectly,
|
||||
while other platforms must use setjmp/longjmp exceptions for
|
||||
proper stack unwinding during exception handling. Most people
|
||||
can leave this set to n.
|
||||
|
||||
config BR2_EXTRA_GCC_CONFIG_OPTIONS
|
||||
string "Additional gcc options"
|
||||
depends on BR2_PACKAGE_GCC
|
||||
default ""
|
||||
help
|
||||
Any additional gcc configure options you may want to include....
|
||||
|
||||
config BR2_INSTALL_LIBSTDCPP
|
||||
bool "Build C++ compiler?"
|
||||
depends on BR2_PACKAGE_GCC
|
||||
default n
|
||||
# >= 4.2.0 work fine without LARGEFILE
|
||||
select BR2_LARGEFILE if !BR2_GCC_SUPPORTS_SYSROOT
|
||||
help
|
||||
Build/install c++ compiler? NOTE: libstdc++ is not built for NuttX?
|
||||
|
||||
config BR2_INSTALL_LIBGCJ
|
||||
bool "Build/install java compiler and libgcj?"
|
||||
default n
|
||||
depends on BR2_PACKAGE_GCC && !BR2_avr32 && BR2_INSTALL_LIBSTDCPP
|
||||
help
|
||||
Build/install java compiler and libgcj?
|
||||
|
||||
config BR2_INSTALL_OBJC
|
||||
bool "Build/install Objective-C compiler and runtime?"
|
||||
default n
|
||||
depends on BR2_PACKAGE_GCC && !BR2_avr32
|
||||
help
|
||||
Build/install Objective-C compiler and runtime?
|
||||
|
||||
config BR2_INSTALL_FORTRAN
|
||||
bool "Build/install Fortran compiler and runtime?"
|
||||
default n
|
||||
depends on BR2_PACKAGE_GCC && !BR2_avr32
|
||||
help
|
||||
Build/install Fortran compiler and runtime?
|
||||
Note that it is highly recommended NOT to use gfortran
|
||||
from gcc older than 4.2.0
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
#
|
||||
|
||||
GCC_VERSION:=$(strip $(subst ",, $(BR2_GCC_VERSION)))
|
||||
#"))
|
||||
TARGET_OPTIMIZATION:=$(strip $(subst ",, $(BR2_TARGET_OPTIMIZATION)))
|
||||
#"))
|
||||
EXTRA_GCC_CONFIG_OPTIONS:=$(strip $(subst ",, $(BR2_EXTRA_GCC_CONFIG_OPTIONS)))
|
||||
#"))
|
||||
#")))
|
||||
|
||||
ifeq ($(strip $(BR2_GCC_USE_SJLJ_EXCEPTIONS)),y)
|
||||
GCC_USE_SJLJ_EXCEPTIONS:=--enable-sjlj-exceptions
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_SOFT_FLOAT),y)
|
||||
# gcc 3.4.x soft float configuration is different than previous versions.
|
||||
ifeq ($(findstring x3.4.,x$(GCC_VERSION)),x3.4.)
|
||||
ifneq ($(BR2_nios2),y)
|
||||
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
|
||||
endif
|
||||
else
|
||||
SOFT_FLOAT_CONFIG_OPTION:=--without-float
|
||||
endif
|
||||
|
||||
# again... there must be a better way
|
||||
ifeq ($(findstring x4.,x$(GCC_VERSION)),x4.)
|
||||
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
|
||||
ifeq ($(BR2_SOFT_FLOAT_FP),y)
|
||||
TARGET_SOFT_FLOAT:=-mfloat-abi=softfp
|
||||
else # no fp at all
|
||||
ifeq ($(BR2_arm),y) # only set float-abi for arm
|
||||
TARGET_SOFT_FLOAT:=-mfloat-abi=soft
|
||||
else
|
||||
TARGET_SOFT_FLOAT:=-msoft-float
|
||||
endif
|
||||
endif
|
||||
else # not gcc-4.x
|
||||
TARGET_SOFT_FLOAT:=-msoft-float
|
||||
endif
|
||||
ARCH_FPU_SUFFIX:=_nofpu
|
||||
else # no softfloat support
|
||||
SOFT_FLOAT_CONFIG_OPTION:=
|
||||
TARGET_SOFT_FLOAT:=
|
||||
ARCH_FPU_SUFFIX:=
|
||||
endif
|
||||
|
||||
# some additional tuning values
|
||||
ifneq ($(strip $(subst ",,$(BR2_GCC_TARGET_ARCH))),)
|
||||
# ")))
|
||||
GCC_WITH_ARCH:=--with-arch=$(BR2_GCC_TARGET_ARCH)
|
||||
endif
|
||||
ifneq ($(strip $(subst ",,$(BR2_GCC_TARGET_TUNE))),)
|
||||
# ")))
|
||||
GCC_WITH_TUNE:=--with-tune=$(BR2_GCC_TARGET_TUNE)
|
||||
endif
|
||||
ifneq ($(strip $(subst ",,$(BR2_GCC_TARGET_ABI))),)
|
||||
# ")))
|
||||
GCC_WITH_ABI:=--with-abi=$(BR2_GCC_TARGET_ABI)
|
||||
endif
|
||||
ifdef BR2_cortex_m3
|
||||
GCC_WITH_MODE:=--with-mode=thumb
|
||||
endif
|
||||
@@ -0,0 +1,226 @@
|
||||
# Makefile for to build a gcc/nuttx toolchain
|
||||
#
|
||||
# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
|
||||
# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# Without sysroot support. Sysroot toolchain is gcc-uclibc-4.x.mk
|
||||
ifneq ($(BR2_GCC_SUPPORTS_SYSROOT),y)
|
||||
|
||||
GCC_OFFICIAL_VER:=$(GCC_VERSION)
|
||||
GCC_SITE:=http://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VERSION)
|
||||
|
||||
GCC_SOURCE:=gcc-$(GCC_OFFICIAL_VER).tar.bz2
|
||||
GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_OFFICIAL_VER)
|
||||
GCC_CAT:=$(BZCAT)
|
||||
GCC_STRIP_HOST_BINARIES:=true
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# Setup some initial stuff
|
||||
#
|
||||
#############################################################
|
||||
|
||||
GCC_TARGET_LANGUAGES:=c
|
||||
GCC_TARGET_PREREQ=
|
||||
GCC_STAGING_PREREQ=
|
||||
|
||||
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
||||
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),c++
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_INSTALL_LIBGCJ),y)
|
||||
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),java
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_INSTALL_OBJC),y)
|
||||
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_INSTALL_FORTRAN),y)
|
||||
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
|
||||
endif
|
||||
|
||||
GCC_SHARED_LIBGCC:=--disable-shared
|
||||
|
||||
ifneq ($(BR2_ENABLE_LOCALE),y)
|
||||
GCC_ENABLE_CLOCALE:=--disable-clocale
|
||||
endif
|
||||
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# build the gcc compiler
|
||||
#
|
||||
#############################################################
|
||||
GCC_BUILD_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-build
|
||||
|
||||
$(DL_DIR)/$(GCC_SOURCE):
|
||||
mkdir -p $(DL_DIR)
|
||||
$(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
|
||||
|
||||
gcc-unpacked: $(GCC_DIR)/.unpacked
|
||||
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
|
||||
mkdir -p $(TOOL_BUILD_DIR)
|
||||
$(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
|
||||
$(CONFIG_UPDATE) $(GCC_DIR)
|
||||
touch $@
|
||||
|
||||
gcc-patched: $(GCC_DIR)/.patched
|
||||
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
|
||||
# Apply any files named gcc-*.patch from the source directory to gcc
|
||||
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
|
||||
|
||||
# Note: The soft float situation has improved considerably with gcc 3.4.x.
|
||||
# We can dispense with the custom spec files, as well as libfloat for the arm case.
|
||||
# However, we still need a patch for arm. There's a similar patch for gcc 3.3.x
|
||||
# which needs to be integrated so we can kill of libfloat for good, except for
|
||||
# anyone (?) who might still be using gcc 2.95. mjn3
|
||||
ifeq ($(BR2_SOFT_FLOAT),y)
|
||||
ifeq ("$(strip $(ARCH))","arm")
|
||||
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
|
||||
endif
|
||||
ifeq ("$(strip $(ARCH))","armeb")
|
||||
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
|
||||
endif
|
||||
# Not yet updated to 3.4.1.
|
||||
#ifeq ("$(strip $(ARCH))","i386")
|
||||
#toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc i386-gcc-soft-float.patch
|
||||
#endif
|
||||
endif
|
||||
touch $@
|
||||
|
||||
$(GCC_BUILD_DIR)/.configured: $(GCC_DIR)/.patched $(GCC_STAGING_PREREQ)
|
||||
mkdir -p $(GCC_BUILD_DIR)
|
||||
# Important! Required for limits.h to be fixed.
|
||||
ln -snf ../include $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
|
||||
(cd $(GCC_BUILD_DIR); rm -rf config.cache; PATH=$(TARGET_PATH) \
|
||||
CC="$(HOSTCC)" \
|
||||
$(GCC_DIR)/configure \
|
||||
--prefix=$(STAGING_DIR) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--host=$(GNU_HOST_NAME) \
|
||||
--target=$(REAL_GNU_TARGET_NAME) \
|
||||
--enable-languages=$(GCC_TARGET_LANGUAGES) \
|
||||
--disable-__cxa_atexit \
|
||||
--enable-target-optspace \
|
||||
--with-gnu-ld \
|
||||
$(GCC_SHARED_LIBGCC) \
|
||||
$(DISABLE_NLS) \
|
||||
$(THREADS) \
|
||||
$(MULTILIB) \
|
||||
$(SOFT_FLOAT_CONFIG_OPTION) \
|
||||
$(GCC_WITH_ARCH) $(GCC_WITH_TUNE) $(GCC_WITH_MODE) \
|
||||
$(GCC_USE_SJLJ_EXCEPTIONS) \
|
||||
$(DISABLE_LARGEFILE) \
|
||||
$(EXTRA_GCC_CONFIG_OPTIONS));
|
||||
touch $@
|
||||
|
||||
$(GCC_BUILD_DIR)/.compiled: $(GCC_BUILD_DIR)/.configured
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR) all
|
||||
touch $@
|
||||
|
||||
$(GCC_BUILD_DIR)/.installed: $(GCC_BUILD_DIR)/.compiled
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR) install
|
||||
if [ -d "$(STAGING_DIR)/lib64" ] ; then \
|
||||
if [ ! -e "$(STAGING_DIR)/lib" ] ; then \
|
||||
mkdir "$(STAGING_DIR)/lib" ; \
|
||||
fi ; \
|
||||
mv "$(STAGING_DIR)/lib64/"* "$(STAGING_DIR)/lib/" ; \
|
||||
rmdir "$(STAGING_DIR)/lib64" ; \
|
||||
fi
|
||||
# Strip the host binaries
|
||||
ifeq ($(GCC_STRIP_HOST_BINARIES),true)
|
||||
-strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/*
|
||||
endif
|
||||
# Make sure we have 'cc'.
|
||||
if [ ! -e $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-cc ] ; then \
|
||||
ln -snf $(REAL_GNU_TARGET_NAME)-gcc \
|
||||
$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-cc ; \
|
||||
fi;
|
||||
if [ ! -e $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/cc ] ; then \
|
||||
ln -snf gcc $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/cc ; \
|
||||
fi;
|
||||
# Set up the symlinks to enable lying about target name.
|
||||
set -e; \
|
||||
(cd $(STAGING_DIR); \
|
||||
if [ "$(REAL_GNU_TARGET_NAME)" != "$(GNU_TARGET_NAME)" ]; then \
|
||||
ln -snf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
|
||||
cd bin; \
|
||||
for app in $(REAL_GNU_TARGET_NAME)-* ; do \
|
||||
ln -snf $${app} \
|
||||
$(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
|
||||
done; \
|
||||
fi; \
|
||||
);
|
||||
#
|
||||
# Now for the ugly 3.3.x soft float hack...
|
||||
#
|
||||
ifeq ($(BR2_SOFT_FLOAT),y)
|
||||
ifeq ($(findstring 3.3.,$(GCC_VERSION)),3.3.)
|
||||
# Make sure we have a soft float specs file for this arch
|
||||
if [ ! -f toolchain/gcc/$(GCC_VERSION)/specs-$(ARCH)-soft-float ] ; then \
|
||||
echo soft float configured but no specs file for this arch ; \
|
||||
/bin/false ; \
|
||||
fi;
|
||||
# Replace specs file with one that defaults to soft float mode.
|
||||
if [ ! -f $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs ] ; then \
|
||||
echo staging dir specs file is missing ; \
|
||||
/bin/false ; \
|
||||
fi;
|
||||
cp toolchain/gcc/$(GCC_VERSION)/specs-$(ARCH)-soft-float $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
|
||||
endif
|
||||
endif
|
||||
#
|
||||
# Ok... that's enough of that.
|
||||
#
|
||||
touch $@
|
||||
|
||||
$(GCC_BUILD_DIR)/.libs_installed: $(GCC_BUILD_DIR)/.installed
|
||||
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
||||
# We have disabled building of libstdc++ for NuttX
|
||||
#-cp -dpf $(STAGING_DIR)/lib/libstdc++.so* $(TARGET_DIR)/lib/
|
||||
endif
|
||||
ifeq ($(BR2_INSTALL_LIBGCJ),y)
|
||||
-cp -dpf $(STAGING_DIR)/lib/libgcj.so* $(TARGET_DIR)/lib/
|
||||
-cp -dpf $(STAGING_DIR)/lib/lib-org-w3c-dom.so* $(TARGET_DIR)/lib/
|
||||
-cp -dpf $(STAGING_DIR)/lib/lib-org-xml-sax.so* $(TARGET_DIR)/lib/
|
||||
-mkdir -p $(TARGET_DIR)/usr/lib/security
|
||||
-cp -dpf $(STAGING_DIR)/usr/lib/security/libgcj.security $(TARGET_DIR)/usr/lib/security/
|
||||
-cp -dpf $(STAGING_DIR)/usr/lib/security/classpath.security $(TARGET_DIR)/usr/lib/security/
|
||||
endif
|
||||
touch $@
|
||||
|
||||
gcc: binutils $(LIBFLOAT_TARGET) \
|
||||
$(GCC_BUILD_DIR)/.installed $(GCC_BUILD_DIR)/.libs_installed \
|
||||
$(GCC_TARGETS)
|
||||
|
||||
gcc-source: $(DL_DIR)/$(GCC_SOURCE)
|
||||
|
||||
gcc-clean:
|
||||
rm -rf $(GCC_BUILD_DIR)
|
||||
for prog in cpp gcc gcc-[0-9]* protoize unprotoize gcov gccbug cc; do \
|
||||
rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-$$prog \
|
||||
rm -f $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-$$prog; \
|
||||
done
|
||||
|
||||
gcc-dirclean:
|
||||
rm -rf $(GCC_BUILD_DIR)
|
||||
|
||||
ifeq ($(strip $(BR2_PACKAGE_GCC)),y)
|
||||
TARGETS += gcc
|
||||
endif
|
||||
endif
|
||||
@@ -0,0 +1,208 @@
|
||||
# Makefile for to build a gcc/nuttx toolchain
|
||||
#
|
||||
# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
|
||||
# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# sysroot support works with gcc >= 4.2.0 only
|
||||
ifeq ($(BR2_GCC_SUPPORTS_SYSROOT),y)
|
||||
|
||||
GCC_OFFICIAL_VER:=$(GCC_VERSION)
|
||||
GCC_SITE:=http://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VERSION)
|
||||
#GCC_SITE:=ftp://ftp.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gcc/gcc-$(GCC_OFFICIAL_VER)
|
||||
|
||||
GCC_SOURCE:=gcc-$(GCC_OFFICIAL_VER).tar.bz2
|
||||
GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_OFFICIAL_VER)
|
||||
GCC_CAT:=$(BZCAT)
|
||||
GCC_STRIP_HOST_BINARIES:=true
|
||||
|
||||
# gcc 4.6.x quadmath requires wchar
|
||||
ifneq ($(BR2_TOOLCHAIN_BUILDROOT_WCHAR),y)
|
||||
GCC_QUADMATH=--disable-libquadmath
|
||||
endif
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# Setup some initial stuff
|
||||
#
|
||||
#############################################################
|
||||
|
||||
GCC_TARGET_LANGUAGES:=c
|
||||
|
||||
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
||||
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),c++
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_INSTALL_LIBGCJ),y)
|
||||
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),java
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_INSTALL_OBJC),y)
|
||||
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_INSTALL_FORTRAN),y)
|
||||
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
|
||||
endif
|
||||
|
||||
GCC_SHARED_LIBGCC:=--disable-shared
|
||||
|
||||
ifneq ($(BR2_ENABLE_LOCALE),y)
|
||||
GCC_ENABLE_CLOCALE:=--disable-clocale
|
||||
endif
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# build the gcc compiler
|
||||
#
|
||||
#############################################################
|
||||
GCC_BUILD_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-build
|
||||
|
||||
$(DL_DIR)/$(GCC_SOURCE):
|
||||
mkdir -p $(DL_DIR)
|
||||
$(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
|
||||
|
||||
gcc-unpacked: $(GCC_DIR)/.unpacked
|
||||
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
|
||||
mkdir -p $(TOOL_BUILD_DIR)
|
||||
$(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
|
||||
$(CONFIG_UPDATE) $(GCC_DIR)
|
||||
touch $@
|
||||
|
||||
gcc-patched: $(GCC_DIR)/.patched
|
||||
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
|
||||
# Apply any files named gcc-*.patch from the source directory to gcc
|
||||
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
|
||||
|
||||
# Note: The soft float situation has improved considerably with gcc 3.4.x.
|
||||
# We can dispense with the custom spec files, as well as libfloat for the arm case.
|
||||
# However, we still need a patch for arm. There's a similar patch for gcc 3.3.x
|
||||
# which needs to be integrated so we can kill of libfloat for good, except for
|
||||
# anyone (?) who might still be using gcc 2.95. mjn3
|
||||
ifeq ($(BR2_SOFT_FLOAT),y)
|
||||
ifeq ("$(strip $(ARCH))","arm")
|
||||
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
|
||||
endif
|
||||
ifeq ("$(strip $(ARCH))","armeb")
|
||||
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
|
||||
endif
|
||||
endif
|
||||
touch $@
|
||||
|
||||
$(GCC_BUILD_DIR)/.configured: $(GCC_DIR)/.patched
|
||||
mkdir -p $(GCC_BUILD_DIR)
|
||||
# Important! Required for limits.h to be fixed.
|
||||
ln -snf ../include/ $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
|
||||
(cd $(GCC_BUILD_DIR); rm -rf config.cache; PATH=$(TARGET_PATH) \
|
||||
CC="$(HOSTCC)" \
|
||||
$(GCC_DIR)/configure \
|
||||
--prefix=$(STAGING_DIR) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--host=$(GNU_HOST_NAME) \
|
||||
--target=$(REAL_GNU_TARGET_NAME) \
|
||||
--enable-languages=$(GCC_TARGET_LANGUAGES) \
|
||||
--disable-__cxa_atexit \
|
||||
--disable-libssp \
|
||||
--enable-target-optspace \
|
||||
--with-gnu-ld \
|
||||
$(GCC_SHARED_LIBGCC) \
|
||||
$(DISABLE_NLS) \
|
||||
$(THREADS) \
|
||||
$(MULTILIB) \
|
||||
$(SOFT_FLOAT_CONFIG_OPTION) \
|
||||
$(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) $(GCC_WITH_MODE) \
|
||||
$(GCC_USE_SJLJ_EXCEPTIONS) \
|
||||
$(DISABLE_LARGEFILE) \
|
||||
$(EXTRA_GCC_CONFIG_OPTIONS));
|
||||
touch $@
|
||||
|
||||
$(GCC_BUILD_DIR)/.compiled: $(GCC_BUILD_DIR)/.configured
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR) all
|
||||
touch $@
|
||||
|
||||
$(GCC_BUILD_DIR)/.installed: $(GCC_BUILD_DIR)/.compiled
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR) install
|
||||
if [ -d "$(STAGING_DIR)/lib64" ] ; then \
|
||||
if [ ! -e "$(STAGING_DIR)/lib" ] ; then \
|
||||
mkdir "$(STAGING_DIR)/lib" ; \
|
||||
fi ; \
|
||||
mv "$(STAGING_DIR)/lib64/"* "$(STAGING_DIR)/lib/" ; \
|
||||
rmdir "$(STAGING_DIR)/lib64" ; \
|
||||
fi
|
||||
# Strip the host binaries
|
||||
ifeq ($(GCC_STRIP_HOST_BINARIES),true)
|
||||
-strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/*
|
||||
endif
|
||||
# Make sure we have 'cc'.
|
||||
if [ ! -e $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-cc ] ; then \
|
||||
ln -snf $(REAL_GNU_TARGET_NAME)-gcc \
|
||||
$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-cc ; \
|
||||
fi;
|
||||
if [ ! -e $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/cc ] ; then \
|
||||
ln -snf gcc $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/cc ; \
|
||||
fi;
|
||||
# Set up the symlinks to enable lying about target name.
|
||||
set -e; \
|
||||
(cd $(STAGING_DIR); \
|
||||
if [ "$(REAL_GNU_TARGET_NAME)" != "$(GNU_TARGET_NAME)" ]; then \
|
||||
ln -snf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
|
||||
cd bin; \
|
||||
for app in $(REAL_GNU_TARGET_NAME)-* ; do \
|
||||
ln -snf $${app} \
|
||||
$(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
|
||||
done; \
|
||||
fi; \
|
||||
);
|
||||
#
|
||||
# Ok... that's enough of that.
|
||||
#
|
||||
touch $@
|
||||
|
||||
$(GCC_BUILD_DIR)/.libs_installed: $(GCC_BUILD_DIR)/.installed
|
||||
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
||||
# We have disabled building of libstdc++ for NuttX
|
||||
#-cp -dpf $(STAGING_DIR)/lib/libstdc++.so* $(TARGET_DIR)/lib/
|
||||
endif
|
||||
ifeq ($(BR2_INSTALL_LIBGCJ),y)
|
||||
-cp -dpf $(STAGING_DIR)/lib/libgcj.so* $(TARGET_DIR)/lib/
|
||||
-cp -dpf $(STAGING_DIR)/lib/lib-org-w3c-dom.so* $(TARGET_DIR)/lib/
|
||||
-cp -dpf $(STAGING_DIR)/lib/lib-org-xml-sax.so* $(TARGET_DIR)/lib/
|
||||
-mkdir -p $(TARGET_DIR)/usr/lib/security
|
||||
-cp -dpf $(STAGING_DIR)/usr/lib/security/libgcj.security $(TARGET_DIR)/usr/lib/security/
|
||||
-cp -dpf $(STAGING_DIR)/usr/lib/security/classpath.security $(TARGET_DIR)/usr/lib/security/
|
||||
endif
|
||||
touch $@
|
||||
|
||||
gcc: binutils $(LIBFLOAT_TARGET) \
|
||||
$(GCC_BUILD_DIR)/.installed $(GCC_BUILD_DIR)/.libs_installed \
|
||||
$(GCC_TARGETS)
|
||||
|
||||
gcc-source: $(DL_DIR)/$(GCC_SOURCE)
|
||||
|
||||
gcc-clean:
|
||||
rm -rf $(GCC_BUILD_DIR)
|
||||
for prog in cpp gcc gcc-[0-9]* protoize unprotoize gcov gccbug cc; do \
|
||||
rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-$$prog \
|
||||
rm -f $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-$$prog; \
|
||||
done
|
||||
|
||||
gcc-dirclean:
|
||||
rm -rf $(GCC_BUILD_DIR)
|
||||
|
||||
ifeq ($(strip $(BR2_PACKAGE_GCC)),y)
|
||||
TARGETS += gcc
|
||||
endif
|
||||
endif
|
||||
@@ -0,0 +1,61 @@
|
||||
diff -urN gcc-3.3.2-orig/gcc/config/i386/i386.h gcc-3.3.2/gcc/config/i386/i386.h
|
||||
--- gcc-3.3.2-orig/gcc/config/i386/i386.h 2003-06-25 16:18:31.000000000 -0500
|
||||
+++ gcc-3.3.2/gcc/config/i386/i386.h 2003-10-22 01:46:57.000000000 -0500
|
||||
@@ -653,6 +653,7 @@
|
||||
/* Define for XFmode or TFmode extended real floating point support.
|
||||
The XFmode is specified by i386 ABI, while TFmode may be faster
|
||||
due to alignment and simplifications in the address calculations. */
|
||||
+#if 0
|
||||
#define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : 96)
|
||||
#define MAX_LONG_DOUBLE_TYPE_SIZE 128
|
||||
#ifdef __x86_64__
|
||||
@@ -660,6 +661,17 @@
|
||||
#else
|
||||
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 96
|
||||
#endif
|
||||
+#else
|
||||
+ /* Set up for x86 soft float with 64-bit long doubles, since that's
|
||||
+ * all the soft float emulation supports. */
|
||||
+#define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : (TARGET_80387 ? 96 : 64))
|
||||
+#define MAX_LONG_DOUBLE_TYPE_SIZE 128
|
||||
+#ifdef __x86_64__
|
||||
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
|
||||
+#else
|
||||
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE (TARGET_80387 ? 96 : 64)
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
/* Set the value of FLT_EVAL_METHOD in float.h. When using only the
|
||||
FPU, assume that the fpcw is set to extended precision; when using
|
||||
diff -urN gcc-3.3.2-orig/gcc/config/t-linux gcc-3.3.2/gcc/config/t-linux
|
||||
--- gcc-3.3.2-orig/gcc/config/t-linux-uclibc 2003-06-04 11:56:11.000000000 -0500
|
||||
+++ gcc-3.3.2/gcc/config/t-linux-uclibc 2003-10-22 01:46:39.000000000 -0500
|
||||
@@ -21,3 +21,28 @@
|
||||
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
|
||||
$(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
|
||||
LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
|
||||
+
|
||||
+##############################################
|
||||
+# We want fine grained libraries, so use the new code to build the
|
||||
+# floating point emulation libraries.
|
||||
+FPBIT = fp-bit.c
|
||||
+DPBIT = dp-bit.c
|
||||
+
|
||||
+#LIB2FUNCS_EXTRA = xp-bit.c
|
||||
+
|
||||
+dp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
+ echo '#ifdef __LITTLE_ENDIAN__' > dp-bit.c
|
||||
+ echo '#define FLOAT_BIT_ORDER_MISMATCH' >>dp-bit.c
|
||||
+ echo '#endif' >> dp-bit.c
|
||||
+ cat $(srcdir)/config/fp-bit.c >> dp-bit.c
|
||||
+
|
||||
+fp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
+ echo '#define FLOAT' > fp-bit.c
|
||||
+ echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
|
||||
+ echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
|
||||
+ echo '#endif' >> fp-bit.c
|
||||
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
||||
+
|
||||
+#MULTILIB_OPTIONS = msoft-float
|
||||
+#MULTILIB_DIRNAMES = soft-float
|
||||
+
|
||||
Reference in New Issue
Block a user