summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgignore25
-rw-r--r--.hgtags32
-rw-r--r--.version2
-rw-r--r--README74
-rw-r--r--TODO9
-rw-r--r--config/cc/gcc.in15
-rw-r--r--config/companion_libs.in65
-rw-r--r--config/companion_libs/cloog.in19
-rw-r--r--config/companion_libs/gmp.in18
-rw-r--r--config/companion_libs/mpc.in19
-rw-r--r--config/companion_libs/mpfr.in8
-rw-r--r--config/companion_libs/ppl.in14
-rw-r--r--config/debug/duma.in5
-rw-r--r--config/debug/gdb.in8
-rw-r--r--config/debug/ltrace.in5
-rw-r--r--config/global/build-behave.in72
-rw-r--r--config/kernel/linux.in82
-rw-r--r--config/libc/eglibc.in5
-rw-r--r--config/toolchain.in2
-rw-r--r--config/tools/libelf.in5
-rwxr-xr-xconfigure23
-rw-r--r--docs/overview.txt53
-rw-r--r--patches/duma/2_5_15/100-cross-compile.patch32
-rw-r--r--patches/duma/2_5_15/110-separate_cpp.patch19
-rw-r--r--patches/eglibc/2_10/100-powerpc-8xx-CPU15-errata.patch49
-rw-r--r--patches/gcc/4.3.2/380-pr37436.patch86
-rw-r--r--patches/gcc/4.3.3/380-pr37436.patch86
-rw-r--r--patches/gcc/4.3.4/100-alpha-mieee-default.patch39
-rw-r--r--patches/gcc/4.3.4/110-trampolinewarn.patch40
-rw-r--r--patches/gcc/4.3.4/120-java-nomulti.patch52
-rw-r--r--patches/gcc/4.3.4/130-cross-compile.patch49
-rw-r--r--patches/gcc/4.3.4/140-netbsd-symbolic.patch19
-rw-r--r--patches/gcc/4.3.4/150-sparc64-bsd.patch35
-rw-r--r--patches/gcc/4.3.4/160-flatten-switch-stmt-00.patch81
-rw-r--r--patches/gcc/4.3.4/170-libiberty-pic.patch17
-rw-r--r--patches/gcc/4.3.4/180-superh-default-multilib.patch30
-rw-r--r--patches/gcc/4.3.4/190-libstdc++-pic.patch61
-rw-r--r--patches/gcc/4.3.4/200-pr24170.patch66
-rw-r--r--patches/gcc/4.3.4/210-noteGNUstack-00.patch101
-rw-r--r--patches/gcc/4.3.4/220-noteGNUstack-01.patch203
-rw-r--r--patches/gcc/4.3.4/230-pr34571.patch28
-rw-r--r--patches/gcc/4.3.4/240-pr25343.patch26
-rw-r--r--patches/gcc/4.3.4/250-sh-pr24836.patch33
-rw-r--r--patches/gcc/4.3.4/260-uclibc-conf-noupstream.patch18
-rw-r--r--patches/gcc/4.3.4/270-missing-execinfo_h.patch18
-rw-r--r--patches/gcc/4.3.4/280-c99-complex-ugly-hack.patch19
-rw-r--r--patches/gcc/4.3.4/290-index_macro.patch32
-rw-r--r--patches/gcc/4.3.4/300-libmudflap-susv3-legacy.patch54
-rw-r--r--patches/gcc/4.3.4/310-arm-softfloat.patch34
-rw-r--r--patches/gcc/4.3.4/320-alpha-signal_h.patch23
-rw-r--r--patches/gcc/4.3.4/330-unwind-for-uClibc.patch30
-rw-r--r--patches/gcc/4.3.4/340-make-mno-spe-work-as-expected.patch90
-rw-r--r--patches/gcc/4.3.4/350-sh-without-headers.patch29
-rw-r--r--patches/gcc/4.3.4/380-pr37436.patch86
-rw-r--r--patches/gcc/4.4.0/100-alpha-mieee-default.patch24
-rw-r--r--patches/gcc/4.4.0/110-trampolinewarn.patch27
-rw-r--r--patches/gcc/4.4.0/120-java-nomulti.patch46
-rw-r--r--patches/gcc/4.4.0/130-cross-compile.patch39
-rw-r--r--patches/gcc/4.4.0/140-default-format-security.patch49
-rw-r--r--patches/gcc/4.4.0/150-default-fortify-source.patch26
-rw-r--r--patches/gcc/4.4.0/160-netbsd-symbolic.patch11
-rw-r--r--patches/gcc/4.4.0/170-sparc64-bsd.patch29
-rw-r--r--patches/gcc/4.4.0/180-libgomp-no-werror.patch12
-rw-r--r--patches/gcc/4.4.0/190-flatten-switch-stmt-00.patch24
-rw-r--r--patches/gcc/4.4.0/200-libiberty.h-asprintf.patch15
-rw-r--r--patches/gcc/4.4.0/210-arm-unbreak-armv4t.patch12
-rw-r--r--patches/gcc/4.4.0/220-libiberty-pic.patch11
-rw-r--r--patches/gcc/4.4.0/230-superh-default-multilib.patch12
-rw-r--r--patches/gcc/4.4.0/240-libstdc++-pic.patch53
-rw-r--r--patches/gcc/4.4.0/250-ia64-noteGNUstack.patch79
-rw-r--r--patches/gcc/4.4.0/260-sh-libgcc-stacks.patch25
-rw-r--r--patches/gcc/4.4.0/270-sh-pr24836.patch24
-rw-r--r--patches/gcc/4.4.0/280-freebsd.patch94
-rw-r--r--patches/gcc/4.4.0/290-freebsd.patch64
-rw-r--r--patches/gcc/4.4.0/300-pr40105.patch180
-rw-r--r--patches/gcc/4.4.0/310-uclibc-conf.patch35
-rw-r--r--patches/gcc/4.4.0/320-missing-execinfo_h.patch12
-rw-r--r--patches/gcc/4.4.0/330-c99-snprintf.patch12
-rw-r--r--patches/gcc/4.4.0/340-libmudflap-susv3-legacy.patch48
-rw-r--r--patches/glibc/2.9/560-syslog.patch12
-rw-r--r--patches/glibc/2.9/570-debug-readlink_chk-readklinkat_chk.patch24
-rw-r--r--patches/gmp/4.3.1/100-multiplicity-that-does-not-fit-an-int.patch33
-rw-r--r--patches/gmp/4.3.1/110-unbounded-alloc.patch31
-rw-r--r--patches/libelf/0.8.11/100-fix-64-bit-detection.patch24
-rw-r--r--patches/ltrace/0.5.2/100-allow-cross-compile.patch77
-rw-r--r--patches/ltrace/0.5.2/110-alpha-support.patch11
-rw-r--r--patches/ltrace/0.5.2/120-debian-ltrace-0.5.2-2.patch240
-rw-r--r--patches/mpfr/2.4.1/150-test-tmul.patch40
-rw-r--r--patches/strace/4.5.18/180-arm-EABI-syscalls.patch23
-rw-r--r--samples/arm-beagle-linux-gnueabi/crosstool.config406
-rw-r--r--samples/arm-beagle-linux-gnueabi/reported.by3
-rw-r--r--samples/arm-cortex_a8-linux-gnueabi/crosstool.config426
-rw-r--r--samples/arm-cortex_a8-linux-gnueabi/reported.by3
-rw-r--r--samples/mingw32,i686-none-linux-gnu/crosstool.config357
-rw-r--r--samples/mingw32,i686-none-linux-gnu/reported.by3
-rwxr-xr-xscripts/addToolVersion.sh9
-rw-r--r--scripts/build/cc/gcc.sh61
-rw-r--r--scripts/build/companion_libs/cloog.sh63
-rw-r--r--scripts/build/companion_libs/gmp.sh19
-rw-r--r--scripts/build/companion_libs/mpc.sh57
-rw-r--r--scripts/build/companion_libs/mpfr.sh20
-rw-r--r--scripts/build/companion_libs/ppl.sh17
-rw-r--r--scripts/build/internals.sh33
-rw-r--r--scripts/build/libc/glibc.sh25
-rwxr-xr-xscripts/config.guess61
-rwxr-xr-xscripts/config.sub15
-rw-r--r--scripts/crosstool-NG.sh.in118
-rw-r--r--scripts/functions32
-rw-r--r--scripts/populate.in76
-rw-r--r--scripts/saveSample.sh.in28
-rwxr-xr-xscripts/showSamples.sh24
-rw-r--r--scripts/wrapper.in15
-rw-r--r--steps.mk2
113 files changed, 5157 insertions, 339 deletions
diff --git a/.hgignore b/.hgignore
new file mode 100644
index 0000000..50f7a5d
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,25 @@
+syntax: glob
+
+# Generated files
+Makefile
+ct-ng
+docs/ct-ng.1
+docs/ct-ng.1.gz
+paths.mk
+scripts/crosstool-NG.sh
+scripts/saveSample.sh
+scripts/showTuple.sh
+
+# Temporaries
+.*.swp
+log.*
+
+# Working files
+kconfig/conf
+kconfig/mconf
+kconfig/**.o
+kconfig/**.dep
+config.gen/
+.config
+.config.old
+targets/
diff --git a/.hgtags b/.hgtags
new file mode 100644
index 0000000..69220b1
--- /dev/null
+++ b/.hgtags
@@ -0,0 +1,32 @@
+1161124240eecdd9985ed8bb1f656f73e11ac7f5 crosstool-ng-1.0.0
+1853cda9d5fcc8f00c1b8825a3cdd35ab186f5a2 crosstool-ng-1.4.1
+1ee5aab4c728e9af94d978c6beb722804ec6445e crosstool-ng-0.1.1
+26c0b9e2925f2517d1e245c2f851195926e55402 crosstool-ng-1.2.4
+29233430562ffa6fa2c6c1231df0a42893ed1a8d crosstool-ng-1.1.2
+2be7232a73ac3fe09d2fb73b9c01678d3b14e577 crosstool-ng-0.2.2
+30c199c6c1d883bce387079c5008f6fc88575ad4 crosstool-ng-1.2.5
+35aaf07763d1e5d0736ca32e307e6c1d6a54947a crosstool-ng-1.1.3
+39b1c755f19bfd5b714ca85cc7640d976dcefdff crosstool-ng-1.4.0
+4150b61102e471c4fbc08f107e863505eff77864 crosstool-ng-1.3.3
+535c6e0a057c64a88b5bba9a3f57f2bbff5657c3 crosstool-ng-1.3.0
+565d6d12f13974dbec80ae83c9af8311d7baa845 crosstool-ng-0.0.1
+5d14c00467ab59eabe9b1066f3d32fb893c2cda3 crosstool-ng-0.2.0
+60e62e0a90e249fc010065838e0c5be96d744af7 crosstool-ng-0.0.5
+696c97af4379cdcdaad1ac14875385cfeee8ca00 crosstool-ng-0.3.1
+6ca745eb9aaa1a91cb3721210749d1105a6b1b81 crosstool-ng-0.2.1
+6d8384a866925ab311d1c096e260512752f22528 crosstool-ng-0.3.2
+6ed7374c84784e677bbfcbb783bc14db619e9205 crosstool-ng-1.3.1
+6f4ad1b466b57c90259f82e4540df21e99a99881 crosstool-ng-1.2.2
+78e3bf9373e2d80c0ffde27f9462b12cfe787eb6 crosstool-ng-1.3.2
+8031c8ac452a2d3e66862f914127831c1dca895e crosstool-ng-1.1.1
+8451e5083069718465430c6fe7b3e0b192f40d75 crosstool-ng-1.2.0
+88cc5f5c0807c349e37d889b4ad58ede4f09ee68 crosstool-ng-0.1.2
+a393e449f6ba3987298a1154ca48b15c8f66f2fa crosstool-ng-0.0.3
+a44f2ee18392a60c6097c32dbd7ad28dc67e28fe crosstool-ng-1.1.0
+a8cd2d0d06bd0a9233c897c165bd8dfc927fa317 crosstool-ng-0.3.0
+b48b98717e16ebb58235c106e048bad729e79bbb crosstool-ng-1.2.1
+b8de3e11c8b49fd290c15e576cd6611db35ab3dd crosstool-ng-1.2.3
+c71b4f4da4b46aa83e6c013208731edfffd249a1 crosstool-ng-0.0.4
+ce34b7cd6509906de6885c084dbef7ddecd603c6 crosstool-ng-1.1.3a
+e016efb7036c14f86e1592114e621cfadeaf714c crosstool-ng-0.0.2
+fec15dd785b1ab52e15a350665362c3f58852931 crosstool-ng-0.1.0
diff --git a/.version b/.version
index c064af4..cbb0de2 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-svn
+hg
diff --git a/README b/README
index 5c1af82..855b9d7 100644
--- a/README
+++ b/README
@@ -1,29 +1,87 @@
This is the README for crosstool-NG
+TABLE OF CONTENT /
+________________/
+
+ - GETTING STARTED
+ - PARTICIPATING
+ - Sending a bug report
+ - Sending patches
+ - CREDITS
+ - KNOWN ISSUES
+
+
+GETTING STARTED /
+_______________/
+
To get you started, just enter:
./configure --help
You can find a (terse and WIP) documentation in docs/overview.txt.
You can also point your browser to
- http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool
+ http://ymorin.is-a-geek.org/projects/crosstool
-If you want to enhance crosstool-NG, there's a to-do list in the TODO file.
+PARTICIPATING /
+_____________/
+
+Sending a bug report
+--------------------
+
+If you need to send a bug report, please send a mail with subject
+ prefixed with "[CT_NG]" with to following destinations:
+ TO: yann.morin.1998 (at) anciens.enib.fr
+ CC: crossgcc (at) sourceware.org
-If you need to send a bug report or a patch, please send a mail with subject
-prefixed with "[CT_NG]" with the following destinations:
- TO: yann.morin.1998 (at) anciens.enib.fr
- CC: crossgcc (at) sourceware.org
+Sending patches
+---------------
+
+If you want to enhance crosstool-NG, there's a to-do list in the TODO file.
Patches should come with the appropriate SoB line. A SoB line is typically
-something like:
- Signed-off-by: John DOE <john.doe@somewhere.net>
+ something like:
+ Signed-off-by: John DOE <john.doe@somewhere.net>
The SoB line is clearly described in Documentation/SubmittingPatches , section
12, of your favourite Linux kernel source tree.
+Then you'll need to correctly configure Mercurial. There are two extensions
+that you may find usefull:
+ - mq : http://mercurial.selenic.com/wiki/MqExtension
+ - patchbomb : http://mercurial.selenic.com/wiki/PatchbombExtension
+
+Here's a typical hacking session:
+ hg clone http://ymorin.is-a-geek.org/hg/crosstool-ng crosstool-ng
+ cd crosstool-ng
+ hg qinit
+ hg qnew -D -U -e my_first_patch
+ *edit patch description*
+ *hack* *hack* *check* *fails* *hack* *hack* *check* *works*
+ hg qref -D -e
+ *edit patch description, serving as commit message*
+ hg qnew -D -U -e my_second_patch
+ *edit patch description*
+ *hack* *hack* *check* *fails* *hack* *hack* *check* *works*
+ hg qref -D -e
+ *edit patch description, serving as commit message*
+ hg email --outgoing --intro \
+ --from '"Your Full NAME" <your.email (at) your.domain>' \
+ --to '"Yann E. MORIN" <yann.morin.1998 (at) anciens.enib.fr>' \
+ --cc 'crossgcc (at) sourceware.org'
+ *edit introductory message*
+ *wait for feedback*
+ *re-send if no answer for a few days*
+
+Note: replace' (at) ' above with a plain '@'.
+
+CREDITS /
+_______/
+
The people that helped are listed in docs/CREDITS. Many thanks to them! :-)
+KNOWN ISSUES /
+____________/
+
The list of known issues is listed in docs/known-issues.txt.
Aloha!
diff --git a/TODO b/TODO
index 7c7757d..eadfc09 100644
--- a/TODO
+++ b/TODO
@@ -5,14 +5,7 @@ Recuring tasks:
- update versions for every tools...
-
-Non-recurring:
-
-- gcc-4.4
- - requires some companion libs:
- - PPL
- - CLoog
- - check that the patchset from 4.3.3 still applies
+Non-recurring tasks:
- uClinux
diff --git a/config/cc/gcc.in b/config/cc/gcc.in
index f601c0d..b21b3dc 100644
--- a/config/cc/gcc.in
+++ b/config/cc/gcc.in
@@ -111,6 +111,11 @@ config CC_V_4_3_3
prompt "4.3.3"
select CC_GCC_4_3_or_later
+config CC_V_4_3_4
+ bool
+ prompt "4.3.4"
+ select CC_GCC_4_3_or_later
+
config CC_V_4_4_0
bool
prompt "4.4.0 (EXPERIMENTAL)"
@@ -118,6 +123,13 @@ config CC_V_4_4_0
select CC_GCC_4_3_or_later
select CC_GCC_4_4_or_later
+config CC_V_4_4_1
+ bool
+ prompt "4.4.1 (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ select CC_GCC_4_3_or_later
+ select CC_GCC_4_4_or_later
+
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
endchoice
@@ -130,6 +142,7 @@ config CC_GCC_4_3_or_later
config CC_GCC_4_4_or_later
bool
default n
+ select PPL_CLOOG_MPC
config CC_VERSION
string
@@ -153,7 +166,9 @@ config CC_VERSION
default "4.3.1" if CC_V_4_3_1
default "4.3.2" if CC_V_4_3_2
default "4.3.3" if CC_V_4_3_3
+ default "4.3.4" if CC_V_4_3_4
default "4.4.0" if CC_V_4_4_0
+ default "4.4.1" if CC_V_4_4_1
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!
diff --git a/config/companion_libs.in b/config/companion_libs.in
index d581d80..9b059f0 100644
--- a/config/companion_libs.in
+++ b/config/companion_libs.in
@@ -20,35 +20,68 @@ config GMP_MPFR
- gcc
- gdb
-config GMP_MPFR_TARGET
- bool
- prompt "Build libraries for the target"
- depends on GMP_MPFR
- depends on ! BARE_METAL
- default n
- help
- Also build libraries for the target. This can be usefull if you want
- to later build a compiler that will run on the target, or if you want
- to run gdb natively on the target.
-
if GMP_MPFR
source config/companion_libs/gmp.in
source config/companion_libs/mpfr.in
endif
-config PPL_CLOOG
+config PPL_CLOOG_MPC
bool
- prompt "PPL and GLooG/PPL"
+ prompt "PPL, GLooG/PPL and MPC"
help
- gcc-4.4.0 and above requires both PPL and CLooG/PPL to build some
- parts of the optimiser (GRAPHITE loop optimisation, to be precise).
+ gcc-4.4.0 and above requires PPL and CLooG/PPL to build some parts
+ of the optimiser (GRAPHITE loop optimisation, to be precise).
+
+ In addition to those, gcc-4.4 also optionally uses MPC to enable
+ additional optimisations on complex numbers. Although MPC is optional,
+ crosstool-NG requires it and uses it to build gcc >= 4.4.0.
These will be automatically selected if you choose gcc>=4.4.0, but you
can say 'Y' here, although it is unknown yet if any other component
can use them.
-if PPL_CLOOG
+if PPL_CLOOG_MPC
source config/companion_libs/ppl.in
+source config/companion_libs/cloog.in
+source config/companion_libs/mpc.in
endif
+config FOO
+ bool
+
+comment "Companion libraries common options"
+ depends on GMP_MPFR || PPL_CLOOG_MPC
+
+config COMP_LIBS_CHECK
+ bool
+ prompt "| Check the companion libraries builds (!!! READ HELP!!!)"
+ depends on GMP_MPFR || PPL_CLOOG_MPC
+ default n
+ help
+ It is highly recommended to check the newly built companion libraries.
+ Unfortunately, this is a very intensive task, and takes a loooong time.
+
+ Checking the newly built companion libraries is thus disabled by default,
+ but it is suggested that you check them at least once on your machine,
+ and if they work, disable the check on subsequent builds.
+
+ If you suspect that one (or more) of your companion libraries is the
+ cause for incorrectly generated code, you should answer 'Y' here.
+ Note however that this will take a really long time. For example,
+ building PPL on my machine takes roughly 1'40", while checking it takes
+ about 1h40'...
+
+config COMP_LIBS_TARGET
+ bool
+ prompt "| Build companion libraries for the target"
+ depends on GMP_MPFR || PPL_CLOOG_MPC
+ depends on ! BARE_METAL
+ default n
+ help
+ Also build companion libraries for the target. This can be usefull if
+ you want to later build a compiler that will run on the target, or if
+ you want to run gdb natively on the target.
+
+ Please note that for now, crosstool-NG can only build GMP and MPFR so.
+
endmenu
diff --git a/config/companion_libs/cloog.in b/config/companion_libs/cloog.in
new file mode 100644
index 0000000..99779c9
--- /dev/null
+++ b/config/companion_libs/cloog.in
@@ -0,0 +1,19 @@
+# CLooG options
+
+choice
+ bool
+ prompt "CLooG/ppl version"
+
+config CLOOG_V_0_15_3
+ bool
+ prompt "0.15.3"
+
+# CT_INSERT_VERSION_ABOVE
+# Don't remove above line!
+endchoice
+
+config CLOOG_VERSION
+ string
+ default "0.15.3" if CLOOG_V_0_15_3
+# CT_INSERT_VERSION_STRING_ABOVE
+# Don't remove above line!
diff --git a/config/companion_libs/gmp.in b/config/companion_libs/gmp.in
index 0ac2b2c..a87f417 100644
--- a/config/companion_libs/gmp.in
+++ b/config/companion_libs/gmp.in
@@ -12,6 +12,14 @@ config GMP_V_4_2_4
bool
prompt "4.2.4"
+config GMP_V_4_3_0
+ bool
+ prompt "4.3.0"
+
+config GMP_V_4_3_1
+ bool
+ prompt "4.3.1"
+
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
endchoice
@@ -20,13 +28,7 @@ config GMP_VERSION
string
default "4.2.2" if GMP_V_4_2_2
default "4.2.4" if GMP_V_4_2_4
+ default "4.3.0" if GMP_V_4_3_0
+ default "4.3.1" if GMP_V_4_3_1
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!
-
-config GMP_CHECK
- bool
- prompt "Check GMP"
- default y
- help
- It is highly recommended that 'make check' is run against the newly built
- GMP library. See http://gmplib.org/
diff --git a/config/companion_libs/mpc.in b/config/companion_libs/mpc.in
new file mode 100644
index 0000000..0aa1369
--- /dev/null
+++ b/config/companion_libs/mpc.in
@@ -0,0 +1,19 @@
+# MPC options
+
+choice
+ bool
+ prompt "MPC version"
+
+config MPC_V_0_6
+ bool
+ prompt "0.6"
+
+# CT_INSERT_VERSION_ABOVE
+# Don't remove above line!
+endchoice
+
+config MPC_VERSION
+ string
+ default "0.6" if MPC_V_0_6
+# CT_INSERT_VERSION_STRING_ABOVE
+# Don't remove above line!
diff --git a/config/companion_libs/mpfr.in b/config/companion_libs/mpfr.in
index dcea326..910ab4e 100644
--- a/config/companion_libs/mpfr.in
+++ b/config/companion_libs/mpfr.in
@@ -32,11 +32,3 @@ config MPFR_VERSION
default "2.4.1" if MPFR_V_2_4_1
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!
-
-config MPFR_CHECK
- bool
- prompt "Check MPFR"
- default y
- help
- It is highly recommended that 'make check' is run against the newly built
- MPFR library. See http://gmplib.org/
diff --git a/config/companion_libs/ppl.in b/config/companion_libs/ppl.in
index d8f5906..efdeabf 100644
--- a/config/companion_libs/ppl.in
+++ b/config/companion_libs/ppl.in
@@ -17,17 +17,3 @@ config PPL_VERSION
default "0.10.2" if PPL_V_0_10_2
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!
-
-config PPL_CHECK
- bool
- prompt "Check PPL (!!! README !!!)"
- default n
- help
- Checking PPL is very intensive and takes a loooong time.
- The PPL folks do not recommend checking the library, but they do
- not recommend not checking it, either.
-
- Checking PPL is thus disabled by default.
-
- If you suspect that your PPL library is the cause for incorrectly
- generated code, you should answer 'Y' here.
diff --git a/config/debug/duma.in b/config/debug/duma.in
index eebb621..8c8caa4 100644
--- a/config/debug/duma.in
+++ b/config/debug/duma.in
@@ -37,6 +37,10 @@ config DUMA_V_2_5_14
bool
prompt "2_5_14"
+config DUMA_V_2_5_15
+ bool
+ prompt "2.5.15"
+
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
endchoice
@@ -47,5 +51,6 @@ config DUMA_VERSION
default "2_5_8" if DUMA_V_2_5_8
default "2_5_12" if DUMA_V_2_5_12
default "2_5_14" if DUMA_V_2_5_14
+ default "2.5.15" if DUMA_V_2_5_15
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!
diff --git a/config/debug/gdb.in b/config/debug/gdb.in
index 865a5f8..f21123d 100644
--- a/config/debug/gdb.in
+++ b/config/debug/gdb.in
@@ -20,7 +20,7 @@ config GDB_CROSS_STATIC
help
A static cross gdb can be usefull if you debug on a machine that is
not the one that is used to compile the toolchain.
-
+
That way, you can share the cross-gdb without installing a toolchain
on every machine that will be used to debug target programs.
@@ -59,14 +59,14 @@ config GDB_NATIVE_USE_GMP_MPFR
default n
depends on GDB_NATIVE
select GMP_MPFR
- select GMP_MPFR_TARGET
+ select COMP_LIBS_TARGET
help
gdb can make use of the GMP and MPFR libraries.
-
+
While the cross-gdb (above) can use the libraries compiled for the
host, the native gdb needs the libraries for the target (where it will
eventually run).
-
+
Setting this option will force building the GMP and MPFR libraries for
the target, and configure the native gdb to use them.
diff --git a/config/debug/ltrace.in b/config/debug/ltrace.in
index 6b7c029..4b141e0 100644
--- a/config/debug/ltrace.in
+++ b/config/debug/ltrace.in
@@ -25,6 +25,10 @@ config LTRACE_V_0_5_1
prompt "0.5.1 (EXPERIMENTAL)"
depends on EXPERIMENTAL
+config LTRACE_V_0_5_2
+ bool
+ prompt "0.5.2"
+
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
endchoice
@@ -34,5 +38,6 @@ config LTRACE_VERSION
default "0.4" if LTRACE_V_0_4
default "0.5" if LTRACE_V_0_5
default "0.5.1" if LTRACE_V_0_5_1
+ default "0.5.2" if LTRACE_V_0_5_2
# CT_INSERT_VERSION_STRING_ABOVE
# # Don't remove above line!
diff --git a/config/global/build-behave.in b/config/global/build-behave.in
index 7f8a854..b0a1040 100644
--- a/config/global/build-behave.in
+++ b/config/global/build-behave.in
@@ -44,16 +44,72 @@ config USE_PIPES
Use gcc's option -pipe to use pipes rather than temp files when building
the toolchain.
+choice
+ bool
+ prompt "Shell to use as CONFIG_SHELL"
+ default CONFIG_SHELL_BASH
+
+config CONFIG_SHELL_SH
+ bool
+ prompt "sh (the system shell)"
+ help
+ Use 'sh' as CONFIG_SHELL.
+
+ ./configure scripts and Makefiles make intensive use of calling
+ sub-shells. This is usually done by calling /bin/sh. /bin/sh ought
+ to be an at-least-POSIX-conformant shell (that is, able to interpret
+ POSIX shell scripts).
+
+ On many (most?) systems, /bin/sh is a symlink to bash. On some other
+ systems (eg. Ubuntu, latest Debian), /bin/sh points to dash (or ash).
+ bash is a full-featured shell, with many extension to POSIX, but is
+ quite slow (see ection BUGS in the bash man page), while dash is
+ faster, with very few extensions to POSIX. On the other hand, some
+ ./configure scripts, although written to use /bin/sh, may really
+ require to be run by bash.
+
+ The default is to use bash, as some components (eg. GMP) will fail
+ to build with anything else than bash.
+
config CONFIG_SHELL_ASH
bool
- prompt "Use 'ash' as CONFIG_SHELL"
- default n
+ prompt "ash (READ HELP!)"
help
- Use /bin/ash as the shell used by ./configure scripts.
+ Use 'ash' as CONFIG_SHELL.
- ./configure scripts make intensive use of calling a sub-shell, and the
- traditional bash is slow, whereas ash is faster.
+ See help for CONFIG_SHELL_SH, above, for more explanations.
- Saying 'y' here should be safe enough, but some components may not
- accept using a shell other than bash (this is most probably true for
- old versions). If you have trouble, say 'n' here and see if it fixes it.
+ NOTE: It is advised that you do NOT use ash as CONFIG_SHELL, as some
+ components are broken. If you decide to use ash, and the build breaks,
+ don't come moaning and set the CONFIG_SHELL to bash, below.
+
+config CONFIG_SHELL_BASH
+ bool
+ prompt "bash"
+ help
+ Use 'bash' as CONFIG_SHELL.
+
+ See help for CONFIG_SHELL_SH, above, for more explanations.
+
+config CONFIG_SHELL_CUSTOM
+ bool
+ prompt "custom shell"
+ help
+ Enter full path to the custom shell below.
+
+ See help for CONFIG_SHELL_SH, above, for more explanations.
+
+config CONFIG_SHELL_CUSTOM_PATH
+ string
+ prompt "Path to custom shell"
+ depends on CONFIG_SHELL_CUSTOM
+ default "/bin/sh"
+
+endchoice
+
+config CONFIG_SHELL
+ string
+ default "sh" if CONFIG_SHELL_SH
+ default "ash" if CONFIG_SHELL_ASH
+ default "bash" if CONFIG_SHELL_BASH
+ default "custom" if CONFIG_SHELL_CUSTOM
diff --git a/config/kernel/linux.in b/config/kernel/linux.in
index f08076d..5f69e3e 100644
--- a/config/kernel/linux.in
+++ b/config/kernel/linux.in
@@ -76,66 +76,61 @@ config KERNEL_V_2_6_26_8
prompt "2.6.26.8 (OBSOLETE)"
depends on OBSOLETE
-config KERNEL_V_2_6_27_22
+config KERNEL_V_2_6_27_29
bool
- prompt "2.6.27.22 (OBSOLETE)"
- depends on OBSOLETE
-
-config KERNEL_V_2_6_28
- bool
- prompt "2.6.28"
+ prompt "2.6.27.29 (long-term stable)"
-config KERNEL_V_2_6_28_1
+config KERNEL_V_2_6_28_10
bool
- prompt "2.6.28.1"
+ prompt "2.6.28.10"
-config KERNEL_V_2_6_28_2
+config KERNEL_V_2_6_29
bool
- prompt "2.6.28.2"
+ prompt "2.6.29"
-config KERNEL_V_2_6_28_3
+config KERNEL_V_2_6_29_1
bool
- prompt "2.6.28.3"
+ prompt "2.6.29.1"
-config KERNEL_V_2_6_28_4
+config KERNEL_V_2_6_29_2
bool
- prompt "2.6.28.4"
+ prompt "2.6.29.2"
-config KERNEL_V_2_6_28_5
+config KERNEL_V_2_6_29_3
bool
- prompt "2.6.28.5"
+ prompt "2.6.29.3"
-config KERNEL_V_2_6_28_6
+config KERNEL_V_2_6_29_4
bool
- prompt "2.6.28.6"
+ prompt "2.6.29.4"
-config KERNEL_V_2_6_28_7
+config KERNEL_V_2_6_29_5
bool
- prompt "2.6.28.7"
+ prompt "2.6.29.5"
-config KERNEL_V_2_6_28_8
+config KERNEL_V_2_6_29_6
bool
- prompt "2.6.28.8"
+ prompt "2.6.29.6"
-config KERNEL_V_2_6_28_9
+config KERNEL_V_2_6_30
bool
- prompt "2.6.28.9"
+ prompt "2.6.30"
-config KERNEL_V_2_6_28_10
+config KERNEL_V_2_6_30_1
bool
- prompt "2.6.28.10"
+ prompt "2.6.30.1"
-config KERNEL_V_2_6_29
+config KERNEL_V_2_6_30_2
bool
- prompt "2.6.29"
+ prompt "2.6.30.2"
-config KERNEL_V_2_6_29_1
+config KERNEL_V_2_6_30_3
bool
- prompt "2.6.29.1"
+ prompt "2.6.30.3"
-config KERNEL_V_2_6_29_2
+config KERNEL_V_2_6_30_4
bool
- prompt "2.6.29.2"
+ prompt "2.6.30.4"
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
@@ -159,21 +154,20 @@ config KERNEL_VERSION
default "2.6.24.7" if KERNEL_V_2_6_24_7
default "2.6.25.20" if KERNEL_V_2_6_25_20
default "2.6.26.8" if KERNEL_V_2_6_26_8
- default "2.6.27.22" if KERNEL_V_2_6_27_22
- default "2.6.28" if KERNEL_V_2_6_28
- default "2.6.28.1" if KERNEL_V_2_6_28_1
- default "2.6.28.2" if KERNEL_V_2_6_28_2
- default "2.6.28.3" if KERNEL_V_2_6_28_3
- default "2.6.28.4" if KERNEL_V_2_6_28_4
- default "2.6.28.5" if KERNEL_V_2_6_28_5
- default "2.6.28.6" if KERNEL_V_2_6_28_6
- default "2.6.28.7" if KERNEL_V_2_6_28_7
- default "2.6.28.8" if KERNEL_V_2_6_28_8
- default "2.6.28.9" if KERNEL_V_2_6_28_9
+ default "2.6.27.29" if KERNEL_V_2_6_27_29
default "2.6.28.10" if KERNEL_V_2_6_28_10
default "2.6.29" if KERNEL_V_2_6_29
default "2.6.29.1" if KERNEL_V_2_6_29_1
default "2.6.29.2" if KERNEL_V_2_6_29_2
+ default "2.6.29.3" if KERNEL_V_2_6_29_3
+ default "2.6.29.4" if KERNEL_V_2_6_29_4
+ default "2.6.29.5" if KERNEL_V_2_6_29_5
+ default "2.6.29.6" if KERNEL_V_2_6_29_6
+ default "2.6.30" if KERNEL_V_2_6_30
+ default "2.6.30.1" if KERNEL_V_2_6_30_1
+ default "2.6.30.2" if KERNEL_V_2_6_30_2
+ default "2.6.30.3" if KERNEL_V_2_6_30_3
+ default "2.6.30.4" if KERNEL_V_2_6_30_4
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!
help
diff --git a/config/libc/eglibc.in b/config/libc/eglibc.in
index 81cdb1d..ced8d95 100644
--- a/config/libc/eglibc.in
+++ b/config/libc/eglibc.in
@@ -36,6 +36,10 @@ config EGLIBC_V_2_9
bool
prompt "2_9"
+config LIBC_V_2_10
+ bool
+ prompt "2_10"
+
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
@@ -55,6 +59,7 @@ config LIBC_VERSION
default "2_7" if EGLIBC_V_2_7
default "2_8" if EGLIBC_V_2_8
default "2_9" if EGLIBC_V_2_9
+ default "2_10" if LIBC_V_2_10
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!
diff --git a/config/toolchain.in b/config/toolchain.in
index 6cec94b..ffa4f3e 100644
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -123,7 +123,7 @@ config CROSS_NATIVE
config CANADIAN
bool
- prompt "Canadian (NO CODE!) (EXPERIMENTAL)"
+ prompt "Canadian (EXPERIMENTAL)"
depends on EXPERIMENTAL
help
Build a canadian-toolchain.
diff --git a/config/tools/libelf.in b/config/tools/libelf.in
index f8df6a7..3002a15 100644
--- a/config/tools/libelf.in
+++ b/config/tools/libelf.in
@@ -13,6 +13,10 @@ config LIBELF_V_0_8_10
bool
prompt "0.8.10"
+config LIBELF_V_0_8_11
+ bool
+ prompt "0.8.11"
+
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
endchoice
@@ -20,5 +24,6 @@ endchoice
config LIBELF_VERSION
string
default "0.8.10" if LIBELF_V_0_8_10
+ default "0.8.11" if LIBELF_V_0_8_11
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!
diff --git a/configure b/configure
index 518a3db..71787a4 100755
--- a/configure
+++ b/configure
@@ -327,16 +327,17 @@ has_or_abort prog=make \
ver='^GNU Make (3.[89][[:digit:]]|[4-9])' \
err="GNU 'make' 3.80 or above was not found"
has_or_abort prog=gcc
-has_or_abort prog=awk
+has_or_abort prog="awk gawk" ver='^GNU Awk' err="GNU 'awk' was not found"
has_or_abort prog=bison
has_or_abort prog=flex
has_or_abort prog=makeinfo
has_or_abort prog=automake \
- ver='\(GNU automake\) (1\.[[:digit:]]{2,}\.|[2-9][[:digit:]]*\.)' \
+ ver='\(GNU automake\) (1\.[[:digit:]]{2,}|[2-9][[:digit:]]*\.)' \
err="'automake' 1.10 or above was not found"
has_or_abort prog=libtool \
ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)' \
err="'libtool' 1.5.26 or above was not found"
+has_or_abort prog=stat ver='GNU coreutils'
has_or_abort prog="curl wget"
has_or_abort prog=cvs
has_or_abort prog=patch
@@ -364,23 +365,15 @@ has_or_abort lib="${ncurses_libs}" \
# If this version is a svn snapshot, try to get the revision number
# If we can't get the revision number, use date
case "${VERSION}" in
- *+svn|svn)
- has_or_abort prog=svnversion
+ *+hg|hg)
+ has_or_abort prog=hg
printf "Computing version string... "
- REVISION="$( LC_ALL=C svnversion )"
+ REVISION="$( hg id -n 2>/dev/null )"
case "${REVISION}" in
- exported)
+ "")
VERSION="${VERSION}_unknown@$( date +%Y%m%d.%H%M%S )";;
*)
- URL="$( LC_ALL=C svn info 2>/dev/null \
- |egrep 'URL: ' \
- |cut -d ' ' -f 2- \
- )"
- ROOT="$( LC_ALL=C svn info 2>/dev/null \
- |"${grep}" '^Repository Root: ' \
- |cut -d ' ' -f 3- \
- )"
- VERSION="${VERSION}${URL#${ROOT}}@${REVISION}"
+ VERSION="${VERSION}_$( hg id -b )@${REVISION%%+}_$( hg id -i )"
;;
esac
# Arrange to have no / in the directory name, no need to create an
diff --git a/docs/overview.txt b/docs/overview.txt
index 3fd7b6f..740ac0a 100644
--- a/docs/overview.txt
+++ b/docs/overview.txt
@@ -412,6 +412,9 @@ eg. /your/root. This directory is the /image/ of what would be in the root file
system of your target, and will contain all that your programs/packages have
installed.
+The 'populate' script |
+----------------------+
+
When your root directory is ready, it is still missing some important bits: the
toolchain's libraries. To populate your root directory with those libs, just
run:
@@ -425,23 +428,59 @@ contains only those things you install in it.
You can then use /your/root-populated to build up your file system image, a
tarball, or to NFS-mount it from your target, or whatever you need.
-populate accepts the following options:
+The populate script accepts the following options:
+
+ -s src_dir
+ Use 'src_dir' as the un-populated root directory.
+
+ -d dst_dir
+ Put the populated root directory in 'dst_dir'.
- -s [src_dir]
- Use 'src_dir' as the 'source', un-populated root directory
+ -l lib1 [...]
+ Always add specified libraries.
- -d [dst_dir]
- Put the 'destination', populated root directory in 'dst_dir'
+ -L file
+ Always add libraries listed in 'file'.
-f
- Remove 'dst_dir' if it previously existed
+ Remove 'dst_dir' if it previously existed; continue even if any library
+ specified with -l or -L is missing.
-v
Be verbose, and tell what's going on (you can see exactly where libs are
coming from).
-h
- Print the help
+ Print the help.
+
+See 'your-target-tuple-populate -h' for more information on the options.
+
+Here is how populate works:
+
+ 1) performs some sanity checks:
+ - src_dir and dst_dir are specified
+ - src_dir exists
+ - unless forced, dst_dir does not exist
+ - src_dir != dst_dir
+
+ 2) copy src_dir to dst_dir
+
+ 3) add forced libraries to dst_dir
+ - build the list from -l and -L options
+ - get forced libraries from the sysroot (see below for heuristics)
+ - abort on the first missing library, unless -f is specified
+
+ 4) add all missing libraries to dst_dir
+ - scan dst_dir for every ELF files that are 'executable' or
+ 'shared object'
+ - list the "NEEDED Shared library" fields
+ - check if the library is already in dst_dir/lib or dst_dir/usr/lib
+ - if not, get the library from the sysroot
+ - if it's in sysroot/lib, copy it to dst_dir/lib
+ - if it's in sysroot/usr/lib, copy it to dst_dir/usr/lib
+ - in both cases, use the SONAME of the library to create the file
+ in dst_dir
+ - if it was not found in the sysroot, this is an error.
___________________
/
diff --git a/patches/duma/2_5_15/100-cross-compile.patch b/patches/duma/2_5_15/100-cross-compile.patch
new file mode 100644
index 0000000..cc95160
--- /dev/null
+++ b/patches/duma/2_5_15/100-cross-compile.patch
@@ -0,0 +1,32 @@
+diff -durN duma_2_5_15.orig/GNUmakefile duma_2_5_15/GNUmakefile
+--- duma_2_5_15.orig/GNUmakefile 2008-08-03 21:22:38.000000000 +0200
++++ duma_2_5_15/GNUmakefile 2009-06-19 15:32:23.000000000 +0200
+@@ -93,10 +93,6 @@
+ # also define 'WIN32'
+
+ # some defaults:
+-CC=gcc
+-CXX=g++
+-AR=ar
+-RANLIB=ranlib
+ INSTALL=install
+ RM=rm
+ RMFORCE=rm -f
+@@ -471,7 +467,7 @@
+
+ createconf$(EXEPOSTFIX): createconf.o
+ - $(RMFORCE) createconf$(EXEPOSTFIX)
+- $(CC) $(CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
++ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
+
+ tstheap$(EXEPOSTFIX): libduma.a tstheap.o
+ - $(RMFORCE) tstheap$(EXEPOSTFIX)
+@@ -532,7 +528,7 @@
+ # define rules how to build objects for createconf
+ #
+ createconf.o:
+- $(CC) $(CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
++ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
+
+
+ #
diff --git a/patches/duma/2_5_15/110-separate_cpp.patch b/patches/duma/2_5_15/110-separate_cpp.patch
new file mode 100644
index 0000000..4bbccc7
--- /dev/null
+++ b/patches/duma/2_5_15/110-separate_cpp.patch
@@ -0,0 +1,19 @@
+diff -durN duma_2_5_15.orig/GNUmakefile duma_2_5_15/GNUmakefile
+--- duma_2_5_15.orig/GNUmakefile 2009-06-19 16:41:53.000000000 +0200
++++ duma_2_5_15/GNUmakefile 2009-06-19 16:43:53.000000000 +0200
+@@ -289,9 +289,13 @@
+ dumatest.c tstheap.c thread-test.c testmt.c dumatestpp.cpp testoperators.cpp \
+ createconf.c
+
+-OBJECTS=dumapp.o duma.o sem_inc.o print.o
++OBJECTS = duma.o sem_inc.o print.o
++SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
+
+-SO_OBJECTS=dumapp_so.o duma_so.o sem_inc_so.o print_so.o
++ifeq ($(DUMA_CPP),1)
++OBJECTS += dumapp.o
++SO_OBJECTS += dumapp_so.o
++endif
+
+ # Make all the top-level targets the makefile knows about.
+ all: libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
diff --git a/patches/eglibc/2_10/100-powerpc-8xx-CPU15-errata.patch b/patches/eglibc/2_10/100-powerpc-8xx-CPU15-errata.patch
new file mode 100644
index 0000000..4fe1bb2
--- /dev/null
+++ b/patches/eglibc/2_10/100-powerpc-8xx-CPU15-errata.patch
@@ -0,0 +1,49 @@
+diff -ru eglibc-2_9_orig/sysdeps/powerpc/powerpc32/memset.S eglibc-2_9/sysdeps/powerpc/powerpc32/memset.S
+--- eglibc-2_9_orig/sysdeps/powerpc/powerpc32/memset.S 2007-04-13 08:35:45.000000000 -0700
++++ eglibc-2_9/sysdeps/powerpc/powerpc32/memset.S 2009-05-06 16:52:04.000000000 -0700
+@@ -112,11 +112,13 @@
+ clrrwi. rALIGN, rLEN, 5
+ mtcrf 0x01, rLEN /* 40th instruction from .align */
+
++#ifndef BROKEN_PPC_8xx_CPU15
+ /* Check if we can use the special case for clearing memory using dcbz.
+ This requires that we know the correct cache line size for this
+ processor. Getting the __cache_line_size may require establishing GOT
+ addressability, so branch out of line to set this up. */
+ beq cr1, L(checklinesize)
++#endif
+
+ /* Store blocks of 32-bytes (256-bits) starting on a 32-byte boundary.
+ Can't assume that rCHR is zero or that the cache line size is either
+@@ -158,6 +160,7 @@
+ add rMEMP, rMEMP, rALIGN
+ b L(medium_tail2) /* 72nd instruction from .align */
+
++#ifndef BROKEN_PPC_8xx_CPU15
+ .align 5
+ nop
+ /* Clear cache lines of memory in 128-byte chunks.
+@@ -191,6 +194,7 @@
+ bdnz L(zloop)
+ beqlr cr5
+ b L(medium_tail2)
++#endif /* ! BROKEN_PPC_8xx_CPU15 */
+
+ .align 5
+ L(small):
+@@ -248,6 +252,7 @@
+ stw rCHR, -8(rMEMP)
+ blr
+
++#ifndef BROKEN_PPC_8xx_CPU15
+ L(checklinesize):
+ #ifdef SHARED
+ mflr rTMP
+@@ -329,6 +334,7 @@
+ L(handletail32):
+ clrrwi. rALIGN, rLEN, 5
+ b L(nondcbz)
++#endif /* ! BROKEN_PPC_8xx_CPU15 */
+
+ END (BP_SYM (memset))
+ libc_hidden_builtin_def (memset)
diff --git a/patches/gcc/4.3.2/380-pr37436.patch b/patches/gcc/4.3.2/380-pr37436.patch
new file mode 100644
index 0000000..99a016f
--- /dev/null
+++ b/patches/gcc/4.3.2/380-pr37436.patch
@@ -0,0 +1,86 @@
+gcc svn 142778:
+
+PR target/37436
+* arm.c (arm_legitimate_index): Only accept addresses that are in
+canonical form.
+* predicates.md (arm_reg_or_extendqisi_mem_op): New predicate.
+* arm.md (extendqihi2): Use arm_reg_or_extendqisi_mem_op predicate
+for operand1.
+(extendqisi2): Likewise.
+(arm_extendqisi, arm_extendqisi_v6): Use arm_extendqisi_mem_op
+predicate for operand1.
+
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.c gcc-4.3.3/gcc/config/arm/arm.c
+--- gcc-4.3.3.orig/gcc/config/arm/arm.c 2008-06-11 07:52:55.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/arm.c 2009-05-21 16:06:45.000000000 -0300
+@@ -3769,6 +3769,7 @@
+ rtx xop1 = XEXP (x, 1);
+
+ return ((arm_address_register_rtx_p (xop0, strict_p)
++ && GET_CODE(xop1) == CONST_INT
+ && arm_legitimate_index_p (mode, xop1, outer, strict_p))
+ || (arm_address_register_rtx_p (xop1, strict_p)
+ && arm_legitimate_index_p (mode, xop0, outer, strict_p)));
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.md gcc-4.3.3/gcc/config/arm/arm.md
+--- gcc-4.3.3.orig/gcc/config/arm/arm.md 2007-09-04 01:44:47.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/arm.md 2009-05-21 16:06:45.000000000 -0300
+@@ -4199,7 +4199,7 @@
+
+ (define_expand "extendqihi2"
+ [(set (match_dup 2)
+- (ashift:SI (match_operand:QI 1 "general_operand" "")
++ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
+ (const_int 24)))
+ (set (match_operand:HI 0 "s_register_operand" "")
+ (ashiftrt:SI (match_dup 2)
+@@ -4224,7 +4224,7 @@
+
+ (define_insn "*arm_extendqihi_insn"
+ [(set (match_operand:HI 0 "s_register_operand" "=r")
+- (sign_extend:HI (match_operand:QI 1 "memory_operand" "Uq")))]
++ (sign_extend:HI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
+ "TARGET_ARM && arm_arch4"
+ "ldr%(sb%)\\t%0, %1"
+ [(set_attr "type" "load_byte")
+@@ -4235,7 +4235,7 @@
+
+ (define_expand "extendqisi2"
+ [(set (match_dup 2)
+- (ashift:SI (match_operand:QI 1 "general_operand" "")
++ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
+ (const_int 24)))
+ (set (match_operand:SI 0 "s_register_operand" "")
+ (ashiftrt:SI (match_dup 2)
+@@ -4267,7 +4267,7 @@
+
+ (define_insn "*arm_extendqisi"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+- (sign_extend:SI (match_operand:QI 1 "memory_operand" "Uq")))]
++ (sign_extend:SI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
+ "TARGET_ARM && arm_arch4 && !arm_arch6"
+ "ldr%(sb%)\\t%0, %1"
+ [(set_attr "type" "load_byte")
+@@ -4278,7 +4278,8 @@
+
+ (define_insn "*arm_extendqisi_v6"
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+- (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uq")))]
++ (sign_extend:SI
++ (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "r,Uq")))]
+ "TARGET_ARM && arm_arch6"
+ "@
+ sxtb%?\\t%0, %1
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/predicates.md gcc-4.3.3/gcc/config/arm/predicates.md
+--- gcc-4.3.3.orig/gcc/config/arm/predicates.md 2007-08-02 07:49:31.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/predicates.md 2009-05-21 16:06:45.000000000 -0300
+@@ -234,6 +234,10 @@
+ (match_test "arm_legitimate_address_p (mode, XEXP (op, 0), SIGN_EXTEND,
+ 0)")))
+
++(define_special_predicate "arm_reg_or_extendqisi_mem_op"
++ (ior (match_operand 0 "arm_extendqisi_mem_op")
++ (match_operand 0 "s_register_operand")))
++
+ (define_predicate "power_of_two_operand"
+ (match_code "const_int")
+ {
diff --git a/patches/gcc/4.3.3/380-pr37436.patch b/patches/gcc/4.3.3/380-pr37436.patch
new file mode 100644
index 0000000..99a016f
--- /dev/null
+++ b/patches/gcc/4.3.3/380-pr37436.patch
@@ -0,0 +1,86 @@
+gcc svn 142778:
+
+PR target/37436
+* arm.c (arm_legitimate_index): Only accept addresses that are in
+canonical form.
+* predicates.md (arm_reg_or_extendqisi_mem_op): New predicate.
+* arm.md (extendqihi2): Use arm_reg_or_extendqisi_mem_op predicate
+for operand1.
+(extendqisi2): Likewise.
+(arm_extendqisi, arm_extendqisi_v6): Use arm_extendqisi_mem_op
+predicate for operand1.
+
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.c gcc-4.3.3/gcc/config/arm/arm.c
+--- gcc-4.3.3.orig/gcc/config/arm/arm.c 2008-06-11 07:52:55.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/arm.c 2009-05-21 16:06:45.000000000 -0300
+@@ -3769,6 +3769,7 @@
+ rtx xop1 = XEXP (x, 1);
+
+ return ((arm_address_register_rtx_p (xop0, strict_p)
++ && GET_CODE(xop1) == CONST_INT
+ && arm_legitimate_index_p (mode, xop1, outer, strict_p))
+ || (arm_address_register_rtx_p (xop1, strict_p)
+ && arm_legitimate_index_p (mode, xop0, outer, strict_p)));
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.md gcc-4.3.3/gcc/config/arm/arm.md
+--- gcc-4.3.3.orig/gcc/config/arm/arm.md 2007-09-04 01:44:47.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/arm.md 2009-05-21 16:06:45.000000000 -0300
+@@ -4199,7 +4199,7 @@
+
+ (define_expand "extendqihi2"
+ [(set (match_dup 2)
+- (ashift:SI (match_operand:QI 1 "general_operand" "")
++ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
+ (const_int 24)))
+ (set (match_operand:HI 0 "s_register_operand" "")
+ (ashiftrt:SI (match_dup 2)
+@@ -4224,7 +4224,7 @@
+
+ (define_insn "*arm_extendqihi_insn"
+ [(set (match_operand:HI 0 "s_register_operand" "=r")
+- (sign_extend:HI (match_operand:QI 1 "memory_operand" "Uq")))]
++ (sign_extend:HI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
+ "TARGET_ARM && arm_arch4"
+ "ldr%(sb%)\\t%0, %1"
+ [(set_attr "type" "load_byte")
+@@ -4235,7 +4235,7 @@
+
+ (define_expand "extendqisi2"
+ [(set (match_dup 2)
+- (ashift:SI (match_operand:QI 1 "general_operand" "")
++ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
+ (const_int 24)))
+ (set (match_operand:SI 0 "s_register_operand" "")
+ (ashiftrt:SI (match_dup 2)
+@@ -4267,7 +4267,7 @@
+
+ (define_insn "*arm_extendqisi"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+- (sign_extend:SI (match_operand:QI 1 "memory_operand" "Uq")))]
++ (sign_extend:SI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
+ "TARGET_ARM && arm_arch4 && !arm_arch6"
+ "ldr%(sb%)\\t%0, %1"
+ [(set_attr "type" "load_byte")
+@@ -4278,7 +4278,8 @@
+
+ (define_insn "*arm_extendqisi_v6"
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+- (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uq")))]
++ (sign_extend:SI
++ (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "r,Uq")))]
+ "TARGET_ARM && arm_arch6"
+ "@
+ sxtb%?\\t%0, %1
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/predicates.md gcc-4.3.3/gcc/config/arm/predicates.md
+--- gcc-4.3.3.orig/gcc/config/arm/predicates.md 2007-08-02 07:49:31.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/predicates.md 2009-05-21 16:06:45.000000000 -0300
+@@ -234,6 +234,10 @@
+ (match_test "arm_legitimate_address_p (mode, XEXP (op, 0), SIGN_EXTEND,
+ 0)")))
+
++(define_special_predicate "arm_reg_or_extendqisi_mem_op"
++ (ior (match_operand 0 "arm_extendqisi_mem_op")
++ (match_operand 0 "s_register_operand")))
++
+ (define_predicate "power_of_two_operand"
+ (match_code "const_int")
+ {
diff --git a/patches/gcc/4.3.4/100-alpha-mieee-default.patch b/patches/gcc/4.3.4/100-alpha-mieee-default.patch
new file mode 100644
index 0000000..945019d
--- /dev/null
+++ b/patches/gcc/4.3.4/100-alpha-mieee-default.patch
@@ -0,0 +1,39 @@
+Original patch from: ../4.3.2/100-alpha-mieee-default.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
+Set the default behavior on alpha to use -mieee since the large majority of
+time we want this (bad/weird things can happen with packages built without
+-mieee).
+
+To satisfy those people who may not want -mieee forced on them all the time,
+we also provide -mno-ieee.
+
+Patch by Mike Frysinger <vapier@gentoo.org>
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/alpha/alpha.h gcc-4.3.3/gcc/config/alpha/alpha.h
+--- gcc-4.3.3.orig/gcc/config/alpha/alpha.h 2007-12-06 14:25:37.000000000 +0100
++++ gcc-4.3.3/gcc/config/alpha/alpha.h 2009-01-27 22:19:02.000000000 +0100
+@@ -95,6 +95,8 @@
+ while (0)
+ #endif
+
++#define CPP_SPEC "%{!no-ieee:-mieee}"
++
+ #define WORD_SWITCH_TAKES_ARG(STR) \
+ (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
+
+diff -durN gcc-4.3.3.orig/gcc/config/alpha/alpha.opt gcc-4.3.3/gcc/config/alpha/alpha.opt
+--- gcc-4.3.3.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200
++++ gcc-4.3.3/gcc/config/alpha/alpha.opt 2009-01-27 22:19:02.000000000 +0100
+@@ -39,7 +39,7 @@
+ Request IEEE-conformant math library routines (OSF/1)
+
+ mieee
+-Target Report RejectNegative Mask(IEEE)
++Target Report Mask(IEEE)
+ Emit IEEE-conformant code, without inexact exceptions
+
+ mieee-with-inexact
diff --git a/patches/gcc/4.3.4/110-trampolinewarn.patch b/patches/gcc/4.3.4/110-trampolinewarn.patch
new file mode 100644
index 0000000..43ab217
--- /dev/null
+++ b/patches/gcc/4.3.4/110-trampolinewarn.patch
@@ -0,0 +1,40 @@
+Original patch from: ../4.3.2/110-trampolinewarn.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch
+ This trivial patch causes gcc to emit a warning whenever
+ it generates a trampoline. These are otherwise hard to
+ locate. It is rigged to default ON - to have it default
+ to OFF remove the text 'Init(1)' from the common.opt
+ patch, leaving just 'Common Var(warn_trampolines)'.
+ Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/builtins.c gcc-4.3.3/gcc/builtins.c
+--- gcc-4.3.3.orig/gcc/builtins.c 2008-08-19 18:37:13.000000000 +0200
++++ gcc-4.3.3/gcc/builtins.c 2009-01-27 22:19:12.000000000 +0100
+@@ -5662,6 +5662,9 @@
+ trampolines_created = 1;
+ INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
+
++ if (warn_trampolines)
++ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
++
+ return const0_rtx;
+ }
+
+diff -durN gcc-4.3.3.orig/gcc/common.opt gcc-4.3.3/gcc/common.opt
+--- gcc-4.3.3.orig/gcc/common.opt 2008-01-22 15:11:44.000000000 +0100
++++ gcc-4.3.3/gcc/common.opt 2009-01-27 22:19:12.000000000 +0100
+@@ -182,6 +182,10 @@
+ Common Var(warn_system_headers) Warning
+ Do not suppress warnings from system headers
+
++Wtrampolines
++Common Var(warn_trampolines) Init(1)
++Warn whenever a trampoline is generated
++
+ Wuninitialized
+ Common Var(warn_uninitialized) Warning
+ Warn about uninitialized automatic variables
diff --git a/patches/gcc/4.3.4/120-java-nomulti.patch b/patches/gcc/4.3.4/120-java-nomulti.patch
new file mode 100644
index 0000000..47b813e
--- /dev/null
+++ b/patches/gcc/4.3.4/120-java-nomulti.patch
@@ -0,0 +1,52 @@
+Original patch from: ../4.3.2/120-java-nomulti.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/03_all_gcc43-java-nomulti.patch
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/libjava/configure gcc-4.3.3/libjava/configure
+--- gcc-4.3.3.orig/libjava/configure 2009-01-24 11:32:29.000000000 +0100
++++ gcc-4.3.3/libjava/configure 2009-01-27 22:19:14.000000000 +0100
+@@ -1018,6 +1018,8 @@
+ --enable-gconf-peer compile GConf native peers for util.preferences
+ --enable-java-maintainer-mode
+ allow rebuilding of .class and .h files
++ --enable-libjava-multilib
++ build libjava as multilib
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-maintainer-mode enable make rules and dependencies not useful
+@@ -1850,6 +1852,16 @@
+ fi
+
+
++# Check whether --enable-libjava-multilib was given.
++if test "${enable_libjava_multilib+set}" = set; then
++ enableval=$enable_libjava_multilib;
++fi
++
++if test "$enable_libjava_multilib" = no; then
++ multilib=no
++ ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+
+
+diff -durN gcc-4.3.3.orig/libjava/configure.ac gcc-4.3.3/libjava/configure.ac
+--- gcc-4.3.3.orig/libjava/configure.ac 2008-07-02 23:23:43.000000000 +0200
++++ gcc-4.3.3/libjava/configure.ac 2009-01-27 22:19:14.000000000 +0100
+@@ -82,6 +82,13 @@
+ [allow rebuilding of .class and .h files]))
+ AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
+
++AC_ARG_ENABLE(libjava-multilib,
++ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
++if test "$enable_libjava_multilib" = no; then
++ multilib=no
++ ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+ GCC_NO_EXECUTABLES
+
diff --git a/patches/gcc/4.3.4/130-cross-compile.patch b/patches/gcc/4.3.4/130-cross-compile.patch
new file mode 100644
index 0000000..e265998
--- /dev/null
+++ b/patches/gcc/4.3.4/130-cross-compile.patch
@@ -0,0 +1,49 @@
+Original patch from: ../4.3.2/130-cross-compile.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch
+Some notes on the 'bootstrap with or without libc headers' debate:
+http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
+http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/configure gcc-4.3.3/gcc/configure
+--- gcc-4.3.3.orig/gcc/configure 2008-08-01 11:51:03.000000000 +0200
++++ gcc-4.3.3/gcc/configure 2009-01-27 22:19:16.000000000 +0100
+@@ -13442,7 +13442,7 @@
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
+diff -durN gcc-4.3.3.orig/gcc/configure.ac gcc-4.3.3/gcc/configure.ac
+--- gcc-4.3.3.orig/gcc/configure.ac 2008-08-01 11:51:03.000000000 +0200
++++ gcc-4.3.3/gcc/configure.ac 2009-01-27 22:19:16.000000000 +0100
+@@ -1749,7 +1749,7 @@
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
+diff -durN gcc-4.3.3.orig/gcc/unwind-dw2.c gcc-4.3.3/gcc/unwind-dw2.c
+--- gcc-4.3.3.orig/gcc/unwind-dw2.c 2008-09-25 00:44:28.000000000 +0200
++++ gcc-4.3.3/gcc/unwind-dw2.c 2009-01-27 22:19:16.000000000 +0100
+@@ -334,9 +334,11 @@
+ }
+ #endif
+
++#ifndef inhibit_libc
+ #ifdef MD_UNWIND_SUPPORT
+ #include MD_UNWIND_SUPPORT
+ #endif
++#endif
+
+ /* Extract any interesting information from the CIE for the translation
+ unit F belongs to. Return a pointer to the byte after the augmentation,
diff --git a/patches/gcc/4.3.4/140-netbsd-symbolic.patch b/patches/gcc/4.3.4/140-netbsd-symbolic.patch
new file mode 100644
index 0000000..a899dd6
--- /dev/null
+++ b/patches/gcc/4.3.4/140-netbsd-symbolic.patch
@@ -0,0 +1,19 @@
+Original patch from: ../4.3.2/140-netbsd-symbolic.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/11_all_gcc-netbsd-symbolic.patch
+http://bugs.gentoo.org/122698
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/netbsd-elf.h gcc-4.3.3/gcc/config/netbsd-elf.h
+--- gcc-4.3.3.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200
++++ gcc-4.3.3/gcc/config/netbsd-elf.h 2009-01-27 22:19:18.000000000 +0100
+@@ -82,6 +82,7 @@
+ #define NETBSD_LINK_SPEC_ELF \
+ "%{assert*} %{R*} %{rpath*} \
+ %{shared:-shared} \
++ %{symbolic:-Bsymbolic} \
+ %{!shared: \
+ -dc -dp \
+ %{!nostdlib: \
diff --git a/patches/gcc/4.3.4/150-sparc64-bsd.patch b/patches/gcc/4.3.4/150-sparc64-bsd.patch
new file mode 100644
index 0000000..233a763
--- /dev/null
+++ b/patches/gcc/4.3.4/150-sparc64-bsd.patch
@@ -0,0 +1,35 @@
+Original patch from: ../4.3.2/150-sparc64-bsd.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/14_all_gcc-sparc64-bsd.patch
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/sparc/freebsd.h gcc-4.3.3/gcc/config/sparc/freebsd.h
+--- gcc-4.3.3.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200
++++ gcc-4.3.3/gcc/config/sparc/freebsd.h 2009-01-27 22:19:20.000000000 +0100
+@@ -25,9 +25,22 @@
+ /* FreeBSD needs the platform name (sparc64) defined.
+ Emacs needs to know if the arch is 64 or 32-bits. */
+
+-#undef CPP_CPU64_DEFAULT_SPEC
+-#define CPP_CPU64_DEFAULT_SPEC \
+- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
++#undef FBSD_TARGET_CPU_CPP_BUILTINS
++#define FBSD_TARGET_CPU_CPP_BUILTINS() \
++ do \
++ { \
++ if (TARGET_ARCH64) \
++ { \
++ builtin_define ("__sparc64__"); \
++ builtin_define ("__sparc_v9__"); \
++ builtin_define ("__sparcv9"); \
++ } \
++ else \
++ builtin_define ("__sparc"); \
++ builtin_define ("__sparc__"); \
++ } \
++ while (0)
++
+
+ #define LINK_SPEC "%(link_arch) \
+ %{!mno-relax:%{!r:-relax}} \
diff --git a/patches/gcc/4.3.4/160-flatten-switch-stmt-00.patch b/patches/gcc/4.3.4/160-flatten-switch-stmt-00.patch
new file mode 100644
index 0000000..82acfbc
--- /dev/null
+++ b/patches/gcc/4.3.4/160-flatten-switch-stmt-00.patch
@@ -0,0 +1,81 @@
+Original patch from: ../4.3.2/160-flatten-switch-stmt-00.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/18_all_904-flatten-switch-stmt-00.patch
+http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
+
+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"
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/stmt.c gcc-4.3.3/gcc/stmt.c
+--- gcc-4.3.3.orig/gcc/stmt.c 2008-05-09 20:12:13.000000000 +0200
++++ gcc-4.3.3/gcc/stmt.c 2009-01-27 22:19:28.000000000 +0100
+@@ -2509,7 +2509,11 @@
+ 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);
+ }
+@@ -3067,6 +3071,7 @@
+ {
+ 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,
diff --git a/patches/gcc/4.3.4/170-libiberty-pic.patch b/patches/gcc/4.3.4/170-libiberty-pic.patch
new file mode 100644
index 0000000..00789d0
--- /dev/null
+++ b/patches/gcc/4.3.4/170-libiberty-pic.patch
@@ -0,0 +1,17 @@
+Original patch from: ../4.3.2/170-libiberty-pic.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/51_all_gcc-3.4-libiberty-pic.patch
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/libiberty/Makefile.in gcc-4.3.3/libiberty/Makefile.in
+--- gcc-4.3.3.orig/libiberty/Makefile.in 2007-07-25 08:26:45.000000000 +0200
++++ gcc-4.3.3/libiberty/Makefile.in 2009-01-27 22:19:30.000000000 +0100
+@@ -225,6 +225,7 @@
+ $(AR) $(AR_FLAGS) $(TARGETLIB) \
+ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
+ $(RANLIB) $(TARGETLIB); \
++ cp $(TARGETLIB) ../ ; \
+ cd ..; \
+ else true; fi
+
diff --git a/patches/gcc/4.3.4/180-superh-default-multilib.patch b/patches/gcc/4.3.4/180-superh-default-multilib.patch
new file mode 100644
index 0000000..a419377
--- /dev/null
+++ b/patches/gcc/4.3.4/180-superh-default-multilib.patch
@@ -0,0 +1,30 @@
+Original patch from: ../4.3.2/180-superh-default-multilib.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/53_all_gcc4-superh-default-multilib.patch
+The gcc-3.x toolchains would contain all the targets by default. With gcc-4,
+you have to actually list out the multilibs you want or you will end up with
+just one when using targets like 'sh4-linux-gnu'.
+
+The resulting toolchain can't even build a kernel as the kernel needs to build
+with the nofpu flag to be sure that no fpu ops are generated.
+
+Here we restore the gcc-3.x behavior; the additional overhead of building all
+of these multilibs by default is negligible.
+
+http://bugs.gentoo.org/140205
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config.gcc gcc-4.3.3/gcc/config.gcc
+--- gcc-4.3.3.orig/gcc/config.gcc 2008-11-20 18:09:53.000000000 +0100
++++ gcc-4.3.3/gcc/config.gcc 2009-01-27 22:19:32.000000000 +0100
+@@ -2275,7 +2275,7 @@
+ if test x${sh_multilibs} = x ; then
+ case ${target} in
+ sh64-superh-linux* | \
+- sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
++ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
+ sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
+ sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
+ sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;;
diff --git a/patches/gcc/4.3.4/190-libstdc++-pic.patch b/patches/gcc/4.3.4/190-libstdc++-pic.patch
new file mode 100644
index 0000000..d62847c
--- /dev/null
+++ b/patches/gcc/4.3.4/190-libstdc++-pic.patch
@@ -0,0 +1,61 @@
+Original patch from: ../4.3.2/190-libstdc++-pic.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch
+install libstdc++_pic.a if we have pic objs
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/libstdc++-v3/src/Makefile.am gcc-4.3.3/libstdc++-v3/src/Makefile.am
+--- gcc-4.3.3.orig/libstdc++-v3/src/Makefile.am 2008-02-29 19:26:50.000000000 +0100
++++ gcc-4.3.3/libstdc++-v3/src/Makefile.am 2009-01-27 22:19:34.000000000 +0100
+@@ -289,6 +289,13 @@
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
+
+
++install-exec-local:
++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
++ if [ x"$$pic_objs" != x ]; then \
++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
++ fi
++
+ # Added bits to build debug library.
+ if GLIBCXX_BUILD_DEBUG
+ all-local: build_debug
+diff -durN gcc-4.3.3.orig/libstdc++-v3/src/Makefile.in gcc-4.3.3/libstdc++-v3/src/Makefile.in
+--- gcc-4.3.3.orig/libstdc++-v3/src/Makefile.in 2008-02-29 19:26:50.000000000 +0100
++++ gcc-4.3.3/libstdc++-v3/src/Makefile.in 2009-01-27 22:19:34.000000000 +0100
+@@ -693,7 +693,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
+
+@@ -732,7 +732,7 @@
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am \
+- uninstall-toolexeclibLTLIBRARIES
++ uninstall-toolexeclibLTLIBRARIES install-exec-local
+
+
+ # Symbol versioning for shared libraries.
+@@ -858,6 +858,14 @@
+ install_debug:
+ (cd ${debugdir} && $(MAKE) \
+ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
++
++install-exec-local:
++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
++ if [ x"$$pic_objs" != x ]; then \
++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
++ fi
++
+ # 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:
diff --git a/patches/gcc/4.3.4/200-pr24170.patch b/patches/gcc/4.3.4/200-pr24170.patch
new file mode 100644
index 0000000..e2bbc9e
--- /dev/null
+++ b/patches/gcc/4.3.4/200-pr24170.patch
@@ -0,0 +1,66 @@
+Original patch from: ../4.3.2/200-pr24170.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc43-pr24170.patch
+http://gcc.gnu.org/PR24170
+
+2008-02-20 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/24170:
+ * java/io/natFilePosix.cc (File::performList): Don't use
+ readdir_r.
+ * configure, include/config.h.in: Rebuilt.
+ * configure.ac: Don't check for readdir_r.
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/libjava/configure.ac gcc-4.3.3/libjava/configure.ac
+--- gcc-4.3.3.orig/libjava/configure.ac 2009-01-27 22:19:16.000000000 +0100
++++ gcc-4.3.3/libjava/configure.ac 2009-01-27 22:19:36.000000000 +0100
+@@ -1030,7 +1030,7 @@
+ PLATFORMNET=NoNet
+ else
+ AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
+- localtime_r readdir_r getpwuid_r getcwd \
++ localtime_r getpwuid_r getcwd \
+ access stat lstat mkdir rename rmdir unlink utime chmod readlink \
+ nl_langinfo setlocale \
+ inet_pton uname inet_ntoa \
+diff -durN gcc-4.3.3.orig/libjava/include/config.h.in gcc-4.3.3/libjava/include/config.h.in
+--- gcc-4.3.3.orig/libjava/include/config.h.in 2007-07-31 18:17:21.000000000 +0200
++++ gcc-4.3.3/libjava/include/config.h.in 2009-01-27 22:19:36.000000000 +0100
+@@ -214,9 +214,6 @@
+ /* Define to 1 if you have the <pwd.h> header file. */
+ #undef HAVE_PWD_H
+
+-/* Define to 1 if you have the `readdir_r' function. */
+-#undef HAVE_READDIR_R
+-
+ /* Define to 1 if you have the `readlink' function. */
+ #undef HAVE_READLINK
+
+diff -durN gcc-4.3.3.orig/libjava/java/io/natFilePosix.cc gcc-4.3.3/libjava/java/io/natFilePosix.cc
+--- gcc-4.3.3.orig/libjava/java/io/natFilePosix.cc 2007-08-04 23:50:01.000000000 +0200
++++ gcc-4.3.3/libjava/java/io/natFilePosix.cc 2009-01-27 22:19:36.000000000 +0100
+@@ -1,6 +1,6 @@
+ // natFile.cc - Native part of File class for POSIX.
+
+-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
+ Free Software Foundation
+
+ This file is part of libgcj.
+@@ -292,13 +292,7 @@
+
+ java::util::ArrayList *list = new java::util::ArrayList ();
+ struct dirent *d;
+-#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
+- int name_max = pathconf (buf, _PC_NAME_MAX);
+- char dbuf[sizeof (struct dirent) + name_max + 1];
+- while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
+-#else /* HAVE_READDIR_R */
+ while ((d = readdir (dir)) != NULL)
+-#endif /* HAVE_READDIR_R */
+ {
+ // Omit "." and "..".
+ if (d->d_name[0] == '.'
diff --git a/patches/gcc/4.3.4/210-noteGNUstack-00.patch b/patches/gcc/4.3.4/210-noteGNUstack-00.patch
new file mode 100644
index 0000000..84c6424
--- /dev/null
+++ b/patches/gcc/4.3.4/210-noteGNUstack-00.patch
@@ -0,0 +1,101 @@
+Original patch from: ../4.3.2/210-noteGNUstack-00.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
+2004-09-20 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
+ on ppc64-linux.
+
+ * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
+ ia64-linux.
+ * config/ia64/crtbegin.asm: Likewise.
+ * config/ia64/crtend.asm: Likewise.
+ * config/ia64/crti.asm: Likewise.
+ * config/ia64/crtn.asm: Likewise.
+
+2004-05-14 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.3/gcc/config/ia64/crtbegin.asm
+--- gcc-4.3.3.orig/gcc/config/ia64/crtbegin.asm 2005-09-27 02:52:24.000000000 +0200
++++ gcc-4.3.3/gcc/config/ia64/crtbegin.asm 2009-01-27 22:19:39.000000000 +0100
+@@ -255,3 +255,7 @@
+ .weak __cxa_finalize
+ #endif
+ .weak _Jv_RegisterClasses
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.3.3.orig/gcc/config/ia64/crtend.asm gcc-4.3.3/gcc/config/ia64/crtend.asm
+--- gcc-4.3.3.orig/gcc/config/ia64/crtend.asm 2005-09-27 02:52:24.000000000 +0200
++++ gcc-4.3.3/gcc/config/ia64/crtend.asm 2009-01-27 22:19:39.000000000 +0100
+@@ -122,3 +122,7 @@
+
+ br.ret.sptk.many rp
+ .endp __do_global_ctors_aux
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.3.3.orig/gcc/config/ia64/crti.asm gcc-4.3.3/gcc/config/ia64/crti.asm
+--- gcc-4.3.3.orig/gcc/config/ia64/crti.asm 2005-06-25 03:22:41.000000000 +0200
++++ gcc-4.3.3/gcc/config/ia64/crti.asm 2009-01-27 22:19:39.000000000 +0100
+@@ -64,3 +64,7 @@
+ .body
+
+ # end of crti.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.3.3.orig/gcc/config/ia64/crtn.asm gcc-4.3.3/gcc/config/ia64/crtn.asm
+--- gcc-4.3.3.orig/gcc/config/ia64/crtn.asm 2005-06-25 03:22:41.000000000 +0200
++++ gcc-4.3.3/gcc/config/ia64/crtn.asm 2009-01-27 22:19:39.000000000 +0100
+@@ -54,3 +54,7 @@
+ br.ret.sptk.many b0
+
+ # end of crtn.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.3.3.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.3/gcc/config/ia64/lib1funcs.asm
+--- gcc-4.3.3.orig/gcc/config/ia64/lib1funcs.asm 2005-09-27 02:52:24.000000000 +0200
++++ gcc-4.3.3/gcc/config/ia64/lib1funcs.asm 2009-01-27 22:19:39.000000000 +0100
+@@ -792,3 +792,7 @@
+ }
+ .endp __floattitf
+ #endif
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.3.3.orig/gcc/config/ia64/linux.h gcc-4.3.3/gcc/config/ia64/linux.h
+--- gcc-4.3.3.orig/gcc/config/ia64/linux.h 2006-12-12 16:15:19.000000000 +0100
++++ gcc-4.3.3/gcc/config/ia64/linux.h 2009-01-27 22:19:39.000000000 +0100
+@@ -5,6 +5,8 @@
+
+ #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
+
++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
++
+ /* This is for -profile to use -lc_p instead of -lc. */
+ #undef CC1_SPEC
+ #define CC1_SPEC "%{profile:-p} %{G*}"
+diff -durN gcc-4.3.3.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.3/gcc/config/rs6000/ppc-asm.h
+--- gcc-4.3.3.orig/gcc/config/rs6000/ppc-asm.h 2003-06-04 18:44:51.000000000 +0200
++++ gcc-4.3.3/gcc/config/rs6000/ppc-asm.h 2009-01-27 22:19:39.000000000 +0100
+@@ -158,7 +158,7 @@
+ .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
+ #endif
+
+-#if defined __linux__ && !defined __powerpc64__
++#if defined __linux__
+ .section .note.GNU-stack
+ .previous
+ #endif
diff --git a/patches/gcc/4.3.4/220-noteGNUstack-01.patch b/patches/gcc/4.3.4/220-noteGNUstack-01.patch
new file mode 100644
index 0000000..cb6e999
--- /dev/null
+++ b/patches/gcc/4.3.4/220-noteGNUstack-01.patch
@@ -0,0 +1,203 @@
+Original patch from: ../4.3.2/220-noteGNUstack-01.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/62_all_gcc4-noteGNUstack.patch
+2005-02-08 Jakub Jelinek <jakub@redhat.com>
+
+ * src/alpha/osf.S: Add .note.GNU-stack on Linux.
+ * src/s390/sysv.S: Likewise.
+ * src/powerpc/linux64.S: Likewise.
+ * src/powerpc/linux64_closure.S: Likewise.
+ * src/powerpc/ppc_closure.S: Likewise.
+ * src/powerpc/sysv.S: Likewise.
+ * src/x86/unix64.S: Likewise.
+ * src/x86/sysv.S: Likewise.
+ * src/sparc/v8.S: Likewise.
+ * src/sparc/v9.S: Likewise.
+ * src/m68k/sysv.S: Likewise.
+ * src/ia64/unix.S: Likewise.
+ * src/arm/sysv.S: Likewise.
+
+ * ia64_save_regs_in_stack.s: Moved to...
+ * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack
+ on Linux.
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.3/boehm-gc/ia64_save_regs_in_stack.S
+--- gcc-4.3.3.orig/boehm-gc/ia64_save_regs_in_stack.S 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.3.3/boehm-gc/ia64_save_regs_in_stack.S 2009-01-27 22:25:27.000000000 +0100
+@@ -0,0 +1,15 @@
++ .text
++ .align 16
++ .global GC_save_regs_in_stack
++ .proc GC_save_regs_in_stack
++GC_save_regs_in_stack:
++ .bodyfoo.mpg
++ flushrs
++ ;;
++ mov r8=ar.bsp
++ br.ret.sptk.few rp
++ .endp GC_save_regs_in_stack
++
++#ifdef __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.3/boehm-gc/ia64_save_regs_in_stack.s
+--- gcc-4.3.3.orig/boehm-gc/ia64_save_regs_in_stack.s 2001-10-15 06:57:59.000000000 +0200
++++ gcc-4.3.3/boehm-gc/ia64_save_regs_in_stack.s 1970-01-01 01:00:00.000000000 +0100
+@@ -1,12 +0,0 @@
+- .text
+- .align 16
+- .global GC_save_regs_in_stack
+- .proc GC_save_regs_in_stack
+-GC_save_regs_in_stack:
+- .body
+- flushrs
+- ;;
+- mov r8=ar.bsp
+- br.ret.sptk.few rp
+- .endp GC_save_regs_in_stack
+-
+diff -durN gcc-4.3.3.orig/libffi/src/alpha/osf.S gcc-4.3.3/libffi/src/alpha/osf.S
+--- gcc-4.3.3.orig/libffi/src/alpha/osf.S 2007-04-06 18:24:16.000000000 +0200
++++ gcc-4.3.3/libffi/src/alpha/osf.S 2009-01-27 22:25:27.000000000 +0100
+@@ -358,4 +358,8 @@
+ .byte 16 # uleb128 offset 16*-8
+ .align 3
+ $LEFDE3:
++
++#ifdef __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+ #endif
+diff -durN gcc-4.3.3.orig/libffi/src/arm/sysv.S gcc-4.3.3/libffi/src/arm/sysv.S
+--- gcc-4.3.3.orig/libffi/src/arm/sysv.S 2007-09-04 19:52:45.000000000 +0200
++++ gcc-4.3.3/libffi/src/arm/sysv.S 2009-01-27 22:25:27.000000000 +0100
+@@ -293,3 +293,6 @@
+ UNWIND .fnend
+ .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
+
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/ia64/unix.S gcc-4.3.3/libffi/src/ia64/unix.S
+--- gcc-4.3.3.orig/libffi/src/ia64/unix.S 2005-03-30 23:49:19.000000000 +0200
++++ gcc-4.3.3/libffi/src/ia64/unix.S 2009-01-27 22:25:27.000000000 +0100
+@@ -553,3 +553,7 @@
+ data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
+ data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
+ data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/m68k/sysv.S gcc-4.3.3/libffi/src/m68k/sysv.S
+--- gcc-4.3.3.orig/libffi/src/m68k/sysv.S 2007-05-10 23:29:04.000000000 +0200
++++ gcc-4.3.3/libffi/src/m68k/sysv.S 2009-01-27 22:25:27.000000000 +0100
+@@ -207,3 +207,7 @@
+ rts
+ CFI_ENDPROC()
+ .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/powerpc/linux64.S gcc-4.3.3/libffi/src/powerpc/linux64.S
+--- gcc-4.3.3.orig/libffi/src/powerpc/linux64.S 2007-11-17 00:24:53.000000000 +0100
++++ gcc-4.3.3/libffi/src/powerpc/linux64.S 2009-01-27 22:25:27.000000000 +0100
+@@ -179,3 +179,7 @@
+ .align 3
+ .LEFDE1:
+ #endif
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.3/libffi/src/powerpc/linux64_closure.S
+--- gcc-4.3.3.orig/libffi/src/powerpc/linux64_closure.S 2005-08-11 23:18:24.000000000 +0200
++++ gcc-4.3.3/libffi/src/powerpc/linux64_closure.S 2009-01-27 22:25:27.000000000 +0100
+@@ -204,3 +204,7 @@
+ .align 3
+ .LEFDE1:
+ #endif
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.3/libffi/src/powerpc/ppc_closure.S
+--- gcc-4.3.3.orig/libffi/src/powerpc/ppc_closure.S 2007-12-01 22:00:04.000000000 +0100
++++ gcc-4.3.3/libffi/src/powerpc/ppc_closure.S 2009-01-27 22:25:27.000000000 +0100
+@@ -295,3 +295,7 @@
+ .LEFDE1:
+
+ #endif
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/powerpc/sysv.S gcc-4.3.3/libffi/src/powerpc/sysv.S
+--- gcc-4.3.3.orig/libffi/src/powerpc/sysv.S 2007-12-01 22:00:04.000000000 +0100
++++ gcc-4.3.3/libffi/src/powerpc/sysv.S 2009-01-27 22:25:27.000000000 +0100
+@@ -223,3 +223,7 @@
+ .align 2
+ .LEFDE1:
+ #endif
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/s390/sysv.S gcc-4.3.3/libffi/src/s390/sysv.S
+--- gcc-4.3.3.orig/libffi/src/s390/sysv.S 2003-10-21 21:01:58.000000000 +0200
++++ gcc-4.3.3/libffi/src/s390/sysv.S 2009-01-27 22:25:27.000000000 +0100
+@@ -427,3 +427,6 @@
+
+ #endif
+
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/sparc/v8.S gcc-4.3.3/libffi/src/sparc/v8.S
+--- gcc-4.3.3.orig/libffi/src/sparc/v8.S 2008-11-21 23:13:13.000000000 +0100
++++ gcc-4.3.3/libffi/src/sparc/v8.S 2009-01-27 22:25:27.000000000 +0100
+@@ -306,3 +306,7 @@
+ .byte 0x1f ! uleb128 0x1f
+ .align WS
+ .LLEFDE2:
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/sparc/v9.S gcc-4.3.3/libffi/src/sparc/v9.S
+--- gcc-4.3.3.orig/libffi/src/sparc/v9.S 2004-01-25 07:58:33.000000000 +0100
++++ gcc-4.3.3/libffi/src/sparc/v9.S 2009-01-27 22:25:27.000000000 +0100
+@@ -300,3 +300,7 @@
+ .align 8
+ .LLEFDE2:
+ #endif
++
++#ifdef __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/x86/sysv.S gcc-4.3.3/libffi/src/x86/sysv.S
+--- gcc-4.3.3.orig/libffi/src/x86/sysv.S 2008-01-30 15:36:58.000000000 +0100
++++ gcc-4.3.3/libffi/src/x86/sysv.S 2009-01-27 22:25:27.000000000 +0100
+@@ -430,3 +430,7 @@
+ #endif
+
+ #endif /* ifndef __x86_64__ */
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+diff -durN gcc-4.3.3.orig/libffi/src/x86/unix64.S gcc-4.3.3/libffi/src/x86/unix64.S
+--- gcc-4.3.3.orig/libffi/src/x86/unix64.S 2005-05-05 06:06:38.000000000 +0200
++++ gcc-4.3.3/libffi/src/x86/unix64.S 2009-01-27 22:25:27.000000000 +0100
+@@ -410,3 +410,7 @@
+ .LEFDE3:
+
+ #endif /* __x86_64__ */
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
diff --git a/patches/gcc/4.3.4/230-pr34571.patch b/patches/gcc/4.3.4/230-pr34571.patch
new file mode 100644
index 0000000..c28a1cc
--- /dev/null
+++ b/patches/gcc/4.3.4/230-pr34571.patch
@@ -0,0 +1,28 @@
+Original patch from: ../4.3.2/230-pr34571.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/64_all_gcc43-pr34571.patch
+http://gcc.gnu.org/PR34571
+
+2007-12-26 Rask Ingemann Lambertsen <rask@sygehus.dk>
+
+ PR target/34571
+ * config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
+ symbolic_operand.
+ * varasm.c (output_constant_pool_1): Fix typo.
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/alpha/alpha.c gcc-4.3.3/gcc/config/alpha/alpha.c
+--- gcc-4.3.3.orig/gcc/config/alpha/alpha.c 2008-09-09 01:16:55.000000000 +0200
++++ gcc-4.3.3/gcc/config/alpha/alpha.c 2009-01-27 22:25:29.000000000 +0100
+@@ -1113,8 +1113,7 @@
+ static bool
+ alpha_cannot_force_const_mem (rtx x)
+ {
+- enum rtx_code code = GET_CODE (x);
+- return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
++ return symbolic_operand (x, GET_MODE (x));
+ }
+
+ /* We do not allow indirect calls to be optimized into sibling calls, nor
diff --git a/patches/gcc/4.3.4/240-pr25343.patch b/patches/gcc/4.3.4/240-pr25343.patch
new file mode 100644
index 0000000..07d6318
--- /dev/null
+++ b/patches/gcc/4.3.4/240-pr25343.patch
@@ -0,0 +1,26 @@
+Original patch from: ../4.3.2/240-pr25343.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/66_all_gcc43-pr25343.patch
+http://gcc.gnu.org/PR25343
+
+sniped from Debian
+
+2008-04-27 Roman Zippel <zippel@linux-m68k.org>
+
+ * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/host-linux.c gcc-4.3.3/gcc/config/host-linux.c
+--- gcc-4.3.3.orig/gcc/config/host-linux.c 2007-08-02 12:49:31.000000000 +0200
++++ gcc-4.3.3/gcc/config/host-linux.c 2009-01-27 22:25:31.000000000 +0100
+@@ -84,6 +84,8 @@
+ # define TRY_EMPTY_VM_SPACE 0x8000000000
+ #elif defined(__sparc__)
+ # define TRY_EMPTY_VM_SPACE 0x60000000
++#elif defined(__mc68000__)
++# define TRY_EMPTY_VM_SPACE 0x40000000
+ #else
+ # define TRY_EMPTY_VM_SPACE 0
+ #endif
diff --git a/patches/gcc/4.3.4/250-sh-pr24836.patch b/patches/gcc/4.3.4/250-sh-pr24836.patch
new file mode 100644
index 0000000..1528b35
--- /dev/null
+++ b/patches/gcc/4.3.4/250-sh-pr24836.patch
@@ -0,0 +1,33 @@
+Original patch from: ../4.3.2/250-sh-pr24836.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/74_all_sh-pr24836.patch
+http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
+http://gcc.gnu.org/PR24836
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/configure gcc-4.3.3/gcc/configure
+--- gcc-4.3.3.orig/gcc/configure 2009-01-27 22:19:18.000000000 +0100
++++ gcc-4.3.3/gcc/configure 2009-01-27 22:25:33.000000000 +0100
+@@ -20689,7 +20689,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+diff -durN gcc-4.3.3.orig/gcc/configure.ac gcc-4.3.3/gcc/configure.ac
+--- gcc-4.3.3.orig/gcc/configure.ac 2009-01-27 22:19:18.000000000 +0100
++++ gcc-4.3.3/gcc/configure.ac 2009-01-27 22:25:33.000000000 +0100
+@@ -2552,7 +2552,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
diff --git a/patches/gcc/4.3.4/260-uclibc-conf-noupstream.patch b/patches/gcc/4.3.4/260-uclibc-conf-noupstream.patch
new file mode 100644
index 0000000..c046030
--- /dev/null
+++ b/patches/gcc/4.3.4/260-uclibc-conf-noupstream.patch
@@ -0,0 +1,18 @@
+Original patch from: ../4.3.2/260-uclibc-conf-noupstream.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_103-uclibc-conf-noupstream.patch
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config.gcc gcc-4.3.3/gcc/config.gcc
+--- gcc-4.3.3.orig/gcc/config.gcc 2009-01-27 22:19:34.000000000 +0100
++++ gcc-4.3.3/gcc/config.gcc 2009-01-27 22:25:35.000000000 +0100
+@@ -2146,7 +2146,7 @@
+ ;;
+ sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
+ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
+- sh-*-linux* | sh[346lbe]*-*-linux* | \
++ sh*-*-linux* | sh[346lbe]*-*-linux* | \
+ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ tmake_file="${tmake_file} sh/t-sh sh/t-elf"
diff --git a/patches/gcc/4.3.4/270-missing-execinfo_h.patch b/patches/gcc/4.3.4/270-missing-execinfo_h.patch
new file mode 100644
index 0000000..8f36f45
--- /dev/null
+++ b/patches/gcc/4.3.4/270-missing-execinfo_h.patch
@@ -0,0 +1,18 @@
+Original patch from: ../4.3.2/270-missing-execinfo_h.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/boehm-gc/include/gc.h gcc-4.3.3/boehm-gc/include/gc.h
+--- gcc-4.3.3.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
++++ gcc-4.3.3/boehm-gc/include/gc.h 2009-01-27 22:25:37.000000000 +0100
+@@ -503,7 +503,7 @@
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/patches/gcc/4.3.4/280-c99-complex-ugly-hack.patch b/patches/gcc/4.3.4/280-c99-complex-ugly-hack.patch
new file mode 100644
index 0000000..7588647
--- /dev/null
+++ b/patches/gcc/4.3.4/280-c99-complex-ugly-hack.patch
@@ -0,0 +1,19 @@
+Original patch from: ../4.3.2/280-c99-complex-ugly-hack.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/libstdc++-v3/configure gcc-4.3.3/libstdc++-v3/configure
+--- gcc-4.3.3.orig/libstdc++-v3/configure 2008-07-07 21:49:54.000000000 +0200
++++ gcc-4.3.3/libstdc++-v3/configure 2009-01-27 22:25:39.000000000 +0100
+@@ -38935,6 +38935,9 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <complex.h>
++#ifdef __UCLIBC__
++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
++#endif
+ int
+ main ()
+ {
diff --git a/patches/gcc/4.3.4/290-index_macro.patch b/patches/gcc/4.3.4/290-index_macro.patch
new file mode 100644
index 0000000..7bb899a
--- /dev/null
+++ b/patches/gcc/4.3.4/290-index_macro.patch
@@ -0,0 +1,32 @@
+Original patch from: ../4.3.2/290-index_macro.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/libstdc++-v3/include/ext/rope gcc-4.3.3/libstdc++-v3/include/ext/rope
+--- gcc-4.3.3.orig/libstdc++-v3/include/ext/rope 2008-07-15 12:14:51.000000000 +0200
++++ gcc-4.3.3/libstdc++-v3/include/ext/rope 2009-01-27 22:25:41.000000000 +0100
+@@ -59,6 +59,9 @@
+ #include <bits/gthr.h>
+ #include <tr1/functional>
+
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ # ifdef __GC
+ # define __GC_CONST const
+ # else
+diff -durN gcc-4.3.3.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.3/libstdc++-v3/include/ext/ropeimpl.h
+--- gcc-4.3.3.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200
++++ gcc-4.3.3/libstdc++-v3/include/ext/ropeimpl.h 2009-01-27 22:25:41.000000000 +0100
+@@ -54,6 +54,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;
diff --git a/patches/gcc/4.3.4/300-libmudflap-susv3-legacy.patch b/patches/gcc/4.3.4/300-libmudflap-susv3-legacy.patch
new file mode 100644
index 0000000..7b20da9
--- /dev/null
+++ b/patches/gcc/4.3.4/300-libmudflap-susv3-legacy.patch
@@ -0,0 +1,54 @@
+Original patch from: ../4.3.2/300-libmudflap-susv3-legacy.patch
+
+-= BEGIN original header =-
+Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/libmudflap/mf-hooks2.c gcc-4.3.3/libmudflap/mf-hooks2.c
+--- gcc-4.3.3.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
++++ gcc-4.3.3/libmudflap/mf-hooks2.c 2009-01-27 22:25:45.000000000 +0100
+@@ -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 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 */
diff --git a/patches/gcc/4.3.4/310-arm-softfloat.patch b/patches/gcc/4.3.4/310-arm-softfloat.patch
new file mode 100644
index 0000000..60de45f
--- /dev/null
+++ b/patches/gcc/4.3.4/310-arm-softfloat.patch
@@ -0,0 +1,34 @@
+Original patch from: ../4.3.2/310-arm-softfloat.patch
+
+-= BEGIN original header =-
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/arm/linux-elf.h gcc-4.3.3/gcc/config/arm/linux-elf.h
+--- gcc-4.3.3.orig/gcc/config/arm/linux-elf.h 2007-11-08 14:44:09.000000000 +0100
++++ gcc-4.3.3/gcc/config/arm/linux-elf.h 2009-01-27 22:25:47.000000000 +0100
+@@ -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"
+
+diff -durN gcc-4.3.3.orig/gcc/config/arm/t-linux gcc-4.3.3/gcc/config/arm/t-linux
+--- gcc-4.3.3.orig/gcc/config/arm/t-linux 2006-11-09 23:14:27.000000000 +0100
++++ gcc-4.3.3/gcc/config/arm/t-linux 2009-01-27 22:25:47.000000000 +0100
+@@ -3,7 +3,12 @@
+ TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
++ _call_via_rX _interwork_call_via_rX \
++ _lshrdi3 _ashrdi3 _ashldi3 \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/patches/gcc/4.3.4/320-alpha-signal_h.patch b/patches/gcc/4.3.4/320-alpha-signal_h.patch
new file mode 100644
index 0000000..2f4df3e
--- /dev/null
+++ b/patches/gcc/4.3.4/320-alpha-signal_h.patch
@@ -0,0 +1,23 @@
+Original patch from: ../4.3.2/320-alpha-signal_h.patch
+
+-= BEGIN original header =-
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/alpha/linux-unwind.h gcc-4.3.3/gcc/config/alpha/linux-unwind.h
+--- gcc-4.3.3.orig/gcc/config/alpha/linux-unwind.h 2006-10-26 21:31:09.000000000 +0200
++++ gcc-4.3.3/gcc/config/alpha/linux-unwind.h 2009-01-27 22:25:49.000000000 +0100
+@@ -29,6 +29,9 @@
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++/* Don't use this if inhibit_libc is set
++ The build for this target will fail trying to include missing headers */
++#ifndef inhibit_libc
+ #include <signal.h>
+ #include <sys/ucontext.h>
+
+@@ -80,3 +83,4 @@
+ fs->retaddr_column = 64;
+ return _URC_NO_REASON;
+ }
++#endif /* inhibit_libc */
diff --git a/patches/gcc/4.3.4/330-unwind-for-uClibc.patch b/patches/gcc/4.3.4/330-unwind-for-uClibc.patch
new file mode 100644
index 0000000..ac97c2f
--- /dev/null
+++ b/patches/gcc/4.3.4/330-unwind-for-uClibc.patch
@@ -0,0 +1,30 @@
+Original patch from: ../4.3.2/330-unwind-for-uClibc.patch
+
+-= BEGIN original header =-
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/t-linux-uclibc gcc-4.3.3/gcc/config/t-linux-uclibc
+--- gcc-4.3.3.orig/gcc/config/t-linux-uclibc 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.3.3/gcc/config/t-linux-uclibc 2009-01-27 22:28:53.000000000 +0100
+@@ -0,0 +1,5 @@
++# Remove glibc specific files added in t-linux
++SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
++
++# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
++LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
+diff -durN gcc-4.3.3.orig/gcc/config.gcc gcc-4.3.3/gcc/config.gcc
+--- gcc-4.3.3.orig/gcc/config.gcc 2009-01-27 22:25:37.000000000 +0100
++++ gcc-4.3.3/gcc/config.gcc 2009-01-27 22:28:53.000000000 +0100
+@@ -2648,6 +2648,12 @@
+ ;;
+ esac
+
++# Rather than hook into each target, just do it after all the linux
++# targets have been processed
++case ${target} in
++ *-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc";;
++esac
++
+ case ${target} in
+ i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1)
+ tmake_file="${tmake_file} i386/t-gmm_malloc"
diff --git a/patches/gcc/4.3.4/340-make-mno-spe-work-as-expected.patch b/patches/gcc/4.3.4/340-make-mno-spe-work-as-expected.patch
new file mode 100644
index 0000000..ad2d203
--- /dev/null
+++ b/patches/gcc/4.3.4/340-make-mno-spe-work-as-expected.patch
@@ -0,0 +1,90 @@
+Original patch from: ../4.3.2/340-make-mno-spe-work-as-expected.patch
+
+-= BEGIN original header =-
+2008-04-03 Nathan Froyd <froydnj@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/rs6000/rs6000.opt (mspe): Remove Var property.
+ (misel): Likewise.
+ * config/rs6000/rs6000.h (rs6000_spe): Declare.
+ (rs6000_isel): Likewise.
+ * config/rs6000/rs6000.c (rs6000_spe): New variable.
+ (rs6000_isel): New variable.
+ (rs6000_handle_option): Handle OPT_mspe and OPT_misel.
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/rs6000/rs6000.c gcc-4.3.3/gcc/config/rs6000/rs6000.c
+--- gcc-4.3.3.orig/gcc/config/rs6000/rs6000.c 2008-11-18 23:07:58.000000000 +0100
++++ gcc-4.3.3/gcc/config/rs6000/rs6000.c 2009-01-27 22:28:55.000000000 +0100
+@@ -174,9 +174,15 @@
+ /* Nonzero to use AltiVec ABI. */
+ int rs6000_altivec_abi;
+
++/* Nonzero if we want SPE SIMD instructions. */
++int rs6000_spe;
++
+ /* Nonzero if we want SPE ABI extensions. */
+ int rs6000_spe_abi;
+
++/* Nonzero to use isel instructions. */
++int rs6000_isel;
++
+ /* Nonzero if floating point operations are done in the GPRs. */
+ int rs6000_float_gprs = 0;
+
+@@ -2144,11 +2150,21 @@
+ rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE));
+ break;
+
++ case OPT_misel:
++ rs6000_explicit_options.isel = true;
++ rs6000_isel = value;
++ break;
++
+ case OPT_misel_:
+ rs6000_explicit_options.isel = true;
+ rs6000_parse_yes_no_option ("isel", arg, &(rs6000_isel));
+ break;
+
++ case OPT_mspe:
++ rs6000_explicit_options.spe = true;
++ rs6000_spe = value;
++ break;
++
+ case OPT_mspe_:
+ rs6000_explicit_options.spe = true;
+ rs6000_parse_yes_no_option ("spe", arg, &(rs6000_spe));
+diff -durN gcc-4.3.3.orig/gcc/config/rs6000/rs6000.h gcc-4.3.3/gcc/config/rs6000/rs6000.h
+--- gcc-4.3.3.orig/gcc/config/rs6000/rs6000.h 2008-01-26 18:18:35.000000000 +0100
++++ gcc-4.3.3/gcc/config/rs6000/rs6000.h 2009-01-27 22:28:55.000000000 +0100
+@@ -349,6 +349,8 @@
+ extern int rs6000_ieeequad;
+ extern int rs6000_altivec_abi;
+ extern int rs6000_spe_abi;
++extern int rs6000_spe;
++extern int rs6000_isel;
+ extern int rs6000_float_gprs;
+ extern int rs6000_alignment_flags;
+ extern const char *rs6000_sched_insert_nops_str;
+diff -durN gcc-4.3.3.orig/gcc/config/rs6000/rs6000.opt gcc-4.3.3/gcc/config/rs6000/rs6000.opt
+--- gcc-4.3.3.orig/gcc/config/rs6000/rs6000.opt 2007-10-31 08:56:01.000000000 +0100
++++ gcc-4.3.3/gcc/config/rs6000/rs6000.opt 2009-01-27 22:28:55.000000000 +0100
+@@ -190,7 +190,7 @@
+ -mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead
+
+ misel
+-Target Var(rs6000_isel)
++Target
+ Generate isel instructions
+
+ misel=
+@@ -198,7 +198,7 @@
+ -misel=yes/no Deprecated option. Use -misel/-mno-isel instead
+
+ mspe
+-Target Var(rs6000_spe)
++Target
+ Generate SPE SIMD instructions on E500
+
+ mpaired
diff --git a/patches/gcc/4.3.4/350-sh-without-headers.patch b/patches/gcc/4.3.4/350-sh-without-headers.patch
new file mode 100644
index 0000000..0bb860d
--- /dev/null
+++ b/patches/gcc/4.3.4/350-sh-without-headers.patch
@@ -0,0 +1,29 @@
+Original patch from: ../4.3.2/350-sh-without-headers.patch
+
+-= BEGIN original header =-
+On 20081011, Khem RAJ writes:
+ You have to bar gcc trying to build unwinding at stage 1. Try the
+ attached patch and see if it helps.
+
+ gcc/config/sh/linux-unwind.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+-= END original header =-
+
+diff -durN gcc-4.3.3.orig/gcc/config/sh/linux-unwind.h gcc-4.3.3/gcc/config/sh/linux-unwind.h
+--- gcc-4.3.3.orig/gcc/config/sh/linux-unwind.h 2007-09-12 08:59:06.000000000 +0200
++++ gcc-4.3.3/gcc/config/sh/linux-unwind.h 2009-01-27 22:28:57.000000000 +0100
+@@ -26,6 +26,8 @@
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
++#ifndef inhibit_libc
++
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
+@@ -251,3 +253,4 @@
+ return _URC_NO_REASON;
+ }
+ #endif /* defined (__SH5__) */
++#endif /* ifndef inhibit_libc */
diff --git a/patches/gcc/4.3.4/380-pr37436.patch b/patches/gcc/4.3.4/380-pr37436.patch
new file mode 100644
index 0000000..99a016f
--- /dev/null
+++ b/patches/gcc/4.3.4/380-pr37436.patch
@@ -0,0 +1,86 @@
+gcc svn 142778:
+
+PR target/37436
+* arm.c (arm_legitimate_index): Only accept addresses that are in
+canonical form.
+* predicates.md (arm_reg_or_extendqisi_mem_op): New predicate.
+* arm.md (extendqihi2): Use arm_reg_or_extendqisi_mem_op predicate
+for operand1.
+(extendqisi2): Likewise.
+(arm_extendqisi, arm_extendqisi_v6): Use arm_extendqisi_mem_op
+predicate for operand1.
+
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.c gcc-4.3.3/gcc/config/arm/arm.c
+--- gcc-4.3.3.orig/gcc/config/arm/arm.c 2008-06-11 07:52:55.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/arm.c 2009-05-21 16:06:45.000000000 -0300
+@@ -3769,6 +3769,7 @@
+ rtx xop1 = XEXP (x, 1);
+
+ return ((arm_address_register_rtx_p (xop0, strict_p)
++ && GET_CODE(xop1) == CONST_INT
+ && arm_legitimate_index_p (mode, xop1, outer, strict_p))
+ || (arm_address_register_rtx_p (xop1, strict_p)
+ && arm_legitimate_index_p (mode, xop0, outer, strict_p)));
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.md gcc-4.3.3/gcc/config/arm/arm.md
+--- gcc-4.3.3.orig/gcc/config/arm/arm.md 2007-09-04 01:44:47.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/arm.md 2009-05-21 16:06:45.000000000 -0300
+@@ -4199,7 +4199,7 @@
+
+ (define_expand "extendqihi2"
+ [(set (match_dup 2)
+- (ashift:SI (match_operand:QI 1 "general_operand" "")
++ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
+ (const_int 24)))
+ (set (match_operand:HI 0 "s_register_operand" "")
+ (ashiftrt:SI (match_dup 2)
+@@ -4224,7 +4224,7 @@
+
+ (define_insn "*arm_extendqihi_insn"
+ [(set (match_operand:HI 0 "s_register_operand" "=r")
+- (sign_extend:HI (match_operand:QI 1 "memory_operand" "Uq")))]
++ (sign_extend:HI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
+ "TARGET_ARM && arm_arch4"
+ "ldr%(sb%)\\t%0, %1"
+ [(set_attr "type" "load_byte")
+@@ -4235,7 +4235,7 @@
+
+ (define_expand "extendqisi2"
+ [(set (match_dup 2)
+- (ashift:SI (match_operand:QI 1 "general_operand" "")
++ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
+ (const_int 24)))
+ (set (match_operand:SI 0 "s_register_operand" "")
+ (ashiftrt:SI (match_dup 2)
+@@ -4267,7 +4267,7 @@
+
+ (define_insn "*arm_extendqisi"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+- (sign_extend:SI (match_operand:QI 1 "memory_operand" "Uq")))]
++ (sign_extend:SI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
+ "TARGET_ARM && arm_arch4 && !arm_arch6"
+ "ldr%(sb%)\\t%0, %1"
+ [(set_attr "type" "load_byte")
+@@ -4278,7 +4278,8 @@
+
+ (define_insn "*arm_extendqisi_v6"
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+- (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uq")))]
++ (sign_extend:SI
++ (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "r,Uq")))]
+ "TARGET_ARM && arm_arch6"
+ "@
+ sxtb%?\\t%0, %1
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/predicates.md gcc-4.3.3/gcc/config/arm/predicates.md
+--- gcc-4.3.3.orig/gcc/config/arm/predicates.md 2007-08-02 07:49:31.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/predicates.md 2009-05-21 16:06:45.000000000 -0300
+@@ -234,6 +234,10 @@
+ (match_test "arm_legitimate_address_p (mode, XEXP (op, 0), SIGN_EXTEND,
+ 0)")))
+
++(define_special_predicate "arm_reg_or_extendqisi_mem_op"
++ (ior (match_operand 0 "arm_extendqisi_mem_op")
++ (match_operand 0 "s_register_operand")))
++
+ (define_predicate "power_of_two_operand"
+ (match_code "const_int")
+ {
diff --git a/patches/gcc/4.4.0/100-alpha-mieee-default.patch b/patches/gcc/4.4.0/100-alpha-mieee-default.patch
new file mode 100644
index 0000000..7cf0dc4
--- /dev/null
+++ b/patches/gcc/4.4.0/100-alpha-mieee-default.patch
@@ -0,0 +1,24 @@
+diff -durN gcc-4.4.0.orig/gcc/config/alpha/alpha.h gcc-4.4.0/gcc/config/alpha/alpha.h
+--- gcc-4.4.0.orig/gcc/config/alpha/alpha.h 2009-02-20 16:20:38.000000000 +0100
++++ gcc-4.4.0/gcc/config/alpha/alpha.h 2009-05-27 21:37:58.000000000 +0200
+@@ -95,6 +95,8 @@
+ while (0)
+ #endif
+
++#define CPP_SPEC "%{!no-ieee:-mieee}"
++
+ #define WORD_SWITCH_TAKES_ARG(STR) \
+ (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
+
+diff -durN gcc-4.4.0.orig/gcc/config/alpha/alpha.opt gcc-4.4.0/gcc/config/alpha/alpha.opt
+--- gcc-4.4.0.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200
++++ gcc-4.4.0/gcc/config/alpha/alpha.opt 2009-05-27 21:37:58.000000000 +0200
+@@ -39,7 +39,7 @@
+ Request IEEE-conformant math library routines (OSF/1)
+
+ mieee
+-Target Report RejectNegative Mask(IEEE)
++Target Report Mask(IEEE)
+ Emit IEEE-conformant code, without inexact exceptions
+
+ mieee-with-inexact
diff --git a/patches/gcc/4.4.0/110-trampolinewarn.patch b/patches/gcc/4.4.0/110-trampolinewarn.patch
new file mode 100644
index 0000000..f3ef499
--- /dev/null
+++ b/patches/gcc/4.4.0/110-trampolinewarn.patch
@@ -0,0 +1,27 @@
+diff -durN gcc-4.4.0.orig/gcc/builtins.c gcc-4.4.0/gcc/builtins.c
+--- gcc-4.4.0.orig/gcc/builtins.c 2009-03-30 19:42:27.000000000 +0200
++++ gcc-4.4.0/gcc/builtins.c 2009-05-27 21:38:01.000000000 +0200
+@@ -5768,6 +5768,9 @@
+ trampolines_created = 1;
+ INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
+
++ if (warn_trampolines)
++ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
++
+ return const0_rtx;
+ }
+
+diff -durN gcc-4.4.0.orig/gcc/common.opt gcc-4.4.0/gcc/common.opt
+--- gcc-4.4.0.orig/gcc/common.opt 2009-03-28 18:28:45.000000000 +0100
++++ gcc-4.4.0/gcc/common.opt 2009-05-27 21:38:01.000000000 +0200
+@@ -197,6 +197,10 @@
+ Common Var(warn_type_limits) Init(-1) Warning
+ Warn if a comparison is always true or always false due to the limited range of the data type
+
++Wtrampolines
++Common Var(warn_trampolines) Init(1)
++Warn whenever a trampoline is generated
++
+ Wuninitialized
+ Common Var(warn_uninitialized) Warning
+ Warn about uninitialized automatic variables
diff --git a/patches/gcc/4.4.0/120-java-nomulti.patch b/patches/gcc/4.4.0/120-java-nomulti.patch
new file mode 100644
index 0000000..645479c
--- /dev/null
+++ b/patches/gcc/4.4.0/120-java-nomulti.patch
@@ -0,0 +1,46 @@
+diff -durN gcc-4.4.0.orig/libjava/configure gcc-4.4.0/libjava/configure
+--- gcc-4.4.0.orig/libjava/configure 2009-04-21 11:08:08.000000000 +0200
++++ gcc-4.4.0/libjava/configure 2009-05-27 21:38:03.000000000 +0200
+@@ -1021,6 +1021,8 @@
+ default=yes
+ --enable-java-maintainer-mode
+ allow rebuilding of .class and .h files
++ --enable-libjava-multilib
++ build libjava as multilib
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-maintainer-mode enable make rules and dependencies not useful
+@@ -1973,6 +1975,16 @@
+ fi
+
+
++# Check whether --enable-libjava-multilib was given.
++if test "${enable_libjava_multilib+set}" = set; then
++ enableval=$enable_libjava_multilib;
++fi
++
++if test "$enable_libjava_multilib" = no; then
++ multilib=no
++ ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+
+
+diff -durN gcc-4.4.0.orig/libjava/configure.ac gcc-4.4.0/libjava/configure.ac
+--- gcc-4.4.0.orig/libjava/configure.ac 2009-04-09 23:54:28.000000000 +0200
++++ gcc-4.4.0/libjava/configure.ac 2009-05-27 21:38:03.000000000 +0200
+@@ -139,6 +139,13 @@
+ [allow rebuilding of .class and .h files]))
+ AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
+
++AC_ARG_ENABLE(libjava-multilib,
++ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
++if test "$enable_libjava_multilib" = no; then
++ multilib=no
++ ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+ GCC_NO_EXECUTABLES
+
diff --git a/patches/gcc/4.4.0/130-cross-compile.patch b/patches/gcc/4.4.0/130-cross-compile.patch
new file mode 100644
index 0000000..76fe7c8
--- /dev/null
+++ b/patches/gcc/4.4.0/130-cross-compile.patch
@@ -0,0 +1,39 @@
+diff -durN gcc-4.4.0.orig/gcc/configure gcc-4.4.0/gcc/configure
+--- gcc-4.4.0.orig/gcc/configure 2009-03-24 18:46:03.000000000 +0100
++++ gcc-4.4.0/gcc/configure 2009-05-27 21:38:06.000000000 +0200
+@@ -13997,7 +13997,7 @@
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
+diff -durN gcc-4.4.0.orig/gcc/configure.ac gcc-4.4.0/gcc/configure.ac
+--- gcc-4.4.0.orig/gcc/configure.ac 2009-03-24 18:46:03.000000000 +0100
++++ gcc-4.4.0/gcc/configure.ac 2009-05-27 21:38:06.000000000 +0200
+@@ -1720,7 +1720,7 @@
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
+diff -durN gcc-4.4.0.orig/gcc/unwind-dw2.c gcc-4.4.0/gcc/unwind-dw2.c
+--- gcc-4.4.0.orig/gcc/unwind-dw2.c 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/unwind-dw2.c 2009-05-27 21:38:06.000000000 +0200
+@@ -329,9 +329,11 @@
+ }
+ #endif
+
++#ifndef inhibit_libc
+ #ifdef MD_UNWIND_SUPPORT
+ #include MD_UNWIND_SUPPORT
+ #endif
++#endif
+
+ /* Extract any interesting information from the CIE for the translation
+ unit F belongs to. Return a pointer to the byte after the augmentation,
diff --git a/patches/gcc/4.4.0/140-default-format-security.patch b/patches/gcc/4.4.0/140-default-format-security.patch
new file mode 100644
index 0000000..51942f5
--- /dev/null
+++ b/patches/gcc/4.4.0/140-default-format-security.patch
@@ -0,0 +1,49 @@
+diff -durN gcc-4.4.0.orig/gcc/c-common.c gcc-4.4.0/gcc/c-common.c
+--- gcc-4.4.0.orig/gcc/c-common.c 2009-03-30 19:42:27.000000000 +0200
++++ gcc-4.4.0/gcc/c-common.c 2009-05-27 21:38:08.000000000 +0200
+@@ -301,7 +301,7 @@
+ /* Warn about format/argument anomalies in calls to formatted I/O functions
+ (*printf, *scanf, strftime, strfmon, etc.). */
+
+-int warn_format;
++int warn_format = 1;
+
+ /* Warn about using __null (as NULL in C++) as sentinel. For code compiled
+ with GCC this doesn't matter as __null is guaranteed to have the right
+diff -durN gcc-4.4.0.orig/gcc/c.opt gcc-4.4.0/gcc/c.opt
+--- gcc-4.4.0.orig/gcc/c.opt 2009-03-18 22:14:53.000000000 +0100
++++ gcc-4.4.0/gcc/c.opt 2009-05-27 21:38:08.000000000 +0200
+@@ -236,7 +236,7 @@
+ Warn about format strings that contain NUL bytes
+
+ Wformat-security
+-C ObjC C++ ObjC++ Var(warn_format_security) Warning
++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning
+ Warn about possible security problems with format functions
+
+ Wformat-y2k
+diff -durN gcc-4.4.0.orig/gcc/doc/invoke.texi gcc-4.4.0/gcc/doc/invoke.texi
+--- gcc-4.4.0.orig/gcc/doc/invoke.texi 2009-04-01 09:18:47.000000000 +0200
++++ gcc-4.4.0/gcc/doc/invoke.texi 2009-05-27 21:38:08.000000000 +0200
+@@ -2867,6 +2867,9 @@
+ @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
+ @option{-Wformat=2} are available, but are not included in @option{-Wall}.
+
++NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
++To disable, use @option{-Wformat=0}.
++
+ @item -Wformat-y2k
+ @opindex Wformat-y2k
+ @opindex Wno-format-y2k
+@@ -2920,6 +2923,11 @@
+ in future warnings may be added to @option{-Wformat-security} that are not
+ included in @option{-Wformat-nonliteral}.)
+
++NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
++To disable, use @option{-Wno-format-security}, or disable all format warnings
++with @option{-Wformat=0}. To make format security warnings fatal, specify
++@option{-Werror=format-security}.
++
+ @item -Wformat=2
+ @opindex Wformat=2
+ @opindex Wno-format=2
diff --git a/patches/gcc/4.4.0/150-default-fortify-source.patch b/patches/gcc/4.4.0/150-default-fortify-source.patch
new file mode 100644
index 0000000..a68227f
--- /dev/null
+++ b/patches/gcc/4.4.0/150-default-fortify-source.patch
@@ -0,0 +1,26 @@
+diff -durN gcc-4.4.0.orig/gcc/doc/invoke.texi gcc-4.4.0/gcc/doc/invoke.texi
+--- gcc-4.4.0.orig/gcc/doc/invoke.texi 2009-05-27 21:38:11.000000000 +0200
++++ gcc-4.4.0/gcc/doc/invoke.texi 2009-05-27 21:38:11.000000000 +0200
+@@ -5411,6 +5411,11 @@
+ Please note the warning under @option{-fgcse} about
+ invoking @option{-O2} on programs that use computed gotos.
+
++NOTE: In Gentoo, @option{-D_FORTIFY_SOURCE=2} is set by default, and is
++activated when @option{-O} is set to 2 or higher. This enables additional
++compile-time and run-time checks for several libc functions. To disable,
++specify either @option{-U_FORTIFY_SOURCE} or @option{-D_FORTIFY_SOURCE=0}.
++
+ @item -O3
+ @opindex O3
+ Optimize yet more. @option{-O3} turns on all optimizations specified
+diff -durN gcc-4.4.0.orig/gcc/gcc.c gcc-4.4.0/gcc/gcc.c
+--- gcc-4.4.0.orig/gcc/gcc.c 2009-03-17 22:25:59.000000000 +0100
++++ gcc-4.4.0/gcc/gcc.c 2009-05-27 21:38:11.000000000 +0200
+@@ -807,6 +807,7 @@
+ %{H} %C %{D*&U*&A*} %{i*} %Z %i\
+ %{fmudflap:-D_MUDFLAP -include mf-runtime.h}\
+ %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\
++ %{!D_FORTIFY_SOURCE:%{!D_FORTIFY_SOURCE=*:%{!U_FORTIFY_SOURCE:-D_FORTIFY_SOURCE=2}}}\
+ %{E|M|MM:%W{o*}}";
+
+ /* This contains cpp options which are common with cc1_options and are passed
diff --git a/patches/gcc/4.4.0/160-netbsd-symbolic.patch b/patches/gcc/4.4.0/160-netbsd-symbolic.patch
new file mode 100644
index 0000000..fe1f1cb
--- /dev/null
+++ b/patches/gcc/4.4.0/160-netbsd-symbolic.patch
@@ -0,0 +1,11 @@
+diff -durN gcc-4.4.0.orig/gcc/config/netbsd-elf.h gcc-4.4.0/gcc/config/netbsd-elf.h
+--- gcc-4.4.0.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200
++++ gcc-4.4.0/gcc/config/netbsd-elf.h 2009-05-27 21:38:14.000000000 +0200
+@@ -82,6 +82,7 @@
+ #define NETBSD_LINK_SPEC_ELF \
+ "%{assert*} %{R*} %{rpath*} \
+ %{shared:-shared} \
++ %{symbolic:-Bsymbolic} \
+ %{!shared: \
+ -dc -dp \
+ %{!nostdlib: \
diff --git a/patches/gcc/4.4.0/170-sparc64-bsd.patch b/patches/gcc/4.4.0/170-sparc64-bsd.patch
new file mode 100644
index 0000000..99a5eea
--- /dev/null
+++ b/patches/gcc/4.4.0/170-sparc64-bsd.patch
@@ -0,0 +1,29 @@
+diff -durN gcc-4.4.0.orig/gcc/config/sparc/freebsd.h gcc-4.4.0/gcc/config/sparc/freebsd.h
+--- gcc-4.4.0.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200
++++ gcc-4.4.0/gcc/config/sparc/freebsd.h 2009-05-27 21:38:16.000000000 +0200
+@@ -25,9 +25,22 @@
+ /* FreeBSD needs the platform name (sparc64) defined.
+ Emacs needs to know if the arch is 64 or 32-bits. */
+
+-#undef CPP_CPU64_DEFAULT_SPEC
+-#define CPP_CPU64_DEFAULT_SPEC \
+- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
++#undef FBSD_TARGET_CPU_CPP_BUILTINS
++#define FBSD_TARGET_CPU_CPP_BUILTINS() \
++ do \
++ { \
++ if (TARGET_ARCH64) \
++ { \
++ builtin_define ("__sparc64__"); \
++ builtin_define ("__sparc_v9__"); \
++ builtin_define ("__sparcv9"); \
++ } \
++ else \
++ builtin_define ("__sparc"); \
++ builtin_define ("__sparc__"); \
++ } \
++ while (0)
++
+
+ #define LINK_SPEC "%(link_arch) \
+ %{!mno-relax:%{!r:-relax}} \
diff --git a/patches/gcc/4.4.0/180-libgomp-no-werror.patch b/patches/gcc/4.4.0/180-libgomp-no-werror.patch
new file mode 100644
index 0000000..9d2adf0
--- /dev/null
+++ b/patches/gcc/4.4.0/180-libgomp-no-werror.patch
@@ -0,0 +1,12 @@
+diff -durN gcc-4.4.0.orig/libgomp/configure gcc-4.4.0/libgomp/configure
+--- gcc-4.4.0.orig/libgomp/configure 2009-04-21 11:08:08.000000000 +0200
++++ gcc-4.4.0/libgomp/configure 2009-05-27 21:38:19.000000000 +0200
+@@ -3334,7 +3334,7 @@
+
+ # Add -Wall -Werror if we are using GCC.
+ if test "x$GCC" = "xyes"; then
+- XCFLAGS="$XCFLAGS -Wall -Werror"
++ XCFLAGS="$XCFLAGS -Wall"
+ fi
+
+ # Find other programs we need.
diff --git a/patches/gcc/4.4.0/190-flatten-switch-stmt-00.patch b/patches/gcc/4.4.0/190-flatten-switch-stmt-00.patch
new file mode 100644
index 0000000..8db1ccc
--- /dev/null
+++ b/patches/gcc/4.4.0/190-flatten-switch-stmt-00.patch
@@ -0,0 +1,24 @@
+diff -durN gcc-4.4.0.orig/gcc/stmt.c gcc-4.4.0/gcc/stmt.c
+--- gcc-4.4.0.orig/gcc/stmt.c 2009-02-27 20:49:42.000000000 +0100
++++ gcc-4.4.0/gcc/stmt.c 2009-05-27 21:38:21.000000000 +0200
+@@ -2376,7 +2376,11 @@
+ 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);
+ if (default_label)
+ emit_jump (default_label);
+@@ -2942,6 +2946,7 @@
+ {
+ 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,
diff --git a/patches/gcc/4.4.0/200-libiberty.h-asprintf.patch b/patches/gcc/4.4.0/200-libiberty.h-asprintf.patch
new file mode 100644
index 0000000..02784be
--- /dev/null
+++ b/patches/gcc/4.4.0/200-libiberty.h-asprintf.patch
@@ -0,0 +1,15 @@
+diff -durN gcc-4.4.0.orig/include/libiberty.h gcc-4.4.0/include/libiberty.h
+--- gcc-4.4.0.orig/include/libiberty.h 2008-06-24 03:42:31.000000000 +0200
++++ gcc-4.4.0/include/libiberty.h 2009-05-27 21:38:24.000000000 +0200
+@@ -595,8 +595,11 @@
+ /* Like sprintf but provides a pointer to malloc'd storage, which must
+ be freed by the caller. */
+
++/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
++#ifndef asprintf
+ extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
+ #endif
++#endif
+
+ #if !HAVE_DECL_VASPRINTF
+ /* Like vsprintf but provides a pointer to malloc'd storage, which
diff --git a/patches/gcc/4.4.0/210-arm-unbreak-armv4t.patch b/patches/gcc/4.4.0/210-arm-unbreak-armv4t.patch
new file mode 100644
index 0000000..06eafc5
--- /dev/null
+++ b/patches/gcc/4.4.0/210-arm-unbreak-armv4t.patch
@@ -0,0 +1,12 @@
+diff -durN gcc-4.4.0.orig/gcc/config/arm/linux-eabi.h gcc-4.4.0/gcc/config/arm/linux-eabi.h
+--- gcc-4.4.0.orig/gcc/config/arm/linux-eabi.h 2007-11-08 14:44:09.000000000 +0100
++++ gcc-4.4.0/gcc/config/arm/linux-eabi.h 2009-05-27 21:38:26.000000000 +0200
+@@ -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. */
diff --git a/patches/gcc/4.4.0/220-libiberty-pic.patch b/patches/gcc/4.4.0/220-libiberty-pic.patch
new file mode 100644
index 0000000..ff13a4f
--- /dev/null
+++ b/patches/gcc/4.4.0/220-libiberty-pic.patch
@@ -0,0 +1,11 @@
+diff -durN gcc-4.4.0.orig/libiberty/Makefile.in gcc-4.4.0/libiberty/Makefile.in
+--- gcc-4.4.0.orig/libiberty/Makefile.in 2008-10-22 15:30:19.000000000 +0200
++++ gcc-4.4.0/libiberty/Makefile.in 2009-05-27 21:38:29.000000000 +0200
+@@ -227,6 +227,7 @@
+ $(AR) $(AR_FLAGS) $(TARGETLIB) \
+ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
+ $(RANLIB) $(TARGETLIB); \
++ cp $(TARGETLIB) ../ ; \
+ cd ..; \
+ else true; fi
+
diff --git a/patches/gcc/4.4.0/230-superh-default-multilib.patch b/patches/gcc/4.4.0/230-superh-default-multilib.patch
new file mode 100644
index 0000000..7c719e8
--- /dev/null
+++ b/patches/gcc/4.4.0/230-superh-default-multilib.patch
@@ -0,0 +1,12 @@
+diff -durN gcc-4.4.0.orig/gcc/config.gcc gcc-4.4.0/gcc/config.gcc
+--- gcc-4.4.0.orig/gcc/config.gcc 2009-04-17 13:58:41.000000000 +0200
++++ gcc-4.4.0/gcc/config.gcc 2009-05-27 21:38:31.000000000 +0200
+@@ -2121,7 +2121,7 @@
+ if test x${sh_multilibs} = x ; then
+ case ${target} in
+ sh64-superh-linux* | \
+- sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
++ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
+ sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
+ sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
+ sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;;
diff --git a/patches/gcc/4.4.0/240-libstdc++-pic.patch b/patches/gcc/4.4.0/240-libstdc++-pic.patch
new file mode 100644
index 0000000..b951dfc
--- /dev/null
+++ b/patches/gcc/4.4.0/240-libstdc++-pic.patch
@@ -0,0 +1,53 @@
+diff -durN gcc-4.4.0.orig/libstdc++-v3/src/Makefile.am gcc-4.4.0/libstdc++-v3/src/Makefile.am
+--- gcc-4.4.0.orig/libstdc++-v3/src/Makefile.am 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/libstdc++-v3/src/Makefile.am 2009-05-27 21:38:34.000000000 +0200
+@@ -351,6 +351,13 @@
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
+
+
++install-exec-local:
++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
++ if [ x"$$pic_objs" != x ]; then \
++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
++ fi
++
+ # Added bits to build debug library.
+ if GLIBCXX_BUILD_DEBUG
+ all-local: build_debug
+diff -durN gcc-4.4.0.orig/libstdc++-v3/src/Makefile.in gcc-4.4.0/libstdc++-v3/src/Makefile.in
+--- gcc-4.4.0.orig/libstdc++-v3/src/Makefile.in 2009-01-17 03:03:25.000000000 +0100
++++ gcc-4.4.0/libstdc++-v3/src/Makefile.in 2009-05-27 21:38:34.000000000 +0200
+@@ -726,7 +726,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
+
+@@ -765,7 +765,7 @@
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am \
+- uninstall-toolexeclibLTLIBRARIES
++ uninstall-toolexeclibLTLIBRARIES install-exec-local
+
+
+ # Symbol versioning for shared libraries.
+@@ -942,6 +942,14 @@
+ install_debug:
+ (cd ${debugdir} && $(MAKE) \
+ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
++
++install-exec-local:
++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
++ if [ x"$$pic_objs" != x ]; then \
++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
++ fi
++
+ # 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:
diff --git a/patches/gcc/4.4.0/250-ia64-noteGNUstack.patch b/patches/gcc/4.4.0/250-ia64-noteGNUstack.patch
new file mode 100644
index 0000000..9b80e6c
--- /dev/null
+++ b/patches/gcc/4.4.0/250-ia64-noteGNUstack.patch
@@ -0,0 +1,79 @@
+diff -durN gcc-4.4.0.orig/gcc/config/ia64/crtbegin.asm gcc-4.4.0/gcc/config/ia64/crtbegin.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/crtbegin.asm 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/config/ia64/crtbegin.asm 2009-05-27 21:38:37.000000000 +0200
+@@ -252,3 +252,7 @@
+ .weak __cxa_finalize
+ #endif
+ .weak _Jv_RegisterClasses
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.4.0.orig/gcc/config/ia64/crtend.asm gcc-4.4.0/gcc/config/ia64/crtend.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/crtend.asm 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/config/ia64/crtend.asm 2009-05-27 21:38:37.000000000 +0200
+@@ -119,3 +119,7 @@
+
+ br.ret.sptk.many rp
+ .endp __do_global_ctors_aux
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.4.0.orig/gcc/config/ia64/crti.asm gcc-4.4.0/gcc/config/ia64/crti.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/crti.asm 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/config/ia64/crti.asm 2009-05-27 21:38:37.000000000 +0200
+@@ -51,3 +51,7 @@
+ .body
+
+ # end of crti.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.4.0.orig/gcc/config/ia64/crtn.asm gcc-4.4.0/gcc/config/ia64/crtn.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/crtn.asm 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/config/ia64/crtn.asm 2009-05-27 21:38:37.000000000 +0200
+@@ -41,3 +41,7 @@
+ br.ret.sptk.many b0
+
+ # end of crtn.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.4.0.orig/gcc/config/ia64/lib1funcs.asm gcc-4.4.0/gcc/config/ia64/lib1funcs.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/lib1funcs.asm 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/config/ia64/lib1funcs.asm 2009-05-27 21:38:37.000000000 +0200
+@@ -793,3 +793,7 @@
+ .endp __floattitf
+ #endif
+ #endif
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -durN gcc-4.4.0.orig/gcc/config/ia64/linux.h gcc-4.4.0/gcc/config/ia64/linux.h
+--- gcc-4.4.0.orig/gcc/config/ia64/linux.h 2009-02-12 17:30:53.000000000 +0100
++++ gcc-4.4.0/gcc/config/ia64/linux.h 2009-05-27 21:38:37.000000000 +0200
+@@ -5,6 +5,8 @@
+
+ #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
+
++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
++
+ /* This is for -profile to use -lc_p instead of -lc. */
+ #undef CC1_SPEC
+ #define CC1_SPEC "%{profile:-p} %{G*}"
+diff -durN gcc-4.4.0.orig/gcc/config/rs6000/ppc-asm.h gcc-4.4.0/gcc/config/rs6000/ppc-asm.h
+--- gcc-4.4.0.orig/gcc/config/rs6000/ppc-asm.h 2008-10-13 17:44:26.000000000 +0200
++++ gcc-4.4.0/gcc/config/rs6000/ppc-asm.h 2009-05-27 21:38:37.000000000 +0200
+@@ -172,7 +172,7 @@
+ .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
+ #endif
+
+-#if defined __linux__ && !defined __powerpc64__
++#if defined __linux__
+ .section .note.GNU-stack
+ .previous
+ #endif
diff --git a/patches/gcc/4.4.0/260-sh-libgcc-stacks.patch b/patches/gcc/4.4.0/260-sh-libgcc-stacks.patch
new file mode 100644
index 0000000..62af2c9
--- /dev/null
+++ b/patches/gcc/4.4.0/260-sh-libgcc-stacks.patch
@@ -0,0 +1,25 @@
+diff -durN gcc-4.4.0.orig/gcc/config/sh/lib1funcs.asm gcc-4.4.0/gcc/config/sh/lib1funcs.asm
+--- gcc-4.4.0.orig/gcc/config/sh/lib1funcs.asm 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/config/sh/lib1funcs.asm 2009-05-27 21:38:39.000000000 +0200
+@@ -30,6 +30,11 @@
+ !! recoded in assembly by Toshiyasu Morita
+ !! tm@netcom.com
+
++#if defined(__ELF__) && defined(__linux__)
++.section .note.GNU-stack,"",%progbits
++.previous
++#endif
++
+ /* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
+ ELF local label prefixes by J"orn Rennecke
+ amylaar@cygnus.com */
+diff -durN gcc-4.4.0.orig/gcc/config/sh/linux-atomic.asm gcc-4.4.0/gcc/config/sh/linux-atomic.asm
+--- gcc-4.4.0.orig/gcc/config/sh/linux-atomic.asm 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/config/sh/linux-atomic.asm 2009-05-27 21:38:39.000000000 +0200
+@@ -136,3 +136,6 @@
+ ATOMIC_FETCH_AND_COMBOP(nand,and,not,4,l,mov)
+
+ #endif /* ! __SH5__ */
++
++.section .note.GNU-stack,"",%progbits
++.previous
diff --git a/patches/gcc/4.4.0/270-sh-pr24836.patch b/patches/gcc/4.4.0/270-sh-pr24836.patch
new file mode 100644
index 0000000..3c745ab
--- /dev/null
+++ b/patches/gcc/4.4.0/270-sh-pr24836.patch
@@ -0,0 +1,24 @@
+diff -durN gcc-4.4.0.orig/gcc/configure gcc-4.4.0/gcc/configure
+--- gcc-4.4.0.orig/gcc/configure 2009-05-27 21:38:08.000000000 +0200
++++ gcc-4.4.0/gcc/configure 2009-05-27 21:38:42.000000000 +0200
+@@ -22205,7 +22205,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+diff -durN gcc-4.4.0.orig/gcc/configure.ac gcc-4.4.0/gcc/configure.ac
+--- gcc-4.4.0.orig/gcc/configure.ac 2009-05-27 21:38:08.000000000 +0200
++++ gcc-4.4.0/gcc/configure.ac 2009-05-27 21:38:42.000000000 +0200
+@@ -2673,7 +2673,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
diff --git a/patches/gcc/4.4.0/280-freebsd.patch b/patches/gcc/4.4.0/280-freebsd.patch
new file mode 100644
index 0000000..39d9d0b
--- /dev/null
+++ b/patches/gcc/4.4.0/280-freebsd.patch
@@ -0,0 +1,94 @@
+diff -durN gcc-4.4.0.orig/gcc/config/freebsd-spec.h gcc-4.4.0/gcc/config/freebsd-spec.h
+--- gcc-4.4.0.orig/gcc/config/freebsd-spec.h 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/config/freebsd-spec.h 2009-05-27 21:38:45.000000000 +0200
+@@ -61,6 +61,8 @@
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=bsd"); \
+ builtin_assert ("system=FreeBSD"); \
++ if(!(flag_iso && (c_dialect_cxx () ? cxx_dialect == cxx98 : !flag_isoc99))) \
++ builtin_define("_LONGLONG"); \
+ FBSD_TARGET_CPU_CPP_BUILTINS(); \
+ } \
+ while (0)
+diff -durN gcc-4.4.0.orig/gcc/config/t-freebsd-eh gcc-4.4.0/gcc/config/t-freebsd-eh
+--- gcc-4.4.0.orig/gcc/config/t-freebsd-eh 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.4.0/gcc/config/t-freebsd-eh 2009-05-27 21:38:45.000000000 +0200
+@@ -0,0 +1,4 @@
++# Use unwind-dw2-fde-glibc
++LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
++ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
++LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
+diff -durN gcc-4.4.0.orig/gcc/config.gcc gcc-4.4.0/gcc/config.gcc
+--- gcc-4.4.0.orig/gcc/config.gcc 2009-05-27 21:38:34.000000000 +0200
++++ gcc-4.4.0/gcc/config.gcc 2009-05-27 21:38:45.000000000 +0200
+@@ -456,7 +456,7 @@
+ # pleases around the provided core setting.
+ gas=yes
+ gnu_ld=yes
+- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
+ fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
+ tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
+ tmake_file="t-slibgcc-elf-ver t-freebsd"
+@@ -1042,6 +1042,10 @@
+ ;;
+ i[34567]86-*-freebsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
++ fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
++ if test ${fbsd_major} -ge 7; then
++ tmake_file="${tmake_file} t-freebsd-eh"
++ fi
+ ;;
+ x86_64-*-freebsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
+diff -durN gcc-4.4.0.orig/gcc/crtstuff.c gcc-4.4.0/gcc/crtstuff.c
+--- gcc-4.4.0.orig/gcc/crtstuff.c 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/crtstuff.c 2009-05-27 21:38:45.000000000 +0200
+@@ -85,13 +85,15 @@
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
+- && defined(__GLIBC__) && __GLIBC__ >= 2
++ && ((defined(__GLIBC__) && __GLIBC__ >= 2) \
++ || (defined(__FreeBSD_version) && __FreeBSD_version >= 700022))
+ #include <link.h>
+ /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
+ But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */
+ # if !defined(__UCLIBC__) \
+- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
++ || (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
++ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
++ || (__FreeBSD_version >= 700022)
+ # define USE_PT_GNU_EH_FRAME
+ # endif
+ #endif
+diff -durN gcc-4.4.0.orig/gcc/unwind-dw2-fde-glibc.c gcc-4.4.0/gcc/unwind-dw2-fde-glibc.c
+--- gcc-4.4.0.orig/gcc/unwind-dw2-fde-glibc.c 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/gcc/unwind-dw2-fde-glibc.c 2009-05-27 21:38:45.000000000 +0200
+@@ -46,8 +46,9 @@
+ #include "gthr.h"
+
+ #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
++ && ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
++ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
++ || (__FreeBSD_version >= 700022 ))
+
+ #ifndef __RELOC_POINTER
+ # define __RELOC_POINTER(ptr, base) ((ptr) + (base))
+@@ -63,6 +64,13 @@
+ #define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
+ #endif
+
++/* Support FreeBSD */
++#ifndef ElfW
++# ifdef __ElfN
++# define ElfW __ElfN
++# endif
++#endif
++
+ struct unw_eh_callback_data
+ {
+ _Unwind_Ptr pc;
diff --git a/patches/gcc/4.4.0/290-freebsd.patch b/patches/gcc/4.4.0/290-freebsd.patch
new file mode 100644
index 0000000..ad1564b
--- /dev/null
+++ b/patches/gcc/4.4.0/290-freebsd.patch
@@ -0,0 +1,64 @@
+diff -durN gcc-4.4.0.orig/gcc/config/freebsd-spec.h gcc-4.4.0/gcc/config/freebsd-spec.h
+--- gcc-4.4.0.orig/gcc/config/freebsd-spec.h 2009-05-27 21:38:47.000000000 +0200
++++ gcc-4.4.0/gcc/config/freebsd-spec.h 2009-05-27 21:38:47.000000000 +0200
+@@ -86,9 +86,10 @@
+ #define FBSD_STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ %{!p:%{profile:gcrt1.o%s} \
++ %{!profile:crt1.o%s}}}} \
++ crti.o%s \
++ %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -126,7 +127,8 @@
+ %{pg: -lc_p} \
+ }"
+ #else
+-#if FBSD_MAJOR < 5
++#include <sys/param.h>
++#if __FreeBSD_version < 500016
+ #define FBSD_LIB_SPEC " \
+ %{!shared: \
+ %{!pg: \
+@@ -136,17 +138,34 @@
+ %{!pthread:-lc_p} \
+ %{pthread:-lc_r_p}} \
+ }"
+-#else
++#elif __FreeBSD_version < 700022
+ #define FBSD_LIB_SPEC " \
+ %{!shared: \
+ %{!pg: %{pthread:-lpthread} -lc} \
+ %{pg: %{pthread:-lpthread_p} -lc_p} \
+ }"
++#else
++#define FBSD_LIB_SPEC " \
++ %{!shared: \
++ %{!pg: %{pthread:-lpthread} -lc} \
++ %{pg: %{pthread:-lpthread_p} -lc_p}} \
++ %{shared: \
++ %{pthread:-lpthread} -lc} \
++ "
+ #endif
+ #endif
+
+-#if FBSD_MAJOR < 6
++#if FBSD_MAJOR < 5
+ #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
+ #else
+ #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
+ #endif
++
++#if defined(HAVE_LD_EH_FRAME_HDR)
++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#endif
++
++/* Use --as-needed -lgcc_s for eh support. */
++#ifdef HAVE_LD_AS_NEEDED
++#define USE_LD_AS_NEEDED 1
++#endif
diff --git a/patches/gcc/4.4.0/300-pr40105.patch b/patches/gcc/4.4.0/300-pr40105.patch
new file mode 100644
index 0000000..1acbad6
--- /dev/null
+++ b/patches/gcc/4.4.0/300-pr40105.patch
@@ -0,0 +1,180 @@
+diff -durN gcc-4.4.0.orig/gcc/Makefile.in gcc-4.4.0/gcc/Makefile.in
+--- gcc-4.4.0.orig/gcc/Makefile.in 2009-03-25 13:00:32.000000000 +0100
++++ gcc-4.4.0/gcc/Makefile.in 2009-05-27 21:38:50.000000000 +0200
+@@ -2785,7 +2785,8 @@
+ value-prof.h $(TREE_INLINE_H) $(TARGET_H)
+ cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \
+- output.h $(TOPLEV_H) $(FUNCTION_H) except.h $(TM_P_H) insn-config.h $(EXPR_H) \
++ output.h $(TOPLEV_H) $(FUNCTION_H) except.h $(TM_P_H) $(INSN_ATTR_H) \
++ insn-config.h $(EXPR_H) \
+ $(CFGLAYOUT_H) $(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) \
+ tree-pass.h $(DF_H) $(GGC_H)
+ cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+diff -durN gcc-4.4.0.orig/gcc/cfgrtl.c gcc-4.4.0/gcc/cfgrtl.c
+--- gcc-4.4.0.orig/gcc/cfgrtl.c 2008-12-12 22:16:09.000000000 +0100
++++ gcc-4.4.0/gcc/cfgrtl.c 2009-05-27 21:38:50.000000000 +0200
+@@ -53,6 +53,7 @@
+ #include "toplev.h"
+ #include "tm_p.h"
+ #include "obstack.h"
++#include "insn-attr.h"
+ #include "insn-config.h"
+ #include "cfglayout.h"
+ #include "expr.h"
+@@ -427,13 +428,27 @@
+ return 0;
+ }
+
++static unsigned int
++rest_of_pass_free_cfg (void)
++{
++#ifdef DELAY_SLOTS
++ /* The resource.c machinery uses DF but the CFG isn't guaranteed to be
++ valid at that point so it would be too late to call df_analyze. */
++ if (optimize > 0 && flag_delayed_branch)
++ df_analyze ();
++#endif
++
++ free_bb_for_insn ();
++ return 0;
++}
++
+ struct rtl_opt_pass pass_free_cfg =
+ {
+ {
+ RTL_PASS,
+ NULL, /* name */
+ NULL, /* gate */
+- free_bb_for_insn, /* execute */
++ rest_of_pass_free_cfg, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+diff -durN gcc-4.4.0.orig/gcc/resource.c gcc-4.4.0/gcc/resource.c
+--- gcc-4.4.0.orig/gcc/resource.c 2009-02-20 16:20:38.000000000 +0100
++++ gcc-4.4.0/gcc/resource.c 2009-05-27 21:38:50.000000000 +0200
+@@ -135,8 +135,6 @@
+ static int
+ find_basic_block (rtx insn, int search_limit)
+ {
+- basic_block bb;
+-
+ /* Scan backwards to the previous BARRIER. Then see if we can find a
+ label that starts a basic block. Return the basic block number. */
+ for (insn = prev_nonnote_insn (insn);
+@@ -157,11 +155,8 @@
+ for (insn = next_nonnote_insn (insn);
+ insn && LABEL_P (insn);
+ insn = next_nonnote_insn (insn))
+- {
+- FOR_EACH_BB (bb)
+- if (insn == BB_HEAD (bb))
+- return bb->index;
+- }
++ if (BLOCK_FOR_INSN (insn))
++ return BLOCK_FOR_INSN (insn)->index;
+
+ return -1;
+ }
+@@ -848,13 +843,12 @@
+ (with no intervening active insns) to see if any of them start a basic
+ block. If we hit the start of the function first, we use block 0.
+
+- Once we have found a basic block and a corresponding first insns, we can
+- accurately compute the live status from basic_block_live_regs and
+- reg_renumber. (By starting at a label following a BARRIER, we are immune
+- to actions taken by reload and jump.) Then we scan all insns between
+- that point and our target. For each CLOBBER (or for call-clobbered regs
+- when we pass a CALL_INSN), mark the appropriate registers are dead. For
+- a SET, mark them as live.
++ Once we have found a basic block and a corresponding first insn, we can
++ accurately compute the live status (by starting at a label following a
++ BARRIER, we are immune to actions taken by reload and jump.) Then we
++ scan all insns between that point and our target. For each CLOBBER (or
++ for call-clobbered regs when we pass a CALL_INSN), mark the appropriate
++ registers are dead. For a SET, mark them as live.
+
+ We have to be careful when using REG_DEAD notes because they are not
+ updated by such things as find_equiv_reg. So keep track of registers
+@@ -954,13 +948,10 @@
+ TARGET. Otherwise, we must assume everything is live. */
+ if (b != -1)
+ {
+- regset regs_live = DF_LR_IN (BASIC_BLOCK (b));
++ regset regs_live = df_get_live_in (BASIC_BLOCK (b));
+ rtx start_insn, stop_insn;
+
+- /* Compute hard regs live at start of block -- this is the real hard regs
+- marked live, plus live pseudo regs that have been renumbered to
+- hard regs. */
+-
++ /* Compute hard regs live at start of block. */
+ REG_SET_TO_HARD_REG_SET (current_live_regs, regs_live);
+
+ /* Get starting and ending insn, handling the case where each might
+@@ -1046,10 +1037,24 @@
+
+ else if (LABEL_P (real_insn))
+ {
++ basic_block bb;
++
+ /* A label clobbers the pending dead registers since neither
+ reload nor jump will propagate a value across a label. */
+ AND_COMPL_HARD_REG_SET (current_live_regs, pending_dead_regs);
+ CLEAR_HARD_REG_SET (pending_dead_regs);
++
++ /* We must conservatively assume that all registers that used
++ to be live here still are. The fallthrough edge may have
++ left a live register uninitialized. */
++ bb = BLOCK_FOR_INSN (real_insn);
++ if (bb)
++ {
++ HARD_REG_SET extra_live;
++
++ REG_SET_TO_HARD_REG_SET (extra_live, df_get_live_in (bb));
++ IOR_HARD_REG_SET (current_live_regs, extra_live);
++ }
+ }
+
+ /* The beginning of the epilogue corresponds to the end of the
+@@ -1121,6 +1126,7 @@
+ init_resource_info (rtx epilogue_insn)
+ {
+ int i;
++ basic_block bb;
+
+ /* Indicate what resources are required to be valid at the end of the current
+ function. The condition code never is and memory always is. If the
+@@ -1189,6 +1195,11 @@
+ /* Allocate and initialize the tables used by mark_target_live_regs. */
+ target_hash_table = XCNEWVEC (struct target_info *, TARGET_HASH_PRIME);
+ bb_ticks = XCNEWVEC (int, last_basic_block);
++
++ /* Set the BLOCK_FOR_INSN of each label that starts a basic block. */
++ FOR_EACH_BB (bb)
++ if (LABEL_P (BB_HEAD (bb)))
++ BLOCK_FOR_INSN (BB_HEAD (bb)) = bb;
+ }
+
+ /* Free up the resources allocated to mark_target_live_regs (). This
+@@ -1197,6 +1208,8 @@
+ void
+ free_resource_info (void)
+ {
++ basic_block bb;
++
+ if (target_hash_table != NULL)
+ {
+ int i;
+@@ -1222,6 +1235,10 @@
+ free (bb_ticks);
+ bb_ticks = NULL;
+ }
++
++ FOR_EACH_BB (bb)
++ if (LABEL_P (BB_HEAD (bb)))
++ BLOCK_FOR_INSN (BB_HEAD (bb)) = NULL;
+ }
+
+ /* Clear any hashed information that we have stored for INSN. */
diff --git a/patches/gcc/4.4.0/310-uclibc-conf.patch b/patches/gcc/4.4.0/310-uclibc-conf.patch
new file mode 100644
index 0000000..e3f3b91
--- /dev/null
+++ b/patches/gcc/4.4.0/310-uclibc-conf.patch
@@ -0,0 +1,35 @@
+diff -durN gcc-4.4.0.orig/contrib/regression/objs-gcc.sh gcc-4.4.0/contrib/regression/objs-gcc.sh
+--- gcc-4.4.0.orig/contrib/regression/objs-gcc.sh 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/contrib/regression/objs-gcc.sh 2009-05-27 21:38:53.000000000 +0200
+@@ -106,6 +106,10 @@
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+diff -durN gcc-4.4.0.orig/libjava/classpath/ltconfig gcc-4.4.0/libjava/classpath/ltconfig
+--- gcc-4.4.0.orig/libjava/classpath/ltconfig 2007-06-04 01:18:43.000000000 +0200
++++ gcc-4.4.0/libjava/classpath/ltconfig 2009-05-27 21:38:53.000000000 +0200
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1251,7 +1251,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/patches/gcc/4.4.0/320-missing-execinfo_h.patch b/patches/gcc/4.4.0/320-missing-execinfo_h.patch
new file mode 100644
index 0000000..009335e
--- /dev/null
+++ b/patches/gcc/4.4.0/320-missing-execinfo_h.patch
@@ -0,0 +1,12 @@
+diff -durN gcc-4.4.0.orig/boehm-gc/include/gc.h gcc-4.4.0/boehm-gc/include/gc.h
+--- gcc-4.4.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
++++ gcc-4.4.0/boehm-gc/include/gc.h 2009-05-27 21:38:55.000000000 +0200
+@@ -503,7 +503,7 @@
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/patches/gcc/4.4.0/330-c99-snprintf.patch b/patches/gcc/4.4.0/330-c99-snprintf.patch
new file mode 100644
index 0000000..4928f4b
--- /dev/null
+++ b/patches/gcc/4.4.0/330-c99-snprintf.patch
@@ -0,0 +1,12 @@
+diff -durN gcc-4.4.0.orig/libstdc++-v3/include/c_global/cstdio gcc-4.4.0/libstdc++-v3/include/c_global/cstdio
+--- gcc-4.4.0.orig/libstdc++-v3/include/c_global/cstdio 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/libstdc++-v3/include/c_global/cstdio 2009-05-27 21:38:58.000000000 +0200
+@@ -139,7 +139,7 @@
+
+ _GLIBCXX_END_NAMESPACE
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/patches/gcc/4.4.0/340-libmudflap-susv3-legacy.patch b/patches/gcc/4.4.0/340-libmudflap-susv3-legacy.patch
new file mode 100644
index 0000000..f3a4e32
--- /dev/null
+++ b/patches/gcc/4.4.0/340-libmudflap-susv3-legacy.patch
@@ -0,0 +1,48 @@
+diff -durN gcc-4.4.0.orig/libmudflap/mf-hooks2.c gcc-4.4.0/libmudflap/mf-hooks2.c
+--- gcc-4.4.0.orig/libmudflap/mf-hooks2.c 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.0/libmudflap/mf-hooks2.c 2009-05-27 21:39:00.000000000 +0200
+@@ -421,7 +421,7 @@
+ {
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+- bzero (s, n);
++ memset (s, 0, n);
+ }
+
+
+@@ -431,7 +431,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);
+ }
+
+
+@@ -441,7 +441,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);
+ }
+
+
+@@ -450,7 +450,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);
+ }
+
+
+@@ -459,7 +459,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 */
diff --git a/patches/glibc/2.9/560-syslog.patch b/patches/glibc/2.9/560-syslog.patch
new file mode 100644
index 0000000..c20cafc
--- /dev/null
+++ b/patches/glibc/2.9/560-syslog.patch
@@ -0,0 +1,12 @@
+diff -durN glibc-cvs-2.9.orig/misc/syslog.c glibc-cvs-2.9/misc/syslog.c
+--- glibc-cvs-2.9.orig/misc/syslog.c 2009-06-01 10:16:50.000000000 +0200
++++ glibc-cvs-2.9/misc/syslog.c 2009-06-01 10:17:20.000000000 +0200
+@@ -152,7 +152,7 @@
+ #define INTERNALLOG LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID
+ /* Check for invalid bits. */
+ if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
+- syslog(INTERNALLOG,
++ __syslog(INTERNALLOG,
+ "syslog: unknown facility/priority: %x", pri);
+ pri &= LOG_PRIMASK|LOG_FACMASK;
+ }
diff --git a/patches/glibc/2.9/570-debug-readlink_chk-readklinkat_chk.patch b/patches/glibc/2.9/570-debug-readlink_chk-readklinkat_chk.patch
new file mode 100644
index 0000000..a5a7052
--- /dev/null
+++ b/patches/glibc/2.9/570-debug-readlink_chk-readklinkat_chk.patch
@@ -0,0 +1,24 @@
+diff -dur glibc-cvs-2.9.orig/debug/readlink_chk.c glibc-cvs-2.9/debug/readlink_chk.c
+--- glibc-cvs-2.9.orig/debug/readlink_chk.c 2005-03-01 01:41:15.000000000 +0100
++++ glibc-cvs-2.9/debug/readlink_chk.c 2009-06-01 10:59:37.000000000 +0200
+@@ -25,7 +25,7 @@
+
+
+ ssize_t
+-__readlink_chk (const char *path, void *buf, size_t len, size_t buflen)
++__readlink_chk (const char *path, char *buf, size_t len, size_t buflen)
+ {
+ if (len > buflen)
+ __chk_fail ();
+diff -dur glibc-cvs-2.9.orig/debug/readlinkat_chk.c glibc-cvs-2.9/debug/readlinkat_chk.c
+--- glibc-cvs-2.9.orig/debug/readlinkat_chk.c 2006-04-24 18:56:12.000000000 +0200
++++ glibc-cvs-2.9/debug/readlinkat_chk.c 2009-06-01 11:07:26.000000000 +0200
+@@ -21,7 +21,7 @@
+
+
+ ssize_t
+-__readlinkat_chk (int fd, const char *path, void *buf, size_t len,
++__readlinkat_chk (int fd, const char *path, char *buf, size_t len,
+ size_t buflen)
+ {
+ if (len > buflen)
diff --git a/patches/gmp/4.3.1/100-multiplicity-that-does-not-fit-an-int.patch b/patches/gmp/4.3.1/100-multiplicity-that-does-not-fit-an-int.patch
new file mode 100644
index 0000000..f60e88f
--- /dev/null
+++ b/patches/gmp/4.3.1/100-multiplicity-that-does-not-fit-an-int.patch
@@ -0,0 +1,33 @@
+diff --git a/mpz/remove.c b/mpz/remove.c
+--- a/mpz/remove.c
++++ b/mpz/remove.c
+@@ -23,7 +23,7 @@
+ unsigned long int
+ mpz_remove (mpz_ptr dest, mpz_srcptr src, mpz_srcptr f)
+ {
+- mpz_t fpow[40]; /* inexhaustible...until year 2020 or so */
++ mpz_t fpow[GMP_LIMB_BITS]; /* Really MP_SIZE_T_BITS */
+ mpz_t x, rem;
+ unsigned long int pwr;
+ int p;
+@@ -69,7 +69,7 @@
+ mpz_set (dest, x);
+ }
+
+- pwr = (1 << p) - 1;
++ pwr = (1L << p) - 1;
+
+ mpz_clear (fpow[p]);
+
+diff --git a/mpz/remove.c b/mpz/remove.c
+--- a/mpz/remove.c
++++ b/mpz/remove.c
+@@ -80,7 +80,7 @@
+ mpz_tdiv_qr (x, rem, dest, fpow[p]);
+ if (SIZ (rem) == 0)
+ {
+- pwr += 1 << p;
++ pwr += 1L << p;
+ mpz_set (dest, x);
+ }
+ mpz_clear (fpow[p]);
diff --git a/patches/gmp/4.3.1/110-unbounded-alloc.patch b/patches/gmp/4.3.1/110-unbounded-alloc.patch
new file mode 100644
index 0000000..78e0588
--- /dev/null
+++ b/patches/gmp/4.3.1/110-unbounded-alloc.patch
@@ -0,0 +1,31 @@
+diff --git a/mpn/generic/toom44_mul.c b/mpn/generic/toom44_mul.c
+--- a/mpn/generic/toom44_mul.c
++++ b/mpn/generic/toom44_mul.c
+@@ -116,17 +116,16 @@
+
+ TMP_MARK;
+
+- as1 = TMP_SALLOC_LIMBS (n + 1);
+- asm1 = TMP_SALLOC_LIMBS (n + 1);
+- as2 = TMP_SALLOC_LIMBS (n + 1);
+- ash = TMP_SALLOC_LIMBS (n + 1);
+- asmh = TMP_SALLOC_LIMBS (n + 1);
+-
+- bs1 = TMP_SALLOC_LIMBS (n + 1);
+- bsm1 = TMP_SALLOC_LIMBS (n + 1);
+- bs2 = TMP_SALLOC_LIMBS (n + 1);
+- bsh = TMP_SALLOC_LIMBS (n + 1);
+- bsmh = TMP_SALLOC_LIMBS (n + 1);
++ as1 = TMP_ALLOC_LIMBS (10 * n + 10);
++ asm1 = as1 + n + 1;
++ as2 = asm1 + n + 1;
++ ash = as2 + n + 1;
++ asmh = ash + n + 1;
++ bs1 = asmh + n + 1;
++ bsm1 = bs1 + n + 1;
++ bs2 = bsm1 + n + 1;
++ bsh = bs2 + n + 1;
++ bsmh = bsh + n + 1;
+
+ gp = pp;
+ hp = pp + n + 1;
diff --git a/patches/libelf/0.8.11/100-fix-64-bit-detection.patch b/patches/libelf/0.8.11/100-fix-64-bit-detection.patch
new file mode 100644
index 0000000..7995443
--- /dev/null
+++ b/patches/libelf/0.8.11/100-fix-64-bit-detection.patch
@@ -0,0 +1,24 @@
+diff -dur libelf-0.8.10.orig/configure libelf-0.8.10/configure
+--- libelf-0.8.10.orig/configure 2007-09-07 14:08:06.000000000 +0200
++++ libelf-0.8.10/configure 2008-10-23 22:43:19.000000000 +0200
+@@ -1595,7 +1595,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test "$cross_compiling" = yes; then
+- ac_cv_sizeof_long_long=0
++ ac_cv_sizeof_long_long=8
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 1602 "configure"
+diff -dur libelf-0.8.10.orig/configure.in libelf-0.8.10/configure.in
+--- libelf-0.8.10.orig/configure.in 2007-09-07 14:07:59.000000000 +0200
++++ libelf-0.8.10/configure.in 2008-10-23 22:43:10.000000000 +0200
+@@ -90,7 +90,7 @@
+ AC_CHECK_SIZEOF(short,2)
+ AC_CHECK_SIZEOF(int,4)
+ AC_CHECK_SIZEOF(long,4)
+-AC_CHECK_SIZEOF(long long,0)
++AC_CHECK_SIZEOF(long long,8)
+ # Windows port
+ AC_CHECK_SIZEOF(__int64, 0)
+
diff --git a/patches/ltrace/0.5.2/100-allow-cross-compile.patch b/patches/ltrace/0.5.2/100-allow-cross-compile.patch
new file mode 100644
index 0000000..10440ad
--- /dev/null
+++ b/patches/ltrace/0.5.2/100-allow-cross-compile.patch
@@ -0,0 +1,77 @@
+diff -durN ltrace-0.5.2.orig/Makefile.in ltrace-0.5.2/Makefile.in
+--- ltrace-0.5.2.orig/Makefile.in 2009-05-21 19:14:54.000000000 +0200
++++ ltrace-0.5.2/Makefile.in 2009-06-27 15:30:34.000000000 +0200
+@@ -2,8 +2,14 @@
+ # ltrace's Makefile.in
+ #
+
+-#OS := $(shell uname -s)
+ OS := @HOST_OS@
++ARCH := $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/ \
++ -e s/sun4u/sparc64/ \
++ -e s/arm.*/arm/ \
++ -e s/sa110/arm/ \
++ -e s/ppc64/ppc/ \
++ -e s/s390x/s390/)
++export ARCH
+
+ TOPDIR = $(shell pwd)
+
+diff -durN ltrace-0.5.2.orig/configure ltrace-0.5.2/configure
+--- ltrace-0.5.2.orig/configure 2009-05-21 19:14:57.000000000 +0200
++++ ltrace-0.5.2/configure 2009-06-27 15:30:34.000000000 +0200
+@@ -660,6 +660,7 @@
+ host_cpu
+ host_vendor
+ host_os
++HOST_ARCH
+ HOST_OS
+ CC
+ CFLAGS
+@@ -1823,6 +1824,7 @@
+ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
++HOST_ARCH="$host_cpu"
+ case "$host_os" in
+ linux-gnu*) host_os=linux-gnu
+ esac
+@@ -5406,6 +5408,7 @@
+ host_cpu!$host_cpu$ac_delim
+ host_vendor!$host_vendor$ac_delim
+ host_os!$host_os$ac_delim
++HOST_ARCH!$HOST_ARCH$ac_delim
+ HOST_OS!$HOST_OS$ac_delim
+ CC!$CC$ac_delim
+ CFLAGS!$CFLAGS$ac_delim
+@@ -5426,7 +5429,7 @@
+ LTLIBOBJS!$LTLIBOBJS$ac_delim
+ _ACEOF
+
+- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 63; then
++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 64; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+diff -durN ltrace-0.5.2.orig/configure.ac ltrace-0.5.2/configure.ac
+--- ltrace-0.5.2.orig/configure.ac 2009-05-21 19:14:54.000000000 +0200
++++ ltrace-0.5.2/configure.ac 2009-06-27 15:30:34.000000000 +0200
+@@ -11,6 +11,8 @@
+ esac
+ HOST_OS="$host_os"
+ AC_SUBST(HOST_OS)
++HOST_ARCH="$host_cpu"
++AC_SUBST(HOST_ARCH)
+
+ dnl Checks for programs.
+ AC_PROG_CC
+diff -durN ltrace-0.5.2.orig/sysdeps/linux-gnu/Makefile ltrace-0.5.2/sysdeps/linux-gnu/Makefile
+--- ltrace-0.5.2.orig/sysdeps/linux-gnu/Makefile 2009-05-21 19:14:54.000000000 +0200
++++ ltrace-0.5.2/sysdeps/linux-gnu/Makefile 2009-06-27 15:30:34.000000000 +0200
+@@ -1,6 +1,3 @@
+-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+- -e s/arm.*/arm/ -e s/sa110/arm/ -e s/ppc64/ppc/ -e s/s390x/s390/)
+-
+ CPPFLAGS += -I$(TOPDIR)/sysdeps/linux-gnu/$(ARCH)
+
+ OBJ = events.o trace.o proc.o breakpoint.o
diff --git a/patches/ltrace/0.5.2/110-alpha-support.patch b/patches/ltrace/0.5.2/110-alpha-support.patch
new file mode 100644
index 0000000..f121ca1
--- /dev/null
+++ b/patches/ltrace/0.5.2/110-alpha-support.patch
@@ -0,0 +1,11 @@
+diff -durN ltrace-0.5.2.orig/Makefile.in ltrace-0.5.2/Makefile.in
+--- ltrace-0.5.2.orig/Makefile.in 2009-06-27 15:34:04.000000000 +0200
++++ ltrace-0.5.2/Makefile.in 2009-06-27 15:34:27.000000000 +0200
+@@ -5,6 +5,7 @@
+ OS := @HOST_OS@
+ ARCH := $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/ \
+ -e s/sun4u/sparc64/ \
++ -e s/alpha.*/alpha/ \
+ -e s/arm.*/arm/ \
+ -e s/sa110/arm/ \
+ -e s/ppc64/ppc/ \
diff --git a/patches/ltrace/0.5.2/120-debian-ltrace-0.5.2-2.patch b/patches/ltrace/0.5.2/120-debian-ltrace-0.5.2-2.patch
new file mode 100644
index 0000000..6d62315
--- /dev/null
+++ b/patches/ltrace/0.5.2/120-debian-ltrace-0.5.2-2.patch
@@ -0,0 +1,240 @@
+--- ltrace-0.5.2.orig/TODO
++++ ltrace-0.5.2/TODO
+@@ -37,3 +37,4 @@
+ * debug: change "-d" option to be something like "-d elf,events", or "-d breakpoints"
+ * Find out if a process is sharing memory with its parent?
+ * When using -p, find out if that process is sharing memory with other procs
++* After a clone(), syscalls may be seen as sysrets in s390 (see trace.c:syscall_p())
+--- ltrace-0.5.2.orig/process_event.c
++++ ltrace-0.5.2/process_event.c
+@@ -170,7 +170,7 @@
+ enable_breakpoint(proc->pid, proc->breakpoint_being_enabled);
+ proc->breakpoint_being_enabled = NULL;
+ }
+- if (proc->parent->state == STATE_ATTACHED && options.follow) {
++ if (options.follow) {
+ proc->state = STATE_ATTACHED;
+ } else {
+ proc->state = STATE_IGNORED;
+--- ltrace-0.5.2.orig/sysdeps/linux-gnu/ppc/trace.c
++++ ltrace-0.5.2/sysdeps/linux-gnu/ppc/trace.c
+@@ -50,9 +50,9 @@
+ *sysnum =
+ (int)ptrace(PTRACE_PEEKUSER, proc->pid,
+ sizeof(long) * PT_R0, 0);
+- if (proc->callstack_depth > 0
+- && proc->callstack[proc->callstack_depth -
+- 1].is_syscall) {
++ if (proc->callstack_depth > 0 &&
++ proc->callstack[proc->callstack_depth - 1].is_syscall &&
++ proc->callstack[proc->callstack_depth - 1].c_un.syscall == *sysnum) {
+ return 2;
+ }
+ return 1;
+--- ltrace-0.5.2.orig/sysdeps/linux-gnu/i386/trace.c
++++ ltrace-0.5.2/sysdeps/linux-gnu/i386/trace.c
+@@ -32,7 +32,8 @@
+ *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, 4 * ORIG_EAX, 0);
+
+ if (proc->callstack_depth > 0 &&
+- proc->callstack[proc->callstack_depth - 1].is_syscall) {
++ proc->callstack[proc->callstack_depth - 1].is_syscall &&
++ proc->callstack[proc->callstack_depth - 1].c_un.syscall == *sysnum) {
+ return 2;
+ }
+
+--- ltrace-0.5.2.orig/sysdeps/linux-gnu/ia64/trace.c
++++ ltrace-0.5.2/sysdeps/linux-gnu/ia64/trace.c
+@@ -106,8 +106,8 @@
+ if (insn == 0x1000000000 || insn == 0x1ffffffffff) {
+ *sysnum = r15;
+ if (proc->callstack_depth > 0 &&
+- proc->callstack[proc->callstack_depth -
+- 1].is_syscall) {
++ proc->callstack[proc->callstack_depth - 1].is_syscall &&
++ proc->callstack[proc->callstack_depth - 1].c_un.syscall == *sysnum) {
+ return 2;
+ }
+ return 1;
+--- ltrace-0.5.2.orig/sysdeps/linux-gnu/m68k/trace.c
++++ ltrace-0.5.2/sysdeps/linux-gnu/m68k/trace.c
+@@ -36,9 +36,8 @@
+ if (*sysnum >= 0) {
+ depth = proc->callstack_depth;
+ if (depth > 0 &&
+- proc->callstack[depth - 1].is_syscall &&
+- proc->callstack[depth - 1].c_un.syscall ==
+- *sysnum) {
++ proc->callstack[depth - 1].is_syscall &&
++ proc->callstack[depth - 1].c_un.syscall == *sysnum) {
+ return 2;
+ } else {
+ return 1;
+--- ltrace-0.5.2.orig/sysdeps/linux-gnu/alpha/trace.c
++++ ltrace-0.5.2/sysdeps/linux-gnu/alpha/trace.c
+@@ -36,8 +36,9 @@
+ return 0;
+ *sysnum =
+ ptrace(PTRACE_PEEKUSER, proc->pid, 0 /* REG_R0 */ , 0);
+- if (proc->callstack_depth > 0
+- && proc->callstack[proc->callstack_depth - 1].is_syscall) {
++ if (proc->callstack_depth > 0 &&
++ proc->callstack[proc->callstack_depth - 1].is_syscall &&
++ proc->callstack[proc->callstack_depth - 1].c_un.syscall == *sysnum) {
+ return 2;
+ }
+ if (*sysnum >= 0 && *sysnum < 500) {
+--- ltrace-0.5.2.orig/sysdeps/linux-gnu/sparc/trace.c
++++ ltrace-0.5.2/sysdeps/linux-gnu/sparc/trace.c
+@@ -33,9 +33,9 @@
+ insn = ptrace(PTRACE_PEEKTEXT, proc->pid, ip, 0);
+ if ((insn & 0xc1f8007f) == 0x81d00010) {
+ *sysnum = ((proc_archdep *) proc->arch_ptr)->regs.r_g1;
+- if ((proc->callstack_depth > 0)
+- && proc->callstack[proc->callstack_depth -
+- 1].is_syscall) {
++ if (proc->callstack_depth > 0 &&
++ proc->callstack[proc->callstack_depth - 1].is_syscall &&
++ proc->callstack[proc->callstack_depth - 1].c_un.syscall == *sysnum) {
+ return 2;
+ } else if (*sysnum >= 0) {
+ return 1;
+--- ltrace-0.5.2.orig/sysdeps/linux-gnu/mipsel/trace.c
++++ ltrace-0.5.2/sysdeps/linux-gnu/mipsel/trace.c
+@@ -60,33 +60,34 @@
+ int
+ syscall_p(Process *proc, int status, int *sysnum) {
+ if (WIFSTOPPED(status)
+- && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
+- /* get the user's pc (plus 8) */
+- long pc = (long)get_instruction_pointer(proc);
+- /* fetch the SWI instruction */
+- int insn = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 4, 0);
+- int num = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 8, 0);
+-
+-/*
+- On a mipsel, syscall looks like:
+- 24040fa1 li v0, 0x0fa1 # 4001 --> _exit syscall
+- 0000000c syscall
+- */
+- if(insn!=0x0000000c){
+- return 0;
+- }
+-
+- *sysnum = (num & 0xFFFF) - 4000;
+- /* if it is a syscall, return 1 or 2 */
+- if (proc->callstack_depth > 0 &&
+- proc->callstack[proc->callstack_depth - 1].is_syscall) {
+- return 2;
+- }
+-
+- if (*sysnum >= 0) {
+- return 1;
+- }
+- }
++ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
++ /* get the user's pc (plus 8) */
++ long pc = (long)get_instruction_pointer(proc);
++ /* fetch the SWI instruction */
++ int insn = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 4, 0);
++ int num = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 8, 0);
++
++ /*
++ On a mipsel, syscall looks like:
++ 24040fa1 li v0, 0x0fa1 # 4001 --> _exit syscall
++ 0000000c syscall
++ */
++ if(insn!=0x0000000c){
++ return 0;
++ }
++
++ *sysnum = (num & 0xFFFF) - 4000;
++ /* if it is a syscall, return 1 or 2 */
++ if (proc->callstack_depth > 0 &&
++ proc->callstack[proc->callstack_depth - 1].is_syscall &&
++ proc->callstack[proc->callstack_depth - 1].c_un.syscall == *sysnum) {
++ return 2;
++ }
++
++ if (*sysnum >= 0) {
++ return 1;
++ }
++ }
+ return 0;
+ }
+ /**
+@@ -119,34 +120,34 @@
+ */
+ long
+ gimme_arg(enum tof type, Process *proc, int arg_num, arg_type_info *info) {
+- long ret;
+- debug(2,"type %d arg %d",type,arg_num);
+- if (type == LT_TOF_FUNCTION || type == LT_TOF_SYSCALL){
+- if(arg_num <4){
+- ret=ptrace(PTRACE_PEEKUSER,proc->pid,off_a0+arg_num,0);
+- debug(2,"ret = %#lx",ret);
+- return ret;
+- } else {
+- // If we need this, I think we can look at [sp+16] for arg_num==4.
+- CP;
+- return 0;
+- }
+- }
+- if(arg_num>=0){
+- fprintf(stderr,"args on return?");
+- }
+- if(type == LT_TOF_FUNCTIONR) {
+- return ptrace(PTRACE_PEEKUSER,proc->pid,off_v0,0);
+- }
+- if (type == LT_TOF_SYSCALLR) {
+- unsigned a3=ptrace(PTRACE_PEEKUSER, proc->pid,off_a3,0);
+- unsigned v0=ptrace(PTRACE_PEEKUSER, proc->pid,off_v0,0);
+- if(!a3){
+- return v0;
+- }
+- return -1;
+- }
+- fprintf(stderr, "gimme_arg called with wrong arguments\n");
++ long ret;
++ debug(2,"type %d arg %d",type,arg_num);
++ if (type == LT_TOF_FUNCTION || type == LT_TOF_SYSCALL){
++ if(arg_num <4){
++ ret=ptrace(PTRACE_PEEKUSER,proc->pid,off_a0+arg_num,0);
++ debug(2,"ret = %#lx",ret);
++ return ret;
++ } else {
++ // If we need this, I think we can look at [sp+16] for arg_num==4.
++ CP;
++ return 0;
++ }
++ }
++ if(arg_num>=0){
++ fprintf(stderr,"args on return?");
++ }
++ if(type == LT_TOF_FUNCTIONR) {
++ return ptrace(PTRACE_PEEKUSER,proc->pid,off_v0,0);
++ }
++ if (type == LT_TOF_SYSCALLR) {
++ unsigned a3=ptrace(PTRACE_PEEKUSER, proc->pid,off_a3,0);
++ unsigned v0=ptrace(PTRACE_PEEKUSER, proc->pid,off_v0,0);
++ if(!a3){
++ return v0;
++ }
++ return -1;
++ }
++ fprintf(stderr, "gimme_arg called with wrong arguments\n");
+ return 0;
+ }
+
+--- ltrace-0.5.2.orig/sysdeps/linux-gnu/x86_64/trace.c
++++ ltrace-0.5.2/sysdeps/linux-gnu/x86_64/trace.c
+@@ -41,7 +41,8 @@
+ *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, 8 * ORIG_RAX, 0);
+
+ if (proc->callstack_depth > 0 &&
+- proc->callstack[proc->callstack_depth - 1].is_syscall) {
++ proc->callstack[proc->callstack_depth - 1].is_syscall &&
++ proc->callstack[proc->callstack_depth - 1].c_un.syscall == *sysnum) {
+ return 2;
+ }
+
diff --git a/patches/mpfr/2.4.1/150-test-tmul.patch b/patches/mpfr/2.4.1/150-test-tmul.patch
new file mode 100644
index 0000000..8b757d3
--- /dev/null
+++ b/patches/mpfr/2.4.1/150-test-tmul.patch
@@ -0,0 +1,40 @@
+diff -up ./tests/Makefile.am.orig ./tests/Makefile.am
+--- ./tests/Makefile.am.orig 2009-07-28 16:28:55.377059021 +0300
++++ ./tests/Makefile.am 2009-07-28 16:31:01.136810734 +0300
+@@ -20,7 +20,7 @@ check_PROGRAMS = tversion tinternals tin
+
+ EXTRA_DIST = tgeneric.c tgeneric_ui.c mpf_compat.h inp_str.data tmul.dat
+
+-tmul_CPPFLAGS = -DMPFR_SRCDIR=$(srcdir)
++tmul_CPPFLAGS = -DMPFR_SRCDIR=\"$(srcdir)\"
+
+ LDADD = libfrtests.la $(MPFR_LIBM) $(top_builddir)/libmpfr.la
+ INCLUDES = -I$(top_srcdir) -I$(top_builddir)
+diff -up ./tests/tmul.c.orig ./tests/tmul.c
+--- ./tests/tmul.c.orig 2009-07-28 16:29:03.761058919 +0300
++++ ./tests/tmul.c 2009-07-28 16:30:46.369812215 +0300
+@@ -26,10 +26,8 @@ MA 02110-1301, USA. */
+ #include "mpfr-test.h"
+
+ #ifndef MPFR_SRCDIR
+-#define MPFR_SRCDIR .
++#define MPFR_SRCDIR "."
+ #endif
+-#define QUOTE(X) NAME(X)
+-#define NAME(X) #X
+
+ #ifdef CHECK_EXTERNAL
+ static int
+@@ -482,10 +480,10 @@ check_regression (void)
+ mpfr_inits2 (6177, x, y, z, (mpfr_ptr) 0);
+ /* we read long strings from a file since ISO C90 does not support strings of
+ length > 509 */
+- fp = fopen (QUOTE (MPFR_SRCDIR)"/tmul.dat", "r");
++ fp = fopen (MPFR_SRCDIR "/tmul.dat", "r");
+ if (fp == NULL)
+ {
+- fprintf (stderr, "Error, cannot open "QUOTE (MPFR_SRCDIR)"/tmul.dat\n");
++ fprintf (stderr, "Error, cannot open " MPFR_SRCDIR "/tmul.dat\n");
+ exit (1);
+ }
+ get_string (s, fp);
diff --git a/patches/strace/4.5.18/180-arm-EABI-syscalls.patch b/patches/strace/4.5.18/180-arm-EABI-syscalls.patch
new file mode 100644
index 0000000..1f28450
--- /dev/null
+++ b/patches/strace/4.5.18/180-arm-EABI-syscalls.patch
@@ -0,0 +1,23 @@
+Patch from upstream:
+http://strace.cvs.sourceforge.net/viewvc/strace/strace/linux/arm/syscallent.h?r1=1.17&r2=1.18&sortby=file
+
+2008-11-13 Kirill A. Shutemov <kirill@shutemov.name>
+
+ * linux/arm/syscallent.h: Fix build on ARM EABI which does not
+ provide syscalls socketcall and ipc.
+
+--- strace-4.5.18.orig/linux/arm/syscallent.h 2008/12/29 20:04:15 1.17
++++ strace-4.5.18/linux/arm/syscallent.h 2009/01/01 23:20:38 1.18
+@@ -431,6 +431,7 @@
+ { 5, 0, printargs, "SYS_398" }, /* 398 */
+ { 5, 0, printargs, "SYS_399" }, /* 399 */
+
++#ifndef __ARM_EABI__
+ #if SYS_socket_subcall != 400
+ #error fix me
+ #endif
+@@ -481,3 +482,4 @@
+ { 4, TI, sys_shmdt, "shmdt" }, /* 440 */
+ { 4, TI, sys_shmget, "shmget" }, /* 441 */
+ { 4, TI, sys_shmctl, "shmctl" }, /* 442 */
++#endif
diff --git a/samples/arm-beagle-linux-gnueabi/crosstool.config b/samples/arm-beagle-linux-gnueabi/crosstool.config
new file mode 100644
index 0000000..4d8e999
--- /dev/null
+++ b/samples/arm-beagle-linux-gnueabi/crosstool.config
@@ -0,0 +1,406 @@
+#
+# Automatically generated make config: don't edit
+# crosstool-NG version: svn_trunk@1549M
+# Sun May 24 18:20:58 2009
+#
+
+#
+# Paths and misc options
+#
+
+#
+# crosstool-NG behavior
+#
+# CT_OBSOLETE is not set
+# CT_EXPERIMENTAL is not set
+# CT_DEBUG_CT is not set
+
+#
+# Paths
+#
+CT_LOCAL_TARBALLS_DIR="${HOME}/src"
+CT_SAVE_TARBALLS=y
+CT_WORK_DIR="${CT_TOP_DIR}/targets"
+CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
+CT_INSTALL_DIR="${CT_PREFIX_DIR}"
+# CT_CUSTOM_PATCH is not set
+# CT_REMOVE_DOCS is not set
+CT_INSTALL_DIR_RO=y
+
+#
+# Downloading
+#
+# CT_FORBID_DOWNLOAD is not set
+# CT_FORCE_DOWNLOAD is not set
+CT_USE_MIRROR=y
+# CT_PREFER_MIRROR is not set
+CT_MIRROR_BASE_URL="http://ymorin.is-a-geek.org/mirrors/"
+CT_CONNECT_TIMEOUT=10
+# CT_ONLY_DOWNLOAD is not set
+
+#
+# Extracting
+#
+# CT_FORCE_EXTRACT is not set
+CT_OVERIDE_CONFIG_GUESS_SUB=y
+# CT_ONLY_EXTRACT is not set
+
+#
+# Build behavior
+#
+CT_PARALLEL_JOBS=1
+CT_LOAD=0
+CT_NICE=0
+CT_USE_PIPES=y
+# CT_CONFIG_SHELL_ASH is not set
+
+#
+# Logging
+#
+# CT_LOG_ERROR is not set
+# CT_LOG_WARN is not set
+# CT_LOG_INFO is not set
+CT_LOG_EXTRA=y
+# CT_LOG_DEBUG is not set
+# CT_LOG_ALL is not set
+CT_LOG_LEVEL_MAX="EXTRA"
+# CT_LOG_SEE_TOOLS_WARN is not set
+CT_LOG_PROGRESS_BAR=y
+CT_LOG_TO_FILE=y
+CT_LOG_FILE_COMPRESS=y
+
+#
+# Target options
+#
+CT_ARCH="arm"
+# CT_ARCH_64 is not set
+# CT_ARCH_SUPPORTS_BOTH_MMU is not set
+CT_ARCH_SUPPORTS_BOTH_ENDIAN=y
+CT_ARCH_SUPPORT_ARCH=y
+# CT_ARCH_SUPPORT_ABI is not set
+CT_ARCH_SUPPORT_CPU=y
+CT_ARCH_SUPPORT_TUNE=y
+CT_ARCH_SUPPORT_FPU=y
+# CT_ARCH_DEFAULT_HAS_MMU is not set
+# CT_ARCH_DEFAULT_BE is not set
+CT_ARCH_DEFAULT_LE=y
+CT_ARCH_ARCH=""
+CT_ARCH_CPU="cortex-a8"
+CT_ARCH_TUNE="cortex-a8"
+CT_ARCH_FPU=""
+# CT_ARCH_BE is not set
+CT_ARCH_LE=y
+# CT_ARCH_FLOAT_HW is not set
+CT_ARCH_FLOAT_SW=y
+CT_TARGET_CFLAGS=""
+CT_TARGET_LDFLAGS=""
+
+#
+# General target options
+#
+# CT_ARCH_alpha is not set
+CT_ARCH_arm=y
+# CT_ARCH_ia64 is not set
+# CT_ARCH_mips is not set
+# CT_ARCH_powerpc is not set
+# CT_ARCH_powerpc64 is not set
+# CT_ARCH_sh is not set
+# CT_ARCH_x86 is not set
+# CT_ARCH_x86_64 is not set
+CT_ARCH_ARM_EABI=y
+CT_ARCH_USE_MMU=y
+
+#
+# Target optimisations
+#
+
+#
+# Toolchain options
+#
+
+#
+# General toolchain options
+#
+CT_USE_SYSROOT=y
+CT_SYSROOT_DIR_PREFIX=""
+CT_SHARED_LIBS=y
+
+#
+# Tuple completion and aliasing
+#
+CT_TARGET_VENDOR="beagle"
+CT_TARGET_ALIAS_SED_EXPR=""
+CT_TARGET_ALIAS=""
+
+#
+# Toolchain type
+#
+# CT_NATIVE is not set
+CT_CROSS=y
+# CT_CROSS_NATIVE is not set
+# CT_CANADIAN is not set
+CT_TOOLCHAIN_TYPE="cross"
+
+#
+# Build system
+#
+CT_BUILD=""
+CT_BUILD_PREFIX=""
+CT_BUILD_SUFFIX=""
+
+#
+# Operating System
+#
+# CT_BARE_METAL is not set
+CT_KERNEL="linux"
+CT_KERNEL_VERSION="2.6.29.4"
+# CT_KERNEL_bare_metal is not set
+CT_KERNEL_linux=y
+CT_KERNEL_LINUX_INSTALL=y
+CT_KERNEL_LINUX_INSTALL_CHECK=y
+# CT_KERNEL_V_2_6_18_8 is not set
+# CT_KERNEL_V_2_6_19_7 is not set
+# CT_KERNEL_V_2_6_20_21 is not set
+# CT_KERNEL_V_2_6_21_7 is not set
+# CT_KERNEL_V_2_6_22_19 is not set
+# CT_KERNEL_V_2_6_23_17 is not set
+# CT_KERNEL_V_2_6_24_7 is not set
+# CT_KERNEL_V_2_6_25_20 is not set
+# CT_KERNEL_V_2_6_26_8 is not set
+# CT_KERNEL_V_2_6_27_24 is not set
+# CT_KERNEL_V_2_6_28_10 is not set
+# CT_KERNEL_V_2_6_29 is not set
+# CT_KERNEL_V_2_6_29_1 is not set
+# CT_KERNEL_V_2_6_29_2 is not set
+# CT_KERNEL_V_2_6_29_3 is not set
+CT_KERNEL_V_2_6_29_4=y
+# CT_KERNEL_V_select is not set
+CT_KERNEL_LINUX_VERBOSITY_0=y
+# CT_KERNEL_LINUX_VERBOSITY_1 is not set
+# CT_KERNEL_LINUX_VERBOSITY_2 is not set
+CT_KERNEL_LINUX_VERBOSE_LEVEL=0
+# CT_KERNEL_LINUX_USE_CUSTOM_HEADERS is not set
+
+#
+# Companion libraries
+#
+CT_GMP_MPFR=y
+CT_GMP_MPFR_TARGET=y
+# CT_GMP_V_4_2_2 is not set
+CT_GMP_V_4_2_4=y
+CT_GMP_VERSION="4.2.4"
+CT_GMP_CHECK=y
+# CT_MPFR_V_2_3_1 is not set
+# CT_MPFR_V_2_3_2 is not set
+# CT_MPFR_V_2_4_0 is not set
+CT_MPFR_V_2_4_1=y
+CT_MPFR_VERSION="2.4.1"
+CT_MPFR_CHECK=y
+# CT_PPL_CLOOG is not set
+
+#
+# Binary utilities
+#
+CT_ARCH_BINFMT_ELF=y
+# CT_ARCH_BINFMT_FLAT is not set
+
+#
+# GNU binutils
+#
+CT_BINUTILS_VERSION="2.19.1"
+# CT_BINUTILS_V_2_14 is not set
+# CT_BINUTILS_V_2_15 is not set
+# CT_BINUTILS_V_2_16_1 is not set
+# CT_BINUTILS_V_2_17 is not set
+# CT_BINUTILS_V_2_18 is not set
+# CT_BINUTILS_V_2_18_50_0_4 is not set
+# CT_BINUTILS_V_2_18_50_0_6 is not set
+# CT_BINUTILS_V_2_18_50_0_7 is not set
+# CT_BINUTILS_V_2_18_50_0_8 is not set
+# CT_BINUTILS_V_2_18_50_0_9 is not set
+# CT_BINUTILS_V_2_18_90 is not set
+# CT_BINUTILS_V_2_18_91 is not set
+# CT_BINUTILS_V_2_18_92 is not set
+# CT_BINUTILS_V_2_18_93 is not set
+# CT_BINUTILS_V_2_19 is not set
+CT_BINUTILS_V_2_19_1=y
+# CT_BINUTILS_V_2_19_50_0_1 is not set
+# CT_BINUTILS_V_2_19_51_0_1 is not set
+# CT_BINUTILS_V_2_19_51_0_2 is not set
+CT_BINUTILS_EXTRA_CONFIG=""
+CT_BINUTILS_FOR_TARGET=y
+CT_BINUTILS_FOR_TARGET_IBERTY=y
+CT_BINUTILS_FOR_TARGET_BFD=y
+
+#
+# C compiler
+#
+CT_CC="gcc"
+CT_CC_VERSION="4.3.3"
+CT_CC_gcc=y
+# CT_CC_V_3_2_3 is not set
+# CT_CC_V_3_3_6 is not set
+# CT_CC_V_3_4_6 is not set
+# CT_CC_V_4_0_0 is not set
+# CT_CC_V_4_0_1 is not set
+# CT_CC_V_4_0_2 is not set
+# CT_CC_V_4_0_3 is not set
+# CT_CC_V_4_0_4 is not set
+# CT_CC_V_4_1_0 is not set
+# CT_CC_V_4_1_1 is not set
+# CT_CC_V_4_1_2 is not set
+# CT_CC_V_4_2_0 is not set
+# CT_CC_V_4_2_1 is not set
+# CT_CC_V_4_2_2 is not set
+# CT_CC_V_4_2_3 is not set
+# CT_CC_V_4_2_4 is not set
+# CT_CC_V_4_3_0 is not set
+# CT_CC_V_4_3_1 is not set
+# CT_CC_V_4_3_2 is not set
+CT_CC_V_4_3_3=y
+# CT_CC_V_4_4_0 is not set
+CT_CC_GCC_4_3_or_later=y
+# CT_CC_GCC_4_4_or_later is not set
+CT_CC_CXA_ATEXIT=y
+# CT_CC_SJLJ_EXCEPTIONS_CONFIGURE is not set
+# CT_CC_SJLJ_EXCEPTIONS_USE is not set
+CT_CC_SJLJ_EXCEPTIONS_DONT_USE=y
+CT_CC_CORE_EXTRA_CONFIG=""
+CT_CC_EXTRA_CONFIG=""
+CT_CC_PKGVERSION="crosstool-NG-${CT_VERSION}"
+CT_CC_BUGURL=""
+CT_CC_SUPPORT_CXX=y
+CT_CC_SUPPORT_FORTRAN=y
+CT_CC_SUPPORT_JAVA=y
+CT_CC_SUPPORT_ADA=y
+CT_CC_SUPPORT_OBJC=y
+CT_CC_SUPPORT_OBJCXX=y
+
+#
+# Additional supported languages:
+#
+CT_CC_LANG_CXX=y
+# CT_CC_LANG_FORTRAN is not set
+# CT_CC_LANG_JAVA is not set
+CT_LIBC="glibc"
+
+#
+# C-library
+#
+CT_LIBC_VERSION="2.9"
+# CT_LIBC_eglibc is not set
+CT_LIBC_glibc=y
+# CT_LIBC_uClibc is not set
+# CT_LIBC_V_2_3_6 is not set
+# CT_LIBC_V_2_5 is not set
+# CT_LIBC_V_2_5_1 is not set
+# CT_LIBC_V_2_6 is not set
+# CT_LIBC_V_2_6_1 is not set
+# CT_LIBC_V_2_7 is not set
+# CT_LIBC_V_2_8 is not set
+CT_LIBC_V_2_9=y
+# CT_LIBC_V_LATEST is not set
+# CT_LIBC_V_date is not set
+CT_LIBC_GLIBC_2_8_or_later=y
+# CT_LIBC_GLIBC_TARBALL is not set
+CT_LIBC_GLIBC_CVS=y
+CT_LIBC_GLIBC_CVS_date="2009-03-29"
+
+#
+# glibc/eglibc common options
+#
+CT_LIBC_GLIBC_EXTRA_CONFIG=""
+CT_LIBC_GLIBC_CONFIGPARMS=""
+CT_LIBC_GLIBC_EXTRA_CFLAGS=""
+CT_LIBC_EXTRA_CC_ARGS=""
+CT_LIBC_GLIBC_USE_PORTS=y
+CT_LIBC_ADDONS_LIST=""
+
+#
+# WARNING!!!
+#
+
+#
+# For glibc >= 2.8, addons are only available via a CVS checkout.
+#
+
+#
+# Be sure to review the associated options, above.
+#
+# CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set
+CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS=y
+# CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN is not set
+CT_LIBC_GLIBC_MIN_KERNEL="2.6.29.4"
+
+#
+# Common C library options
+#
+CT_LIBC_SUPPORT_NPTL=y
+CT_LIBC_SUPPORT_LINUXTHREADS=y
+CT_THREADS="nptl"
+CT_THREADS_NPTL=y
+# CT_THREADS_LINUXTHREADS is not set
+# CT_THREADS_NONE is not set
+
+#
+# Tools facilities
+#
+CT_TOOL_libelf=y
+CT_LIBELF_V_0_8_10=y
+CT_LIBELF_VERSION="0.8.10"
+CT_TOOL_sstrip=y
+CT_SSTRIP_BUILDROOT=y
+# CT_SSTRIP_ELFKICKERS is not set
+CT_SSTRIP_FROM="buildroot"
+
+#
+# Debug facilities
+#
+CT_DEBUG_dmalloc=y
+# CT_DMALLOC_V_5_4_3 is not set
+CT_DMALLOC_V_5_5_2=y
+CT_DMALLOC_VERSION="5.5.2"
+CT_DEBUG_duma=y
+CT_DUMA_A=y
+CT_DUMA_SO=y
+# CT_DUMA_V_2_5_1 is not set
+# CT_DUMA_V_2_5_8 is not set
+# CT_DUMA_V_2_5_12 is not set
+CT_DUMA_V_2_5_14=y
+CT_DUMA_VERSION="2_5_14"
+CT_DEBUG_gdb=y
+CT_GDB_CROSS=y
+# CT_GDB_CROSS_STATIC is not set
+CT_GDB_NATIVE=y
+# CT_GDB_NATIVE_STATIC is not set
+CT_GDB_NATIVE_USE_GMP_MPFR=y
+CT_GDB_GDBSERVER=y
+CT_GDB_GDBSERVER_STATIC=y
+# CT_GDB_V_6_4 is not set
+# CT_GDB_V_6_5 is not set
+# CT_GDB_V_6_6 is not set
+# CT_GDB_V_6_7 is not set
+# CT_GDB_V_6_7_1 is not set
+CT_GDB_V_6_8=y
+# CT_GDB_V_snapshot is not set
+CT_GDB_VERSION="6.8"
+
+#
+# Native gdb needs a native ncurses library
+#
+# CT_NCURSES_V_5_6 is not set
+CT_NCURSES_V_5_7=y
+CT_NCURSES_VERSION="5.7"
+CT_DEBUG_ltrace=y
+# CT_LTRACE_V_0_4 is not set
+CT_LTRACE_V_0_5=y
+# CT_LTRACE_V_0_5_1 is not set
+CT_LTRACE_VERSION="0.5"
+CT_DEBUG_strace=y
+# CT_STRACE_V_4_5 is not set
+# CT_STRACE_V_4_5_14 is not set
+# CT_STRACE_V_4_5_15 is not set
+# CT_STRACE_V_4_5_16 is not set
+CT_STRACE_V_4_5_17=y
+# CT_STRACE_V_4_5_18 is not set
+CT_STRACE_VERSION="4.5.17"
diff --git a/samples/arm-beagle-linux-gnueabi/reported.by b/samples/arm-beagle-linux-gnueabi/reported.by
new file mode 100644
index 0000000..329b4ed
--- /dev/null
+++ b/samples/arm-beagle-linux-gnueabi/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Yann E. MORIN"
+reporter_url="http://ymorin.is-a-geek.org/"
+reporter_comment="This toolchain is pre-configured to target the BeagleBoard: http://beagleboard.org/"
diff --git a/samples/arm-cortex_a8-linux-gnueabi/crosstool.config b/samples/arm-cortex_a8-linux-gnueabi/crosstool.config
new file mode 100644
index 0000000..75f5264
--- /dev/null
+++ b/samples/arm-cortex_a8-linux-gnueabi/crosstool.config
@@ -0,0 +1,426 @@
+#
+# Automatically generated make config: don't edit
+# crosstool-NG version: svn_devel_gcc-4.4@1589
+# Tue Jun 2 23:13:19 2009
+#
+
+#
+# Paths and misc options
+#
+
+#
+# crosstool-NG behavior
+#
+# CT_OBSOLETE is not set
+CT_EXPERIMENTAL=y
+# CT_DEBUG_CT is not set
+
+#
+# Paths
+#
+CT_LOCAL_TARBALLS_DIR="${HOME}/src"
+CT_SAVE_TARBALLS=y
+CT_WORK_DIR="${CT_TOP_DIR}/targets"
+CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
+CT_INSTALL_DIR="${CT_PREFIX_DIR}"
+# CT_CUSTOM_PATCH is not set
+CT_REMOVE_DOCS=y
+CT_INSTALL_DIR_RO=y
+
+#
+# Downloading
+#
+# CT_FORBID_DOWNLOAD is not set
+# CT_FORCE_DOWNLOAD is not set
+# CT_USE_MIRROR is not set
+CT_CONNECT_TIMEOUT=10
+# CT_ONLY_DOWNLOAD is not set
+
+#
+# Extracting
+#
+# CT_FORCE_EXTRACT is not set
+CT_OVERIDE_CONFIG_GUESS_SUB=y
+# CT_ONLY_EXTRACT is not set
+
+#
+# Build behavior
+#
+CT_PARALLEL_JOBS=1
+CT_LOAD=0
+CT_NICE=0
+CT_USE_PIPES=y
+# CT_CONFIG_SHELL_ASH is not set
+
+#
+# Logging
+#
+# CT_LOG_ERROR is not set
+# CT_LOG_WARN is not set
+# CT_LOG_INFO is not set
+CT_LOG_EXTRA=y
+# CT_LOG_DEBUG is not set
+# CT_LOG_ALL is not set
+CT_LOG_LEVEL_MAX="EXTRA"
+# CT_LOG_SEE_TOOLS_WARN is not set
+CT_LOG_PROGRESS_BAR=y
+CT_LOG_TO_FILE=y
+CT_LOG_FILE_COMPRESS=y
+
+#
+# Target options
+#
+CT_ARCH="arm"
+# CT_ARCH_64 is not set
+# CT_ARCH_SUPPORTS_BOTH_MMU is not set
+CT_ARCH_SUPPORTS_BOTH_ENDIAN=y
+CT_ARCH_SUPPORT_ARCH=y
+# CT_ARCH_SUPPORT_ABI is not set
+CT_ARCH_SUPPORT_CPU=y
+CT_ARCH_SUPPORT_TUNE=y
+CT_ARCH_SUPPORT_FPU=y
+# CT_ARCH_DEFAULT_HAS_MMU is not set
+# CT_ARCH_DEFAULT_BE is not set
+CT_ARCH_DEFAULT_LE=y
+CT_ARCH_ARCH="armv7-a"
+CT_ARCH_CPU="cortex-a8"
+CT_ARCH_TUNE="cortex-a8"
+CT_ARCH_FPU=""
+# CT_ARCH_BE is not set
+CT_ARCH_LE=y
+# CT_ARCH_FLOAT_HW is not set
+CT_ARCH_FLOAT_SW=y
+CT_TARGET_CFLAGS=""
+CT_TARGET_LDFLAGS=""
+
+#
+# General target options
+#
+# CT_ARCH_alpha is not set
+CT_ARCH_arm=y
+# CT_ARCH_ia64 is not set
+# CT_ARCH_mips is not set
+# CT_ARCH_powerpc is not set
+# CT_ARCH_powerpc64 is not set
+# CT_ARCH_sh is not set
+# CT_ARCH_x86 is not set
+# CT_ARCH_x86_64 is not set
+CT_ARCH_ARM_EABI=y
+CT_ARCH_USE_MMU=y
+
+#
+# Target optimisations
+#
+
+#
+# Toolchain options
+#
+
+#
+# General toolchain options
+#
+CT_USE_SYSROOT=y
+CT_SYSROOT_DIR_PREFIX=""
+CT_SHARED_LIBS=y
+
+#
+# Tuple completion and aliasing
+#
+CT_TARGET_VENDOR="cortex_a8"
+CT_TARGET_ALIAS_SED_EXPR=""
+CT_TARGET_ALIAS=""
+
+#
+# Toolchain type
+#
+# CT_NATIVE is not set
+CT_CROSS=y
+# CT_CROSS_NATIVE is not set
+# CT_CANADIAN is not set
+CT_TOOLCHAIN_TYPE="cross"
+
+#
+# Build system
+#
+CT_BUILD=""
+CT_BUILD_PREFIX=""
+CT_BUILD_SUFFIX=""
+
+#
+# Operating System
+#
+# CT_BARE_METAL is not set
+CT_KERNEL="linux"
+CT_KERNEL_VERSION="2.6.29.2"
+# CT_KERNEL_bare_metal is not set
+CT_KERNEL_linux=y
+CT_KERNEL_LINUX_INSTALL=y
+CT_KERNEL_LINUX_INSTALL_CHECK=y
+# CT_KERNEL_V_2_6_18_8 is not set
+# CT_KERNEL_V_2_6_19_7 is not set
+# CT_KERNEL_V_2_6_20_21 is not set
+# CT_KERNEL_V_2_6_21_7 is not set
+# CT_KERNEL_V_2_6_22_19 is not set
+# CT_KERNEL_V_2_6_23_17 is not set
+# CT_KERNEL_V_2_6_24_7 is not set
+# CT_KERNEL_V_2_6_25_20 is not set
+# CT_KERNEL_V_2_6_26_8 is not set
+# CT_KERNEL_V_2_6_27_22 is not set
+# CT_KERNEL_V_2_6_28 is not set
+# CT_KERNEL_V_2_6_28_1 is not set
+# CT_KERNEL_V_2_6_28_2 is not set
+# CT_KERNEL_V_2_6_28_3 is not set
+# CT_KERNEL_V_2_6_28_4 is not set
+# CT_KERNEL_V_2_6_28_5 is not set
+# CT_KERNEL_V_2_6_28_6 is not set
+# CT_KERNEL_V_2_6_28_7 is not set
+# CT_KERNEL_V_2_6_28_8 is not set
+# CT_KERNEL_V_2_6_28_9 is not set
+# CT_KERNEL_V_2_6_28_10 is not set
+# CT_KERNEL_V_2_6_29 is not set
+# CT_KERNEL_V_2_6_29_1 is not set
+CT_KERNEL_V_2_6_29_2=y
+# CT_KERNEL_V_select is not set
+CT_KERNEL_LINUX_VERBOSITY_0=y
+# CT_KERNEL_LINUX_VERBOSITY_1 is not set
+# CT_KERNEL_LINUX_VERBOSITY_2 is not set
+CT_KERNEL_LINUX_VERBOSE_LEVEL=0
+# CT_KERNEL_LINUX_USE_CUSTOM_HEADERS is not set
+
+#
+# Companion libraries
+#
+CT_GMP_MPFR=y
+# CT_GMP_V_4_2_2 is not set
+CT_GMP_V_4_2_4=y
+CT_GMP_VERSION="4.2.4"
+# CT_MPFR_V_2_3_1 is not set
+# CT_MPFR_V_2_3_2 is not set
+# CT_MPFR_V_2_4_0 is not set
+CT_MPFR_V_2_4_1=y
+CT_MPFR_VERSION="2.4.1"
+CT_PPL_CLOOG_MPC=y
+CT_PPL_V_0_10_2=y
+CT_PPL_VERSION="0.10.2"
+CT_CLOOG_V_0_15_3=y
+CT_CLOOG_VERSION="0.15.3"
+CT_MPC_V_0_6=y
+CT_MPC_VERSION="0.6"
+
+#
+# Companion libraries common options
+#
+# CT_COMP_LIBS_CHECK is not set
+CT_COMP_LIBS_TARGET=y
+
+#
+# Binary utilities
+#
+CT_ARCH_BINFMT_ELF=y
+# CT_ARCH_BINFMT_FLAT is not set
+
+#
+# GNU binutils
+#
+CT_BINUTILS_VERSION="2.19.1"
+# CT_BINUTILS_V_2_14 is not set
+# CT_BINUTILS_V_2_15 is not set
+# CT_BINUTILS_V_2_16_1 is not set
+# CT_BINUTILS_V_2_17 is not set
+# CT_BINUTILS_V_2_18 is not set
+# CT_BINUTILS_V_2_18_50_0_4 is not set
+# CT_BINUTILS_V_2_18_50_0_6 is not set
+# CT_BINUTILS_V_2_18_50_0_7 is not set
+# CT_BINUTILS_V_2_18_50_0_8 is not set
+# CT_BINUTILS_V_2_18_50_0_9 is not set
+# CT_BINUTILS_V_2_18_90 is not set
+# CT_BINUTILS_V_2_18_91 is not set
+# CT_BINUTILS_V_2_18_92 is not set
+# CT_BINUTILS_V_2_18_93 is not set
+# CT_BINUTILS_V_2_19 is not set
+CT_BINUTILS_V_2_19_1=y
+# CT_BINUTILS_V_2_19_50_0_1 is not set
+# CT_BINUTILS_V_2_19_51_0_1 is not set
+# CT_BINUTILS_V_2_19_51_0_2 is not set
+CT_BINUTILS_EXTRA_CONFIG=""
+CT_BINUTILS_FOR_TARGET=y
+CT_BINUTILS_FOR_TARGET_IBERTY=y
+CT_BINUTILS_FOR_TARGET_BFD=y
+
+#
+# C compiler
+#
+CT_CC="gcc"
+CT_CC_VERSION="4.4.0"
+CT_CC_gcc=y
+# CT_CC_V_3_2_3 is not set
+# CT_CC_V_3_3_6 is not set
+# CT_CC_V_3_4_6 is not set
+# CT_CC_V_4_0_0 is not set
+# CT_CC_V_4_0_1 is not set
+# CT_CC_V_4_0_2 is not set
+# CT_CC_V_4_0_3 is not set
+# CT_CC_V_4_0_4 is not set
+# CT_CC_V_4_1_0 is not set
+# CT_CC_V_4_1_1 is not set
+# CT_CC_V_4_1_2 is not set
+# CT_CC_V_4_2_0 is not set
+# CT_CC_V_4_2_1 is not set
+# CT_CC_V_4_2_2 is not set
+# CT_CC_V_4_2_3 is not set
+# CT_CC_V_4_2_4 is not set
+# CT_CC_V_4_3_0 is not set
+# CT_CC_V_4_3_1 is not set
+# CT_CC_V_4_3_2 is not set
+# CT_CC_V_4_3_3 is not set
+CT_CC_V_4_4_0=y
+CT_CC_GCC_4_3_or_later=y
+CT_CC_GCC_4_4_or_later=y
+CT_CC_CXA_ATEXIT=y
+CT_CC_SJLJ_EXCEPTIONS_CONFIGURE=y
+# CT_CC_SJLJ_EXCEPTIONS_USE is not set
+# CT_CC_SJLJ_EXCEPTIONS_DONT_USE is not set
+CT_CC_CORE_EXTRA_CONFIG=""
+CT_CC_EXTRA_CONFIG=""
+CT_CC_PKGVERSION="crosstool-NG-${CT_VERSION}"
+CT_CC_BUGURL=""
+CT_CC_SUPPORT_CXX=y
+CT_CC_SUPPORT_FORTRAN=y
+CT_CC_SUPPORT_JAVA=y
+CT_CC_SUPPORT_ADA=y
+CT_CC_SUPPORT_OBJC=y
+CT_CC_SUPPORT_OBJCXX=y
+
+#
+# Additional supported languages:
+#
+CT_CC_LANG_CXX=y
+# CT_CC_LANG_FORTRAN is not set
+# CT_CC_LANG_JAVA is not set
+# CT_CC_LANG_ADA is not set
+# CT_CC_LANG_OBJC is not set
+# CT_CC_LANG_OBJCXX is not set
+CT_CC_LANG_OTHERS=""
+CT_LIBC="glibc"
+
+#
+# C-library
+#
+CT_LIBC_VERSION="2.9"
+# CT_LIBC_eglibc is not set
+CT_LIBC_glibc=y
+# CT_LIBC_uClibc is not set
+# CT_LIBC_V_2_3_6 is not set
+# CT_LIBC_V_2_5 is not set
+# CT_LIBC_V_2_5_1 is not set
+# CT_LIBC_V_2_6 is not set
+# CT_LIBC_V_2_6_1 is not set
+# CT_LIBC_V_2_7 is not set
+# CT_LIBC_V_2_8 is not set
+CT_LIBC_V_2_9=y
+# CT_LIBC_V_LATEST is not set
+# CT_LIBC_V_date is not set
+CT_LIBC_GLIBC_2_8_or_later=y
+# CT_LIBC_GLIBC_TARBALL is not set
+CT_LIBC_GLIBC_CVS=y
+CT_LIBC_GLIBC_CVS_date="2009-05-27"
+
+#
+# glibc/eglibc common options
+#
+CT_LIBC_GLIBC_EXTRA_CONFIG=""
+CT_LIBC_GLIBC_CONFIGPARMS=""
+CT_LIBC_GLIBC_EXTRA_CFLAGS=""
+CT_LIBC_EXTRA_CC_ARGS=""
+CT_LIBC_GLIBC_USE_PORTS=y
+CT_LIBC_ADDONS_LIST=""
+
+#
+# WARNING!!!
+#
+
+#
+# For glibc >= 2.8, addons are only available via a CVS checkout.
+#
+
+#
+# Be sure to review the associated options, above.
+#
+# CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set
+CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS=y
+# CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN is not set
+CT_LIBC_GLIBC_MIN_KERNEL="2.6.29.2"
+
+#
+# Common C library options
+#
+CT_LIBC_SUPPORT_NPTL=y
+CT_LIBC_SUPPORT_LINUXTHREADS=y
+CT_THREADS="nptl"
+CT_THREADS_NPTL=y
+# CT_THREADS_LINUXTHREADS is not set
+# CT_THREADS_NONE is not set
+
+#
+# Tools facilities
+#
+CT_TOOL_libelf=y
+CT_LIBELF_V_0_8_10=y
+CT_LIBELF_VERSION="0.8.10"
+CT_TOOL_sstrip=y
+CT_SSTRIP_BUILDROOT=y
+# CT_SSTRIP_ELFKICKERS is not set
+CT_SSTRIP_FROM="buildroot"
+
+#
+# Debug facilities
+#
+CT_DEBUG_dmalloc=y
+# CT_DMALLOC_V_5_4_3 is not set
+CT_DMALLOC_V_5_5_2=y
+CT_DMALLOC_VERSION="5.5.2"
+CT_DEBUG_duma=y
+CT_DUMA_A=y
+CT_DUMA_SO=y
+# CT_DUMA_V_2_5_1 is not set
+# CT_DUMA_V_2_5_8 is not set
+# CT_DUMA_V_2_5_12 is not set
+CT_DUMA_V_2_5_14=y
+CT_DUMA_VERSION="2_5_14"
+CT_DEBUG_gdb=y
+CT_GDB_CROSS=y
+# CT_GDB_CROSS_STATIC is not set
+# CT_GDB_CROSS_INSIGHT is not set
+CT_GDB_NATIVE=y
+# CT_GDB_NATIVE_STATIC is not set
+CT_GDB_NATIVE_USE_GMP_MPFR=y
+CT_GDB_GDBSERVER=y
+CT_GDB_GDBSERVER_STATIC=y
+# CT_GDB_V_6_4 is not set
+# CT_GDB_V_6_5 is not set
+# CT_GDB_V_6_6 is not set
+# CT_GDB_V_6_7 is not set
+# CT_GDB_V_6_7_1 is not set
+CT_GDB_V_6_8=y
+# CT_GDB_V_snapshot is not set
+CT_GDB_VERSION="6.8"
+
+#
+# Native gdb needs a native ncurses library
+#
+# CT_NCURSES_V_5_6 is not set
+CT_NCURSES_V_5_7=y
+CT_NCURSES_VERSION="5.7"
+CT_DEBUG_ltrace=y
+# CT_LTRACE_V_0_4 is not set
+# CT_LTRACE_V_0_5 is not set
+CT_LTRACE_V_0_5_1=y
+CT_LTRACE_VERSION="0.5.1"
+CT_DEBUG_strace=y
+# CT_STRACE_V_4_5 is not set
+# CT_STRACE_V_4_5_14 is not set
+# CT_STRACE_V_4_5_15 is not set
+# CT_STRACE_V_4_5_16 is not set
+# CT_STRACE_V_4_5_17 is not set
+CT_STRACE_V_4_5_18=y
+CT_STRACE_VERSION="4.5.18"
diff --git a/samples/arm-cortex_a8-linux-gnueabi/reported.by b/samples/arm-cortex_a8-linux-gnueabi/reported.by
new file mode 100644
index 0000000..edac2bb
--- /dev/null
+++ b/samples/arm-cortex_a8-linux-gnueabi/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Yann E. MORIN"
+reporter_url="http://ymorin.is-a-geek.org/"
+reporter_comment=""
diff --git a/samples/mingw32,i686-none-linux-gnu/crosstool.config b/samples/mingw32,i686-none-linux-gnu/crosstool.config
new file mode 100644
index 0000000..8a04d12
--- /dev/null
+++ b/samples/mingw32,i686-none-linux-gnu/crosstool.config
@@ -0,0 +1,357 @@
+#
+# Automatically generated make config: don't edit
+# crosstool-NG version: hg:canadian@1421:d39f714dce54
+# Mon Jun 22 18:27:13 2009
+#
+
+#
+# Paths and misc options
+#
+
+#
+# crosstool-NG behavior
+#
+# CT_OBSOLETE is not set
+CT_EXPERIMENTAL=y
+# CT_DEBUG_CT is not set
+
+#
+# Paths
+#
+CT_LOCAL_TARBALLS_DIR="${HOME}/src"
+CT_SAVE_TARBALLS=y
+CT_WORK_DIR="${CT_TOP_DIR}/targets"
+CT_PREFIX_DIR="${HOME}/x-tools/${samp_name}"
+CT_INSTALL_DIR="${CT_PREFIX_DIR}"
+# CT_CUSTOM_PATCH is not set
+CT_REMOVE_DOCS=y
+# CT_INSTALL_DIR_RO is not set
+
+#
+# Downloading
+#
+# CT_FORBID_DOWNLOAD is not set
+# CT_FORCE_DOWNLOAD is not set
+# CT_USE_MIRROR is not set
+CT_CONNECT_TIMEOUT=10
+# CT_ONLY_DOWNLOAD is not set
+
+#
+# Extracting
+#
+# CT_FORCE_EXTRACT is not set
+CT_OVERIDE_CONFIG_GUESS_SUB=y
+# CT_ONLY_EXTRACT is not set
+
+#
+# Build behavior
+#
+CT_PARALLEL_JOBS=4
+CT_LOAD=0
+CT_NICE=0
+CT_USE_PIPES=y
+# CT_CONFIG_SHELL_ASH is not set
+
+#
+# Logging
+#
+# CT_LOG_ERROR is not set
+# CT_LOG_WARN is not set
+# CT_LOG_INFO is not set
+CT_LOG_EXTRA=y
+# CT_LOG_DEBUG is not set
+# CT_LOG_ALL is not set
+CT_LOG_LEVEL_MAX="EXTRA"
+# CT_LOG_SEE_TOOLS_WARN is not set
+CT_LOG_PROGRESS_BAR=y
+CT_LOG_TO_FILE=y
+CT_LOG_FILE_COMPRESS=y
+
+#
+# Target options
+#
+CT_ARCH="x86"
+# CT_ARCH_64 is not set
+# CT_ARCH_SUPPORTS_BOTH_MMU is not set
+# CT_ARCH_SUPPORTS_BOTH_ENDIAN is not set
+CT_ARCH_SUPPORT_ARCH=y
+# CT_ARCH_SUPPORT_ABI is not set
+CT_ARCH_SUPPORT_CPU=y
+CT_ARCH_SUPPORT_TUNE=y
+# CT_ARCH_SUPPORT_FPU is not set
+# CT_ARCH_DEFAULT_HAS_MMU is not set
+# CT_ARCH_DEFAULT_BE is not set
+# CT_ARCH_DEFAULT_LE is not set
+CT_ARCH_ARCH="i686"
+CT_ARCH_CPU=""
+CT_ARCH_TUNE="i686"
+CT_ARCH_FLOAT_HW=y
+# CT_ARCH_FLOAT_SW is not set
+CT_TARGET_CFLAGS=""
+CT_TARGET_LDFLAGS=""
+
+#
+# General target options
+#
+# CT_ARCH_alpha is not set
+# CT_ARCH_arm is not set
+# CT_ARCH_ia64 is not set
+# CT_ARCH_mips is not set
+# CT_ARCH_powerpc is not set
+# CT_ARCH_powerpc64 is not set
+# CT_ARCH_sh is not set
+CT_ARCH_x86=y
+# CT_ARCH_x86_64 is not set
+CT_ARCH_USE_MMU=y
+
+#
+# Target optimisations
+#
+
+#
+# Toolchain options
+#
+
+#
+# General toolchain options
+#
+CT_USE_SYSROOT=y
+CT_SYSROOT_DIR_PREFIX=""
+CT_SHARED_LIBS=y
+
+#
+# Tuple completion and aliasing
+#
+CT_TARGET_VENDOR="none"
+CT_TARGET_ALIAS_SED_EXPR=""
+CT_TARGET_ALIAS=""
+
+#
+# Toolchain type
+#
+# CT_NATIVE is not set
+# CT_CROSS is not set
+# CT_CROSS_NATIVE is not set
+CT_CANADIAN=y
+CT_TOOLCHAIN_TYPE="canadian"
+
+#
+# Build system
+#
+CT_BUILD=""
+CT_BUILD_PREFIX=""
+CT_BUILD_SUFFIX=""
+
+#
+# Host system
+#
+CT_HOST="mingw32"
+CT_HOST_PREFIX="mingw32-"
+CT_HOST_SUFFIX=""
+
+#
+# Target system
+#
+CT_TARGET_PREFIX="i686-none-linux-gnu-"
+CT_TARGET_SUFFIX=""
+
+#
+# Operating System
+#
+# CT_BARE_METAL is not set
+CT_KERNEL="linux"
+CT_KERNEL_VERSION="2.6.29.4"
+# CT_KERNEL_bare_metal is not set
+CT_KERNEL_linux=y
+CT_KERNEL_LINUX_INSTALL=y
+CT_KERNEL_LINUX_INSTALL_CHECK=y
+# CT_KERNEL_V_2_6_18_8 is not set
+# CT_KERNEL_V_2_6_19_7 is not set
+# CT_KERNEL_V_2_6_20_21 is not set
+# CT_KERNEL_V_2_6_21_7 is not set
+# CT_KERNEL_V_2_6_22_19 is not set
+# CT_KERNEL_V_2_6_23_17 is not set
+# CT_KERNEL_V_2_6_24_7 is not set
+# CT_KERNEL_V_2_6_25_20 is not set
+# CT_KERNEL_V_2_6_26_8 is not set
+# CT_KERNEL_V_2_6_27_24 is not set
+# CT_KERNEL_V_2_6_28_10 is not set
+# CT_KERNEL_V_2_6_29 is not set
+# CT_KERNEL_V_2_6_29_1 is not set
+# CT_KERNEL_V_2_6_29_2 is not set
+# CT_KERNEL_V_2_6_29_3 is not set
+CT_KERNEL_V_2_6_29_4=y
+# CT_KERNEL_V_select is not set
+CT_KERNEL_LINUX_VERBOSITY_0=y
+# CT_KERNEL_LINUX_VERBOSITY_1 is not set
+# CT_KERNEL_LINUX_VERBOSITY_2 is not set
+CT_KERNEL_LINUX_VERBOSE_LEVEL=0
+# CT_KERNEL_LINUX_USE_CUSTOM_HEADERS is not set
+
+#
+# Companion libraries
+#
+CT_GMP_MPFR=y
+# CT_GMP_V_4_2_2 is not set
+CT_GMP_V_4_2_4=y
+CT_GMP_VERSION="4.2.4"
+# CT_MPFR_V_2_3_1 is not set
+# CT_MPFR_V_2_3_2 is not set
+# CT_MPFR_V_2_4_0 is not set
+CT_MPFR_V_2_4_1=y
+CT_MPFR_VERSION="2.4.1"
+# CT_PPL_CLOOG_MPC is not set
+
+#
+# Companion libraries common options
+#
+# CT_COMP_LIBS_CHECK is not set
+# CT_COMP_LIBS_TARGET is not set
+
+#
+# Binary utilities
+#
+CT_ARCH_BINFMT_ELF=y
+# CT_ARCH_BINFMT_FLAT is not set
+
+#
+# GNU binutils
+#
+CT_BINUTILS_VERSION="2.19.1"
+# CT_BINUTILS_V_2_14 is not set
+# CT_BINUTILS_V_2_15 is not set
+# CT_BINUTILS_V_2_16_1 is not set
+# CT_BINUTILS_V_2_17 is not set
+# CT_BINUTILS_V_2_18 is not set
+# CT_BINUTILS_V_2_18_50_0_4 is not set
+# CT_BINUTILS_V_2_18_50_0_6 is not set
+# CT_BINUTILS_V_2_18_50_0_7 is not set
+# CT_BINUTILS_V_2_18_50_0_8 is not set
+# CT_BINUTILS_V_2_18_50_0_9 is not set
+# CT_BINUTILS_V_2_18_90 is not set
+# CT_BINUTILS_V_2_18_91 is not set
+# CT_BINUTILS_V_2_18_92 is not set
+# CT_BINUTILS_V_2_18_93 is not set
+# CT_BINUTILS_V_2_19 is not set
+CT_BINUTILS_V_2_19_1=y
+# CT_BINUTILS_V_2_19_50_0_1 is not set
+# CT_BINUTILS_V_2_19_51_0_1 is not set
+# CT_BINUTILS_V_2_19_51_0_2 is not set
+CT_BINUTILS_EXTRA_CONFIG="--enable-targets=i686-none-linux-gnu"
+# CT_BINUTILS_FOR_TARGET is not set
+
+#
+# C compiler
+#
+CT_CC="gcc"
+CT_CC_VERSION="4.3.2"
+CT_CC_gcc=y
+# CT_CC_V_3_2_3 is not set
+# CT_CC_V_3_3_6 is not set
+# CT_CC_V_3_4_6 is not set
+# CT_CC_V_4_0_0 is not set
+# CT_CC_V_4_0_1 is not set
+# CT_CC_V_4_0_2 is not set
+# CT_CC_V_4_0_3 is not set
+# CT_CC_V_4_0_4 is not set
+# CT_CC_V_4_1_0 is not set
+# CT_CC_V_4_1_1 is not set
+# CT_CC_V_4_1_2 is not set
+# CT_CC_V_4_2_0 is not set
+# CT_CC_V_4_2_1 is not set
+# CT_CC_V_4_2_2 is not set
+# CT_CC_V_4_2_3 is not set
+# CT_CC_V_4_2_4 is not set
+# CT_CC_V_4_3_0 is not set
+# CT_CC_V_4_3_1 is not set
+CT_CC_V_4_3_2=y
+# CT_CC_V_4_3_3 is not set
+# CT_CC_V_4_4_0 is not set
+CT_CC_GCC_4_3_or_later=y
+# CT_CC_GCC_4_4_or_later is not set
+CT_CC_CXA_ATEXIT=y
+CT_CC_SJLJ_EXCEPTIONS_CONFIGURE=y
+# CT_CC_SJLJ_EXCEPTIONS_USE is not set
+# CT_CC_SJLJ_EXCEPTIONS_DONT_USE is not set
+CT_CC_CORE_EXTRA_CONFIG=""
+CT_CC_EXTRA_CONFIG=""
+CT_CC_PKGVERSION="crosstool-NG-${CT_VERSION}"
+CT_CC_BUGURL=""
+CT_CC_SUPPORT_CXX=y
+CT_CC_SUPPORT_FORTRAN=y
+CT_CC_SUPPORT_JAVA=y
+CT_CC_SUPPORT_ADA=y
+CT_CC_SUPPORT_OBJC=y
+CT_CC_SUPPORT_OBJCXX=y
+
+#
+# Additional supported languages:
+#
+CT_CC_LANG_CXX=y
+# CT_CC_LANG_FORTRAN is not set
+# CT_CC_LANG_JAVA is not set
+# CT_CC_LANG_ADA is not set
+# CT_CC_LANG_OBJC is not set
+# CT_CC_LANG_OBJCXX is not set
+CT_CC_LANG_OTHERS=""
+CT_LIBC="glibc"
+
+#
+# C-library
+#
+CT_LIBC_VERSION="2.9"
+# CT_LIBC_eglibc is not set
+CT_LIBC_glibc=y
+# CT_LIBC_uClibc is not set
+# CT_LIBC_V_2_3_6 is not set
+# CT_LIBC_V_2_5 is not set
+# CT_LIBC_V_2_5_1 is not set
+# CT_LIBC_V_2_6 is not set
+# CT_LIBC_V_2_6_1 is not set
+# CT_LIBC_V_2_7 is not set
+# CT_LIBC_V_2_8 is not set
+CT_LIBC_V_2_9=y
+# CT_LIBC_V_LATEST is not set
+# CT_LIBC_V_date is not set
+CT_LIBC_GLIBC_2_8_or_later=y
+CT_LIBC_GLIBC_TARBALL=y
+# CT_LIBC_GLIBC_CVS is not set
+
+#
+# glibc/eglibc common options
+#
+CT_LIBC_GLIBC_EXTRA_CONFIG=""
+CT_LIBC_GLIBC_CONFIGPARMS=""
+CT_LIBC_GLIBC_EXTRA_CFLAGS=""
+CT_LIBC_EXTRA_CC_ARGS=""
+# CT_LIBC_GLIBC_USE_PORTS is not set
+CT_LIBC_ADDONS_LIST=""
+# CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set
+CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS=y
+# CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN is not set
+CT_LIBC_GLIBC_MIN_KERNEL="2.6.29.4"
+
+#
+# Common C library options
+#
+CT_LIBC_SUPPORT_NPTL=y
+CT_LIBC_SUPPORT_LINUXTHREADS=y
+CT_THREADS="nptl"
+CT_THREADS_NPTL=y
+# CT_THREADS_LINUXTHREADS is not set
+# CT_THREADS_NONE is not set
+
+#
+# Tools facilities
+#
+# CT_TOOL_libelf is not set
+# CT_TOOL_sstrip is not set
+
+#
+# Debug facilities
+#
+# CT_DEBUG_dmalloc is not set
+# CT_DEBUG_duma is not set
+# CT_DEBUG_gdb is not set
+# CT_DEBUG_ltrace is not set
+# CT_DEBUG_strace is not set
diff --git a/samples/mingw32,i686-none-linux-gnu/reported.by b/samples/mingw32,i686-none-linux-gnu/reported.by
new file mode 100644
index 0000000..a6ea065
--- /dev/null
+++ b/samples/mingw32,i686-none-linux-gnu/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Bart vd. Meulen"
+reporter_url=""
+reporter_comment="Sample for building a canadian cross-compiler"
diff --git a/scripts/addToolVersion.sh b/scripts/addToolVersion.sh
index 8e0446e..255b8fe 100755
--- a/scripts/addToolVersion.sh
+++ b/scripts/addToolVersion.sh
@@ -13,7 +13,7 @@ Usage: ${myname} <tool> <[options] version [...]> ...
'tool' in one of:
--gcc, --binutils, --glibc, --eglibc, --uClibc, --linux,
--gdb, --dmalloc, --duma, --strace, --ltrace, --libelf
- --gmp, --mpfr, --ppl
+ --gmp, --mpfr, --ppl, --cloog
Valid options for all tools:
--stable, -s, +x (default)
@@ -96,7 +96,11 @@ addToolVersion() {
ver_m=$(echo "${version}...." |cut -d . -f 2)
if [ ${ver_M} -gt 4 \
-o \( ${ver_M} -eq 4 -a ${ver_m} -ge 3 \) ]; then
- SedExpr1=" select CC_GCC_4_3_or_later\n"
+ SedExpr1="${SedExpr1} select CC_GCC_4_3_or_later\n"
+ fi
+ if [ ${ver_M} -gt 4 \
+ -o \( ${ver_M} -eq 4 -a ${ver_m} -ge 4 \) ]; then
+ SedExpr1="${SedExpr1} select CC_GCC_4_4_or_later\n"
fi
fi
SedExpr2=" default \"${version}\" if ${cat}_V_${v}"
@@ -134,6 +138,7 @@ while [ $# -gt 0 ]; do
--gmp) EXP=; OBS=; cat=GMP; tool=gmp; tool_prefix=companion_libs;;
--mpfr) EXP=; OBS=; cat=MPFR; tool=mpfr; tool_prefix=companion_libs;;
--ppl) EXP=; OBS=; cat=PPL; tool=ppl; tool_prefix=companion_libs;;
+ --cloog) EXP=; OBS=; cat=CLOOG; tool=cloog; tool_prefix=companion_libs;;
# Tools options:
-x|--experimental|+s) EXP=1;;
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index c7e1712..e1f5d25 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -4,18 +4,16 @@
# Download gcc
do_cc_get() {
- local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
-
# Ah! gcc folks are kind of 'different': they store the tarballs in
# subdirectories of the same name! That's because gcc is such /crap/ that
# it is such /big/ that it needs being splitted for distribution! Sad. :-(
# Arrgghh! Some of those versions does not follow this convention:
# gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a
# subdirectory! You bastard!
- CT_GetFile "gcc-${version}" \
- {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${version}} \
- ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${version} \
- ftp://ftp.uvsq.fr/pub/gcc/snapshots/${version}
+ CT_GetFile "gcc-${CT_CC_VERSION}" \
+ {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${CT_CC_VERSION}} \
+ ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${CT_CC_VERSION} \
+ ftp://ftp.uvsq.fr/pub/gcc/snapshots/${CT_CC_VERSION}
# Starting with GCC 4.3, ecj is used for Java, and will only be
# built if the configure script finds ecj.jar at the top of the
@@ -29,22 +27,24 @@ do_cc_get() {
# Extract gcc
do_cc_extract() {
- local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
-
- CT_Extract "gcc-${version}"
- CT_Patch "gcc-${version}"
+ CT_Extract "gcc-${CT_CC_VERSION}"
+ CT_Patch "gcc-${CT_CC_VERSION}"
# Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
- if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \
- -a ! -f "${CT_SRC_DIR}/gcc-${version}/ecj.jar" \
+ if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \
+ -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar" \
]; then
- CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${version}/ecj.jar"
+ CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar"
fi
}
#------------------------------------------------------------------------------
# Core gcc pass 1
do_cc_core_pass_1() {
+ # If we're building a canadian compiler no use to build the CC
+ # core compiler, we're not using it
+ [ -n "${CT_CANADIAN}" ] && return 0
+
# If we're building for bare metal, build the static core gcc,
# with libgcc.
# In case we're not bare metal, and we're NPTL, build the static core gcc.
@@ -58,6 +58,10 @@ do_cc_core_pass_1() {
# Core gcc pass 2
do_cc_core_pass_2() {
+ # If we're building a canadian compiler no use to build the CC
+ # core compiler, we're not using it
+ [ -n "${CT_CANADIAN}" ] && return 0
+
# In case we're building for bare metal, do nothing, we already have
# our compiler.
# In case we're NPTL, build the shared core gcc and the target libgcc.
@@ -90,7 +94,6 @@ do_cc_core() {
local core_prefix_dir
local extra_config
local lang_opt
- local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
eval $1
eval $2
@@ -137,12 +140,20 @@ do_cc_core() {
extra_config="${extra_config} ${CT_ARCH_WITH_TUNE}"
extra_config="${extra_config} ${CT_ARCH_WITH_FPU}"
extra_config="${extra_config} ${CT_ARCH_WITH_FLOAT}"
- [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then
extra_config="${extra_config} --enable-__cxa_atexit"
else
extra_config="${extra_config} --disable-__cxa_atexit"
fi
+ if [ "${CT_GMP_MPFR}" = "y" ]; then
+ extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR}"
+ extra_config="${extra_config} --with-mpfr=${CT_PREFIX_DIR}"
+ fi
+ if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then
+ extra_config="${extra_config} --with-ppl=${CT_PREFIX_DIR}"
+ extra_config="${extra_config} --with-cloog=${CT_PREFIX_DIR}"
+ extra_config="${extra_config} --with-mpc=${CT_PREFIX_DIR}"
+ fi
CT_DoLog DEBUG "Extra config passed: '${extra_config}'"
@@ -150,7 +161,7 @@ do_cc_core() {
CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS="${CT_CFLAGS_FOR_HOST}" \
CT_DoExecLog ALL \
- "${CT_SRC_DIR}/gcc-${version}/configure" \
+ "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${CT_HOST} \
--target=${CT_TARGET} \
@@ -182,7 +193,7 @@ do_cc_core() {
# so we configure then build it.
# Next we have to configure gcc, create libgcc.mk then edit it...
# So much easier if we just edit the source tree, but hey...
- if [ ! -f "${CT_SRC_DIR}/gcc-${version}/gcc/BASE-VER" ]; then
+ if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
CT_DoExecLog ALL make configure-libiberty
CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libiberty libiberty.a
CT_DoExecLog ALL make configure-gcc configure-libcpp
@@ -192,7 +203,7 @@ do_cc_core() {
CT_DoExecLog ALL make ${PARALLELMFLAGS} all-libcpp all-build-libiberty
fi
# HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
- if [ -d "${CT_SRC_DIR}/gcc-${version}/libdecnumber" ]; then
+ if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/libdecnumber" ]; then
CT_DoExecLog ALL make configure-libdecnumber
CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libdecnumber libdecnumber.a
fi
@@ -238,8 +249,6 @@ do_cc_core() {
#------------------------------------------------------------------------------
# Build final gcc
do_cc() {
- local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
-
# If building for bare metal, nothing to be done here, the static core conpiler is enough!
[ "${CT_BARE_METAL}" = "y" ] && return 0
@@ -273,7 +282,6 @@ do_cc() {
extra_config="${extra_config} ${CT_ARCH_WITH_FPU}"
extra_config="${extra_config} ${CT_ARCH_WITH_FLOAT}"
[ "${CT_SHARED_LIBS}" = "y" ] || extra_config="${extra_config} --disable-shared"
- [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
[ -n "${CT_CC_PKGVERSION}" ] && extra_config="${extra_config} --with-pkgversion=${CT_CC_PKGVERSION}"
[ -n "${CT_CC_BUGURL}" ] && extra_config="${extra_config} --with-bugurl=${CT_CC_BUGURL}"
[ "${CT_CC_SJLJ_EXCEPTIONS_USE}" = "y" ] && extra_config="${extra_config} --enable-sjlj-exceptions"
@@ -283,6 +291,15 @@ do_cc() {
else
extra_config="${extra_config} --disable-__cxa_atexit"
fi
+ if [ "${CT_GMP_MPFR}" = "y" ]; then
+ extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR}"
+ extra_config="${extra_config} --with-mpfr=${CT_PREFIX_DIR}"
+ fi
+ if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then
+ extra_config="${extra_config} --with-ppl=${CT_PREFIX_DIR}"
+ extra_config="${extra_config} --with-cloog=${CT_PREFIX_DIR}"
+ extra_config="${extra_config} --with-mpc=${CT_PREFIX_DIR}"
+ fi
CT_DoLog DEBUG "Extra config passed: '${extra_config}'"
@@ -296,7 +313,7 @@ do_cc() {
CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \
CT_DoExecLog ALL \
- "${CT_SRC_DIR}/gcc-${version}/configure" \
+ "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${CT_HOST} \
--target=${CT_TARGET} \
diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh
new file mode 100644
index 0000000..0e6d74f
--- /dev/null
+++ b/scripts/build/companion_libs/cloog.sh
@@ -0,0 +1,63 @@
+# This file adds the functions to build the CLooG library
+# Copyright 2009 Yann E. MORIN
+# Licensed under the GPL v2. See COPYING in the root of this package
+
+do_cloog_get() { :; }
+do_cloog_extract() { :; }
+do_cloog() { :; }
+do_cloog_target() { :; }
+
+# Overide functions depending on configuration
+if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then
+
+# Download CLooG
+do_cloog_get() {
+ CT_GetFile "cloog-ppl-${CT_CLOOG_VERSION}" \
+ ftp://gcc.gnu.org/pub/gcc/infrastructure
+}
+
+# Extract CLooG
+do_cloog_extract() {
+ CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}"
+ CT_Pushd "${CT_SRC_DIR}/cloog-ppl"
+ CT_Patch "cloog-ppl-${CT_CLOOG_VERSION}" nochdir
+ CT_Popd
+}
+
+do_cloog() {
+ mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
+ cd "${CT_BUILD_DIR}/build-cloog-ppl"
+
+ CT_DoStep INFO "Installing CLooG/ppl"
+
+ CT_DoLog EXTRA "Configuring CLooG/ppl"
+ CFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ CT_DoExecLog ALL \
+ "${CT_SRC_DIR}/cloog-ppl/configure" \
+ --build=${CT_BUILD} \
+ --host=${CT_HOST} \
+ --prefix="${CT_PREFIX_DIR}" \
+ --with-gmp="${CT_PREFIX_DIR}" \
+ --with-ppl="${CT_PREFIX_DIR}" \
+ --enable-shared \
+ --disable-static \
+ --with-bits=gmp
+
+ CT_DoLog EXTRA "Building CLooG/ppl"
+ CT_DoExecLog ALL make ${PARALLELMFLAGS}
+
+ if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
+ CT_DoLog EXTRA "Checking CLooG/ppl"
+ CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
+ fi
+
+ CT_DoLog EXTRA "Installing CLooG/ppl"
+ CT_DoExecLog ALL make install
+
+ # Remove spuriously installed file
+ CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/cloog"
+
+ CT_EndStep
+}
+
+fi # CT_PPL_CLOOG_MPC
diff --git a/scripts/build/companion_libs/gmp.sh b/scripts/build/companion_libs/gmp.sh
index a3dd4a0..6371b45 100644
--- a/scripts/build/companion_libs/gmp.sh
+++ b/scripts/build/companion_libs/gmp.sh
@@ -22,8 +22,6 @@ do_gmp_extract() {
}
do_gmp() {
- local opts
- local cflags
mkdir -p "${CT_BUILD_DIR}/build-gmp"
cd "${CT_BUILD_DIR}/build-gmp"
@@ -32,27 +30,22 @@ do_gmp() {
CT_DoLog EXTRA "Configuring GMP"
- if [ "${CT_PPL_CLOOG}" = "y" ]; then
- opts="--enable-cxx"
- cflags="-fexceptions"
- fi
-
- CFLAGS="${CT_CFLAGS_FOR_HOST} ${cflags}" \
+ CFLAGS="${CT_CFLAGS_FOR_HOST} -fexceptions" \
CT_DoExecLog ALL \
"${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${CT_HOST} \
--prefix="${CT_PREFIX_DIR}" \
- --disable-shared \
- --enable-static \
+ --enable-shared \
+ --disable-static \
--enable-fft \
--enable-mpbsd \
- ${opts}
+ --enable-cxx
CT_DoLog EXTRA "Building GMP"
CT_DoExecLog ALL make ${PARALLELMFLAGS}
- if [ "${CT_GMP_CHECK}" = "y" ]; then
+ if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking GMP"
CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
fi
@@ -63,7 +56,7 @@ do_gmp() {
CT_EndStep
}
-if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
+if [ "${CT_COMP_LIBS_TARGET}" = "y" ]; then
do_gmp_target() {
mkdir -p "${CT_BUILD_DIR}/build-gmp-target"
diff --git a/scripts/build/companion_libs/mpc.sh b/scripts/build/companion_libs/mpc.sh
new file mode 100644
index 0000000..18144a0
--- /dev/null
+++ b/scripts/build/companion_libs/mpc.sh
@@ -0,0 +1,57 @@
+# This file adds the functions to build the MPC library
+# Copyright 2009 Yann E. MORIN
+# Licensed under the GPL v2. See COPYING in the root of this package
+
+do_mpc_get() { :; }
+do_mpc_extract() { :; }
+do_mpc() { :; }
+do_mpc_target() { :; }
+
+# Overide functions depending on configuration
+if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then
+
+# Download MPC
+do_mpc_get() {
+ CT_GetFile "mpc-${CT_MPC_VERSION}" .tar.gz \
+ http://www.multiprecision.org/mpc/download
+}
+
+# Extract MPC
+do_mpc_extract() {
+ CT_Extract "mpc-${CT_MPC_VERSION}"
+ CT_Patch "mpc-${CT_MPC_VERSION}"
+}
+
+do_mpc() {
+ mkdir -p "${CT_BUILD_DIR}/build-mpc"
+ cd "${CT_BUILD_DIR}/build-mpc"
+
+ CT_DoStep INFO "Installing MPC"
+
+ CT_DoLog EXTRA "Configuring MPC"
+ CFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ CT_DoExecLog ALL \
+ "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \
+ --build=${CT_BUILD} \
+ --host=${CT_HOST} \
+ --prefix="${CT_PREFIX_DIR}" \
+ --with-gmp="${CT_PREFIX_DIR}" \
+ --with-mpfr="${CT_PREFIX_DIR}" \
+ --enable-shared \
+ --disable-static \
+
+ CT_DoLog EXTRA "Building MPC"
+ CT_DoExecLog ALL make ${PARALLELMFLAGS}
+
+ if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
+ CT_DoLog EXTRA "Checking MPC"
+ CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
+ fi
+
+ CT_DoLog EXTRA "Installing MPC"
+ CT_DoExecLog ALL make install
+
+ CT_EndStep
+}
+
+fi # CT_PPL_CLOOG_MPC
diff --git a/scripts/build/companion_libs/mpfr.sh b/scripts/build/companion_libs/mpfr.sh
index e302ff7..3c3480d 100644
--- a/scripts/build/companion_libs/mpfr.sh
+++ b/scripts/build/companion_libs/mpfr.sh
@@ -30,6 +30,15 @@ do_mpfr_extract() {
# do that in the future...
# It seems that MPFR >= 2.4.0 do not need this...
case "${CT_MPFR_VERSION}" in
+ 2.4.1)
+ CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
+ if [ ! -f .autoreconf.ct-ng ]; then
+ CT_DoLog DEBUG "Running autoreconf"
+ CT_DoExecLog ALL autoreconf
+ touch .autoreconf.ct-ng
+ fi
+ CT_Popd
+ ;;
1.*|2.0.*|2.1.*|2.2.*|2.3.*)
CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
if [ ! -f .autotools.ct-ng ]; then
@@ -64,7 +73,8 @@ do_mpfr() {
mpfr_opt=
# Under Cygwin, we can't build a thread-safe library
case "${CT_HOST}" in
- *-cygwin) mpfr_opt="--disable-thread-safe";;
+ *cygwin*) mpfr_opt="--disable-thread-safe";;
+ *mingw*) mpfr_opt="--disable-thread-safe";;
*) mpfr_opt="--enable-thread-safe";;
esac
@@ -77,14 +87,14 @@ do_mpfr() {
--host=${CT_HOST} \
--prefix="${CT_PREFIX_DIR}" \
${mpfr_opt} \
- --disable-shared \
- --enable-static \
+ --enable-shared \
+ --disable-static \
--with-gmp="${CT_PREFIX_DIR}"
CT_DoLog EXTRA "Building MPFR"
CT_DoExecLog ALL make ${PARALLELMFLAGS}
- if [ "${CT_MPFR_CHECK}" = "y" ]; then
+ if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking MPFR"
CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
fi
@@ -95,7 +105,7 @@ do_mpfr() {
CT_EndStep
}
-if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
+if [ "${CT_COMP_LIBS_TARGET}" = "y" ]; then
do_mpfr_target() {
mkdir -p "${CT_BUILD_DIR}/build-mpfr-target"
diff --git a/scripts/build/companion_libs/ppl.sh b/scripts/build/companion_libs/ppl.sh
index d3246f9..4af080b 100644
--- a/scripts/build/companion_libs/ppl.sh
+++ b/scripts/build/companion_libs/ppl.sh
@@ -8,13 +8,14 @@ do_ppl() { :; }
do_ppl_target() { :; }
# Overide functions depending on configuration
-if [ "${CT_PPL_CLOOG}" = "y" ]; then
+if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then
# Download PPL
do_ppl_get() {
CT_GetFile "ppl-${CT_PPL_VERSION}" \
http://www.cs.unipr.it/ppl/Download/ftp/releases/${CT_PPL_VERSION} \
- ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION}
+ ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION} \
+ ftp://gcc.gnu.org/pub/gcc/infrastructure
}
# Extract PPL
@@ -31,6 +32,7 @@ do_ppl() {
CT_DoLog EXTRA "Configuring PPL"
CFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ CXXFLAGS="${CT_CFLAGS_FOR_HOST}" \
CT_DoExecLog ALL \
"${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
--build=${CT_BUILD} \
@@ -38,8 +40,8 @@ do_ppl() {
--prefix="${CT_PREFIX_DIR}" \
--with-libgmp-prefix="${CT_PREFIX_DIR}" \
--with-libgmpxx-prefix="${CT_PREFIX_DIR}" \
- --disable-shared \
- --enable-static \
+ --enable-shared \
+ --disable-static \
--disable-debugging \
--disable-assertions \
--disable-ppl_lcdd \
@@ -52,7 +54,7 @@ do_ppl() {
CT_DoLog EXTRA "Building PPL"
CT_DoExecLog ALL make ${PARALLELMFLAGS}
- if [ "${CT_PPL_CHECK}" = "y" ]; then
+ if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking PPL"
CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
fi
@@ -60,7 +62,10 @@ do_ppl() {
CT_DoLog EXTRA "Installing PPL"
CT_DoExecLog ALL make install
+ # Remove spuriously installed file
+ CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/ppl-config"
+
CT_EndStep
}
-fi # CT_PPL_CLOOG
+fi # CT_PPL_CLOOG_MPC
diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh
index acaf864..a920c50 100644
--- a/scripts/build/internals.sh
+++ b/scripts/build/internals.sh
@@ -4,12 +4,12 @@
# un-wanted files, to add tuple aliases, and to add the final
# crosstool-NG-provided files.
do_finish() {
+ local _t
+
CT_DoStep INFO "Cleaning-up the toolchain's directory"
CT_DoLog EXTRA "Removing access to the build system tools"
- find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
- find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
- CT_DoExecLog DEBUG rm -fv "${CT_PREFIX_DIR}/bin/makeinfo"
+ CT_DoExecLog DEBUG rm -rf "${CT_PREFIX_DIR}/buildtools"
if [ "${CT_BARE_METAL}" != "y" ]; then
CT_DoLog EXTRA "Installing the populate helper"
@@ -39,6 +39,33 @@ do_finish() {
done
CT_Popd
+ # If using the companion libraries, we need a wrapper
+ # that will set LD_LIBRARY_PATH approriately
+ if [ "${CT_GMP_MPFR}" = "y" \
+ -o "${CT_PPL_CLOOG_MPC}" = "y" ]; then
+ CT_DoLog EXTRA "Installing toolchain wrappers"
+ CT_Pushd "${CT_PREFIX_DIR}/bin"
+
+ # Copy the wrapper
+ CT_DoExecLog DEBUG install -m 0755 "${CT_LIB_DIR}/scripts/wrapper.in" \
+ ".${CT_TARGET}-wrapper"
+
+ # Replace every tools with the wrapper
+ # Do it unconditionally, even for those tools that happen to be shell
+ # scripts, we don't know if they would in the end spawn a binary...
+ # Just skip symlinks
+ for _t in "${CT_TARGET}-"*; do
+ if [ "$( LANG=C stat -c '%F' "${_t}" )" != "symbolic link" ]; then
+ CT_DoExecLog ALL mv "${_t}" ".${_t}"
+ CT_DoExecLog ALL ln ".${CT_TARGET}-wrapper" "${_t}"
+ fi
+ done
+
+ # Get rid of the wrapper, we're using hardlinks
+ CT_DoExecLog DEBUG rm -f ".${CT_TARGET}-wrapper"
+ CT_Popd
+ fi
+
# Remove the generated documentation files
if [ "${CT_REMOVE_DOCS}" = "y" ]; then
CT_DoLog EXTRA "Removing installed documentation"
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 3fcda91..9af0135 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -172,6 +172,7 @@ do_libc_headers() {
CT_DoExecLog ALL \
make CFLAGS="-O -DBOOTSTRAP_GCC" \
OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
+ PARALLELMFLAGS="${PARALLELMFLAGS}" \
sysdeps/gnu/errlist.c
mkdir -p stdio-common
@@ -189,6 +190,7 @@ do_libc_headers() {
CFLAGS="-O -DBOOTSTRAP_GCC" \
${LIBC_SYSROOT_ARG} \
OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
+ PARALLELMFLAGS="${PARALLELMFLAGS}" \
install-headers
# Two headers -- stubs.h and features.h -- aren't installed by install-headers,
@@ -331,11 +333,12 @@ do_libc_start_files() {
${extra_config} \
${CT_LIBC_GLIBC_EXTRA_CONFIG}
-
#TODO: should check whether slibdir has been set in configparms to */lib64
# and copy the startfiles into the appropriate libdir.
CT_DoLog EXTRA "Building C library start files"
- CT_DoExecLog ALL make OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" csu/subdir_lib
+ CT_DoExecLog ALL make OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
+ PARALLELMFLAGS="${PARALLELMFLAGS}" \
+ csu/subdir_lib
CT_DoLog EXTRA "Installing C library start files"
if [ "${CT_USE_SYSROOT}" = "y" ]; then
@@ -499,18 +502,19 @@ do_libc() {
# then you need to set the KERNELCONFIG variable to point to a .config file for this arch.
# The following architectures are known to need kernel .config: alpha, arm, ia64, s390, sh, sparc
# Note: LD and RANLIB needed by glibc-2.1.3's c_stub directory, at least on macosx
- # No need for PARALLELMFLAGS here, Makefile already reads this environment variable
CT_DoLog EXTRA "Building C library"
CT_DoExecLog ALL make LD=${CT_TARGET}-ld \
- RANLIB=${CT_TARGET}-ranlib \
- OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
- ASFLAGS="${GLIBC_INITIAL_BUILD_ASFLAGS}" \
- ${GLIBC_INITIAL_BUILD_RULE}
+ RANLIB=${CT_TARGET}-ranlib \
+ OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
+ ASFLAGS="${GLIBC_INITIAL_BUILD_ASFLAGS}" \
+ PARALLELMFLAGS="${PARALLELMFLAGS}" \
+ ${GLIBC_INITIAL_BUILD_RULE}
CT_DoLog EXTRA "Installing C library"
CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}" \
${LIBC_SYSROOT_ARG} \
OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
+ PARALLELMFLAGS="${PARALLELMFLAGS}" \
${GLIBC_INITIAL_INSTALL_RULE}
# This doesn't seem to work when building a crosscompiler,
@@ -553,7 +557,11 @@ do_libc_finish() {
cd "${CT_BUILD_DIR}/build-libc"
CT_DoLog EXTRA "Re-building C library"
- CT_DoExecLog ALL make LD=${CT_TARGET}-ld RANLIB=${CT_TARGET}-ranlib
+ CT_DoExecLog ALL make LD=${CT_TARGET}-ld \
+ RANLIB=${CT_TARGET}-ranlib \
+ OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
+ ASFLAGS="${GLIBC_INITIAL_BUILD_ASFLAGS}" \
+ PARALLELMFLAGS="${PARALLELMFLAGS}"
CT_DoLog EXTRA "Installing missing C library components"
# note: should do full install and then fix linker scripts, but this is faster
@@ -561,6 +569,7 @@ do_libc_finish() {
CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}" \
${LIBC_SYSROOT_ARG} \
OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
+ PARALLELMFLAGS="${PARALLELMFLAGS}" \
install-${t}
done
diff --git a/scripts/config.guess b/scripts/config.guess
index 3eda297..e3a2116 100755
--- a/scripts/config.guess
+++ b/scripts/config.guess
@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
-timestamp='2009-02-03'
+timestamp='2009-06-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
+ | grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
@@ -324,6 +324,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
@@ -653,7 +656,7 @@ EOF
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
+ grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
@@ -819,6 +822,9 @@ EOF
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -879,40 +885,17 @@ EOF
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
+ mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
- #undef mips64
- #undef mips64el
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
+ CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
+ CPU=${UNAME_MACHINE}
#else
CPU=
#endif
@@ -944,7 +927,7 @@ EOF
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
@@ -998,14 +981,6 @@ EOF
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
@@ -1071,7 +1046,7 @@ EOF
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
@@ -1179,7 +1154,7 @@ EOF
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
diff --git a/scripts/config.sub b/scripts/config.sub
index a39437d..eb0389a 100755
--- a/scripts/config.sub
+++ b/scripts/config.sub
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
-timestamp='2009-04-17'
+timestamp='2009-06-11'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -153,6 +153,9 @@ case $os in
os=
basic_machine=$1
;;
+ -bluegene*)
+ os=-cnk
+ ;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
@@ -467,6 +470,10 @@ case $basic_machine in
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
@@ -1260,7 +1267,7 @@ case $os in
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
@@ -1613,7 +1620,7 @@ case $basic_machine in
-sunos*)
vendor=sun
;;
- -aix*)
+ -cnk*|-aix*)
vendor=ibm
;;
-beos*)
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index a2032bc..ba30c4f 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -28,6 +28,29 @@
# Overide the locale early, in case we ever translate crosstool-NG messages
[ -z "${CT_NO_OVERIDE_LC_MESSAGES}" ] && export LC_ALL=C
+# Some sanity checks in the environment and needed tools
+CT_DoLog INFO "Performing some trivial sanity checks"
+CT_TestAndAbort "Don't set LD_LIBRARY_PATH. It screws up the build." -n "${LD_LIBRARY_PATH}"
+CT_TestAndAbort "Don't set CFLAGS. It screws up the build." -n "${CFLAGS}"
+CT_TestAndAbort "Don't set CXXFLAGS. It screws up the build." -n "${CXXFLAGS}"
+CT_Test "GREP_OPTIONS screws up the build. Resetting." -n "${GREP_OPTIONS}"
+export GREP_OPTIONS=
+
+# Some sanity checks on paths content
+for d in \
+ LOCAL_TARBALLS \
+ WORK \
+ PREFIX \
+ INSTALL \
+ ; do
+ eval dir="\${CT_${d}_DIR}"
+ case "${dir}" in
+ *" "*)
+ CT_Abort "'CT_${d}_DIR'='${dir}' contains a space in it.\nDon't use spaces in paths, it breaks things."
+ ;;
+ esac
+done
+
# Where will we work?
CT_WORK_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/targets}"
CT_DoExecLog ALL mkdir -p "${CT_WORK_DIR}"
@@ -37,6 +60,19 @@ CT_DoExecLog DEBUG touch "${CT_WORK_DIR}/foo"
CT_TestAndAbort "Your file system in '${CT_WORK_DIR}' is *not* case-sensitive!" -f "${CT_WORK_DIR}/FOO"
CT_DoExecLog DEBUG rm -f "${CT_WORK_DIR}/foo"
+# What's our shell?
+# Will be plain /bin/sh on most systems, except if we have /bin/ash and we
+# _explictly_ required using it
+case "${CT_CONFIG_SHELL}" in
+ sh) CT_SHELL="/bin/sh";;
+ ash) CT_SHELL="/bin/ash";;
+ bash) CT_SHELL="${BASH}";;
+ custom) CT_SHELL="${CT_CONFIG_SHELL_CUSTOM_PATH}";;
+esac
+
+# Check the user is using an existing SHELL to be used by ./configure and Makefiles
+CT_TestOrAbort "The CONFIG_SHELL '${CT_CONFIG_SHELL}' (${CT_SHELL}) is not valid" -f "${CT_SHELL}" -a -x "${CT_SHELL}"
+
# Create the bin-overide early
# Contains symlinks to the tools found by ./configure
# Note: CT_DoLog and CT_DoExecLog do not use any of those tool, so
@@ -48,12 +84,13 @@ cat "${CT_LIB_DIR}/paths.mk" |while read trash line; do
tool="${line%%=*}"
path="${line#*=}"
CT_DoLog DEBUG " '${tool}' -> '${path}'"
- printf "#${BANG}/bin/sh\nexec '${path}' \"\${@}\"\n" >"${CT_BIN_OVERIDE_DIR}/${tool}"
+ printf "#${BANG}${CT_SHELL}\nexec '${path}' \"\${@}\"\n" >"${CT_BIN_OVERIDE_DIR}/${tool}"
CT_DoExecLog ALL chmod 700 "${CT_BIN_OVERIDE_DIR}/${tool}"
done
export PATH="${CT_BIN_OVERIDE_DIR}:${PATH}"
# Start date. Can't be done until we know the locale
+# Also requires the bin-override tools
CT_STAR_DATE=$(CT_DoDate +%s%N)
CT_STAR_DATE_HUMAN=$(CT_DoDate +%Y%m%d.%H%M%S)
@@ -67,20 +104,10 @@ CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
CT_DoExecLog DEBUG grep -E '^(# |)CT_' .config
CT_EndStep
-# Some sanity checks in the environment and needed tools
-CT_DoLog INFO "Checking environment sanity"
-
CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS"
unset MAKEFLAGS
export MAKEFLAGS
-# Other environment sanity checks
-CT_TestAndAbort "Don't set LD_LIBRARY_PATH. It screws up the build." -n "${LD_LIBRARY_PATH}"
-CT_TestAndAbort "Don't set CFLAGS. It screws up the build." -n "${CFLAGS}"
-CT_TestAndAbort "Don't set CXXFLAGS. It screws up the build." -n "${CXXFLAGS}"
-CT_Test "GREP_OPTIONS screws up the build. Resetting." -n "${GREP_OPTIONS}"
-export GREP_OPTIONS=
-
CT_DoLog INFO "Building environment variables"
# Include sub-scripts instead of calling them: that way, we do not have to
@@ -91,6 +118,8 @@ CT_DoLog INFO "Building environment variables"
. "${CT_LIB_DIR}/scripts/build/companion_libs/gmp.sh"
. "${CT_LIB_DIR}/scripts/build/companion_libs/mpfr.sh"
. "${CT_LIB_DIR}/scripts/build/companion_libs/ppl.sh"
+. "${CT_LIB_DIR}/scripts/build/companion_libs/cloog.sh"
+. "${CT_LIB_DIR}/scripts/build/companion_libs/mpc.sh"
. "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh"
. "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh"
. "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
@@ -113,7 +142,7 @@ CT_TARGET_LDFLAGS="${CT_ARCH_TARGET_LDFLAGS} ${CT_TARGET_LDFLAGS}"
CT_CC_CORE_EXTRA_CONFIG="${CT_ARCH_CC_CORE_EXTRA_CONFIG} ${CT_CC_CORE_EXTRA_CONFIG}"
CT_CC_EXTRA_CONFIG="${CT_ARCH_CC_EXTRA_CONFIG} ${CT_CC_EXTRA_CONFIG}"
-# Create the working directories
+# Compute the working directories names
CT_TARBALLS_DIR="${CT_WORK_DIR}/tarballs"
CT_SRC_DIR="${CT_WORK_DIR}/src"
CT_BUILD_DIR="${CT_WORK_DIR}/${CT_TARGET}/build"
@@ -125,6 +154,10 @@ CT_CONFIG_DIR="${CT_BUILD_DIR}/configs"
CT_CC_CORE_STATIC_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-static"
CT_CC_CORE_SHARED_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-shared"
+# Set LD_LIBRARY_PATH to point to prefix/lib so we can find our own
+# libraries; add as first path, so we get hit first by the dynamic linker
+CT_SetLibPath "${CT_PREFIX_DIR}/lib" first
+
# We must ensure that we can restart if asked for!
if [ -n "${CT_RESTART}" -a ! -d "${CT_STATE_DIR}" ]; then
CT_DoLog ERROR "You asked to restart a non-restartable build"
@@ -140,11 +173,6 @@ if [ ! -d "${CT_LOCAL_TARBALLS_DIR}" ]; then
CT_SAVE_TARBALLS=
fi
-# Some more sanity checks now that we have all paths set up
-case "${CT_LOCAL_TARBALLS_DIR},${CT_TARBALLS_DIR},${CT_SRC_DIR},${CT_BUILD_DIR},${CT_PREFIX_DIR},${CT_INSTALL_DIR}" in
- *" "*) CT_Abort "Don't use spaces in paths, it breaks things.";;
-esac
-
# Check now if we can write to the destination directory:
if [ -d "${CT_INSTALL_DIR}" ]; then
CT_TestAndAbort "Destination directory '${CT_INSTALL_DIR}' is not removable" ! -w $(dirname "${CT_INSTALL_DIR}")
@@ -202,8 +230,10 @@ CT_DoExecLog ALL mkdir -p "${CT_BUILD_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_CONFIG_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_INSTALL_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}"
-CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}"
-CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}"
+if [ -z "${CT_CANADIAN}" ]; then
+ CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}"
+ CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}"
+fi
# Only create the state dir if asked for a restartable build
[ -n "${CT_DEBUG_CT_SAVE_STEPS}" ] && CT_DoExecLog ALL mkdir -p "${CT_STATE_DIR}"
@@ -235,12 +265,6 @@ esac
# Setting up the rest of the environment only if not restarting
if [ -z "${CT_RESTART}" ]; then
- # What's our shell?
- # Will be plain /bin/sh on most systems, except if we have /bin/ash and we
- # _explictly_ required using it
- CT_SHELL="/bin/sh"
- [ "${CT_CONFIG_SHELL_ASH}" = "y" -a -x "/bin/ash" ] && CT_SHELL="/bin/ash"
-
# Arrange paths depending on wether we use sys-root or not.
if [ "${CT_USE_SYSROOT}" = "y" ]; then
CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/sys-root"
@@ -257,6 +281,7 @@ if [ -z "${CT_RESTART}" ]; then
else
# plain old way. All libraries in prefix/target/lib
CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}"
+ CT_DEBUGROOT_DIR="${CT_SYSROOT_DIR}"
CT_HEADERS_DIR="${CT_SYSROOT_DIR}/include"
# hack! Always use --with-sysroot for binutils.
# binutils 2.14 and later obey it, older binutils ignore it.
@@ -280,8 +305,10 @@ if [ -z "${CT_RESTART}" ]; then
CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/lib"
CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/usr/lib"
- # Prevent gcc from installing its libraries outside of the sys-root
- CT_DoExecLog ALL ln -sf "./${CT_SYSROOT_DIR_PREFIX}/sys-root/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib"
+ if [ "${CT_USE_SYSROOT}" = "y" ]; then
+ # Prevent gcc from installing its libraries outside of the sys-root
+ CT_DoExecLog ALL ln -sf "./${CT_SYSROOT_DIR_PREFIX}/sys-root/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib"
+ fi
# Now, in case we're 64 bits, just have lib64/ be a symlink to lib/
# so as to have all libraries in the same directory (we can do that
@@ -302,9 +329,18 @@ if [ -z "${CT_RESTART}" ]; then
# Prepare mangling patterns to later modify BUILD and HOST (see below)
case "${CT_TOOLCHAIN_TYPE}" in
cross)
+ # A cross-compiler runs on the same machine it is built on
CT_HOST="${CT_BUILD}"
build_mangle="build_"
host_mangle="build_"
+ target_mangle=""
+ install_build_tools_for="BUILD HOST"
+ ;;
+ canadian)
+ build_mangle="build_"
+ host_mangle="host_"
+ target_mangle=""
+ install_build_tools_for="BUILD HOST TARGET"
;;
*) CT_Abort "No code for '${CT_TOOLCHAIN_TYPE}' toolchain type!"
;;
@@ -313,11 +349,13 @@ if [ -z "${CT_RESTART}" ]; then
# Save the real tuples to generate shell-wrappers to the real tools
CT_REAL_BUILD="${CT_BUILD}"
CT_REAL_HOST="${CT_HOST}"
+ CT_REAL_TARGET="${CT_TARGET}"
# Canonicalise CT_BUILD and CT_HOST
# Not only will it give us full-qualified tuples, but it will also ensure
# that they are valid tuples (in case of typo with user-provided tuples)
# That's way better than trying to rewrite config.sub ourselves...
+ # CT_TARGET is already made canonical in CT_DoBuildTargetTuple
CT_BUILD=$(CT_DoConfigSub "${CT_BUILD}")
CT_HOST=$(CT_DoConfigSub "${CT_HOST}")
@@ -327,12 +365,13 @@ if [ -z "${CT_RESTART}" ]; then
# support canadain build, later...
CT_BUILD="${CT_BUILD/-/-${build_mangle}}"
CT_HOST="${CT_HOST/-/-${host_mangle}}"
+ CT_TARGET="${CT_TARGET/-/-${target_mangle}}"
# Now we have mangled our BUILD and HOST tuples, we must fake the new
# cross-tools for those mangled tuples.
CT_DoLog DEBUG "Making build system tools available"
- CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin"
- for m in BUILD HOST; do
+ CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/buildtools"
+ for m in ${install_build_tools_for}; do
r="CT_REAL_${m}"
v="CT_${m}"
p="CT_${m}_PREFIX"
@@ -368,12 +407,12 @@ if [ -z "${CT_RESTART}" ]; then
# bally needed
if [ -n "${where}" ]; then
CT_DoLog DEBUG " '${!v}-${tool}' -> '${where}'"
- printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/bin/${!v}-${tool}"
- CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/bin/${!v}-${tool}"
+ printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/buildtools/${!v}-${tool}"
+ CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/buildtools/${!v}-${tool}"
else
case "${tool}" in
# We'll at least need some of them...
- ar|as|gcc|ld|nm|objcopy|objdump|ranlib)
+ ar|as|gcc|g++|ld|nm|objcopy|objdump|ranlib)
CT_Abort "Missing: '${t}${tool}${!s}' or '${t}${tool}' or '${tool}' : either needed!"
;;
# Some are conditionnally required
@@ -399,7 +438,8 @@ if [ -z "${CT_RESTART}" ]; then
# Of course, neither cross-native nor canadian can run on BUILD,
# so don't add those PATHs in this case...
case "${CT_TOOLCHAIN_TYPE}" in
- cross) export PATH="${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";;
+ cross) export PATH="${CT_PREFIX_DIR}/buildtools:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";;
+ canadian) export PATH="${CT_PREFIX_DIR}/buildtools:${PATH}";;
*) ;;
esac
@@ -407,8 +447,8 @@ if [ -z "${CT_RESTART}" ]; then
# Go ahead with those, by creating a wrapper that keeps partial files, and that
# never fails:
CT_DoLog DEBUG " 'makeinfo' -> '$(CT_Which makeinfo)'"
- printf "#${BANG}/bin/sh\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_PREFIX_DIR}/bin/makeinfo"
- CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/bin/makeinfo"
+ printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_PREFIX_DIR}/buildtools/makeinfo"
+ CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/buildtools/makeinfo"
# Help gcc
CT_CFLAGS_FOR_HOST=
@@ -419,7 +459,8 @@ if [ -z "${CT_RESTART}" ]; then
# Set the shell to be used by ./configure scripts and by Makefiles (those
# that support it!).
- export CONFIG_SHELL="${CT_SHELL}"
+ export CONFIG_SHELL="${CT_SHELL}" # for ./configure
+ export SHELL="${CT_SHELL}" # for Makefiles
# And help make go faster
PARALLELMFLAGS=
@@ -428,6 +469,7 @@ if [ -z "${CT_RESTART}" ]; then
export PARALLELMFLAGS
CT_DoLog EXTRA "Installing user-supplied crosstool-NG configuration"
+ CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin"
CT_DoExecLog DEBUG install -m 0755 "${CT_LIB_DIR}/scripts/toolchain-config.in" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
CT_DoExecLog DEBUG sed -r -i -e 's,@@grep@@,"'"${grep}"'",;' "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
bzip2 -c -9 .config >>"${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
@@ -447,6 +489,8 @@ if [ -z "${CT_RESTART}" ]; then
do_gmp_get
do_mpfr_get
do_ppl_get
+ do_cloog_get
+ do_mpc_get
do_binutils_get
do_cc_get
do_libc_get
@@ -464,6 +508,8 @@ if [ -z "${CT_RESTART}" ]; then
do_gmp_extract
do_mpfr_extract
do_ppl_extract
+ do_cloog_extract
+ do_mpc_extract
do_binutils_extract
do_cc_extract
do_libc_extract
diff --git a/scripts/functions b/scripts/functions
index 82bccab..546f22d 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -79,7 +79,7 @@ CT_DoLog() {
if [ $# -eq 0 ]; then
cat -
else
- echo "${@}"
+ printf "${@}\n"
fi |( IFS="${CR}" # We want the full lines, even leading spaces
_prog_bar_cpt=0
_prog_bar[0]='/'
@@ -265,6 +265,36 @@ CT_DoYes() {
yes "$1" || true
}
+# Add the specified directory to LD_LIBRARY_PATH, and export it
+# If the specified patch is already present, just export
+# $1: path to add
+# $2: add as 'first' or 'last' path, 'first' is assumed if $2 is empty
+# Usage CT_SetLibPath /some/where/lib [first|last]
+CT_SetLibPath() {
+ local path="$1"
+ local pos="$2"
+
+ case ":${LD_LIBRARY_PATH}:" in
+ *:"${path}":*) ;;
+ *) case "${pos}" in
+ last)
+ CT_DoLog DEBUG "Adding '${path}' at end of LD_LIBRARY_PATH"
+ LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${path}"
+ ;;
+ first|"")
+ CT_DoLog DEBUG "Adding '${path}' at start of LD_LIBRARY_PATH"
+ LD_LIBRARY_PATH="${path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
+ ;;
+ *)
+ CT_Abort "Incorrect position '${pos}' to add '${path}' to LD_LIBRARY_PATH"
+ ;;
+ esac
+ ;;
+ esac
+ CT_DoLog DEBUG "==> LD_LIBRARY_PATH='${LD_LIBRARY_PATH}'"
+ export LD_LIBRARY_PATH
+}
+
# Get the file name extension of a component
# Usage: CT_GetFileExtension <component_name-component_version> [extension]
# If found, echoes the extension to stdout
diff --git a/scripts/populate.in b/scripts/populate.in
index e8a3718..9bb5afb 100644
--- a/scripts/populate.in
+++ b/scripts/populate.in
@@ -13,7 +13,7 @@ CT_SYSROOT_DIR="$(cd "${CT_BIN_DIR}/../@@CT_TARGET@@/sys-root"; pwd)"
myname=$(basename "$0")
-# Use the tols discovered by crosstool-NG's ./configure:
+# Use the tools discovered by crosstool-NG's ./configure:
install="@@CT_install@@"
grep="@@CT_grep@@"
sed="@@CT_sed@@"
@@ -59,7 +59,7 @@ OPTIONS
-f force execution: if destination directory already exists, it will be
removed first; if a specified library (above) was not found, continue.
- -v Be verbose
+ -v Be verbose. By default, populate is absolutely silent.
_EOF_
}
@@ -69,7 +69,7 @@ CT_ROOT_DST_DIR=
CT_LIB_LIST=
CT_LIB_FILE=
CT_FORCE=no
-CT_ECHO=true
+CT_PRINTF=:
OPTIND=1
while getopts ":s:d:l:L:fvh" CT_OPT; do
case "${CT_OPT}" in
@@ -78,7 +78,7 @@ while getopts ":s:d:l:L:fvh" CT_OPT; do
l) CT_LIB_LIST="${CT_LIB_LIST}:${OPTARG}";;
L) CT_LIB_FILE="${OPTARG}";;
f) CT_FORCE=y;;
- v) CT_ECHO=echo;;
+ v) CT_PRINTF=printf;;
h) doHelp
exit 0
;;
@@ -104,9 +104,9 @@ if [ -d "${CT_ROOT_DST_DIR}" -a "${CT_FORCE}" != "y" ]; then
echo "$myname: '${CT_ROOT_DST_DIR}': already exists"
exit 1
fi
-src_inode=$(ls -di "${CT_ROOT_SRC_DIR}")
-dst_inode=$(ls -di "${CT_ROOT_DST_DIR}" 2>/dev/null)
-if [ "${src_inode}" = "${dst_inode}" ]; then
+src_inode=$(stat -c '%i' "${CT_ROOT_SRC_DIR}/.")
+dst_inode=$(stat -c '%i' "${CT_ROOT_DST_DIR}/." 2>/dev/null || true)
+if [ "${src_inode}" -eq "$((dst_inode+0))" ]; then
echo "$myname: source and destination are the same!"
exit 1
fi
@@ -129,7 +129,7 @@ CT_ROOT_DST_DIR=$(cd "${CT_ROOT_DST_DIR}"; pwd)
# Populate the destination directory with files form the source directory
pushd "${CT_ROOT_SRC_DIR}" >/dev/null
-tar cf - . |(cd "${CT_ROOT_DST_DIR}"; tar xf -)
+tar cf - . |tar xf - -C "${CT_ROOT_DST_DIR}"
popd >/dev/null
# A function do search for a library
@@ -139,18 +139,24 @@ do_add_lib() {
local libname="$1"
local true_libname
local dir
+ local mode
+
for dir in lib usr/lib; do
- ${CT_ECHO} -n " trying in '${dir}'"
+ ${CT_PRINTF} " trying in '%s'" "${dir}"
libfile="${CT_SYSROOT_DIR}/${dir}/${libname}"
- ${CT_ECHO} ": '${libfile}'"
+ ${CT_PRINTF} ": '%s'\n" "${libfile}"
if [ -e "${libfile}" ]; then
mkdir -p "${dir}"
true_libname=$("${CT_READELF}" -d "${libfile}" \
|"${grep}" "Library soname:" \
|"${sed}" -r -e 's,.+\[(.+)\] *$,\1,;' \
)
- ${CT_ECHO} " installing as '${dir}/${true_libname}'"
- "${install}" -m 0644 "${libfile}" "${dir}/${true_libname}"
+ case "${libfile}" in
+ */ld*) mode=0755;;
+ *) mode=0644;;
+ esac
+ ${CT_PRINTF} " installing as '%s/%s', mode='%s'\n" "${dir}" "${true_libname}" "${mode}"
+ "${install}" -m "${mode}" "${libfile}" "${dir}/${true_libname}"
return 0
break
fi
@@ -158,6 +164,9 @@ do_add_lib() {
return 1
}
+# We'll work in the copied rootfs
+pushd "${CT_ROOT_DST_DIR}" >/dev/null
+
# First of, copy the forced libraries into the working copy
if [ -n "${CT_LIB_FILE}" ]; then
lib_list=$("${sed}" -r -e ':loop; s/#.*//;' \
@@ -173,44 +182,43 @@ fi
CT_LIB_LIST=$(echo "${CT_LIB_LIST}:${lib_list}" \
|"${sed}" -r -e 's/^:+//; s/:+$//; s/:+/ /g;' \
)
-${CT_ECHO} "Installing forced libraries..."
-pushd "${CT_ROOT_DST_DIR}" >/dev/null
-for name in ${CT_LIB_LIST}; do
- [ -z "${name}" ] && continue
- found=0
- for libname in "lib${name}.so" "${name}.so" "${name}"; do
- ${CT_ECHO} " searching for '${libname}'"
- if do_add_lib "${libname}"; then
- found=1
- break
+if [ -n "${CT_LIB_LIST}" ]; then
+ ${CT_PRINTF} "Installing forced libraries...\n"
+ for name in ${CT_LIB_LIST}; do
+ [ -z "${name}" ] && continue
+ found=0
+ for libname in "lib${name}.so" "${name}.so" "${name}"; do
+ ${CT_PRINTF} " searching for '%s'\n" "${libname}"
+ if do_add_lib "${libname}"; then
+ found=1
+ break
+ fi
+ done
+ if [ ${found} -eq 0 ]; then
+ echo "$myname: library '${libname}' not found!"
+ [ "${CT_FORCE}" = y ] || exit 1
fi
done
- if [ ${found} -eq 0 ]; then
- echo "$myname: library '${libname}' not found!"
- [ "${CT_FORCE}" = y ] || exit 1
- fi
-done
-popd >/dev/null
+fi
# Parse the working copy for executables and libraries
-pushd "${CT_ROOT_DST_DIR}" >/dev/null
still_needed=1
while [ ${still_needed} -eq 1 ]; do
- ${CT_ECHO} "Looping..."
+ ${CT_PRINTF} "Looping...\n"
still_needed=0
for f in $(find . -type f -exec file {} \; \
|"${grep}" -E ': ELF [[:digit:]]+-bit (L|M)SB (executable|shared object),' \
|cut -d ":" -f 1 \
); do
- ${CT_ECHO} "Scanning '${f}'"
+ ${CT_PRINTF} "Scanning '%s'\n" "${f}"
for libname in $("${CT_READELF}" -d "${f}" \
|"${grep}" -E '\(NEEDED\)[[:space:]]+Shared library:' \
|"${sed}" -r -e 's,.+\[(.+)\] *$,\1,;' \
); do
- ${CT_ECHO} " searching for '${libname}'"
+ ${CT_PRINTF} " searching for '%s'\n" "${libname}"
if [ -e "lib/${libname}" \
-o -e "usr/lib/${libname}" ]; then
- ${CT_ECHO} " already present"
+ ${CT_PRINTF} " already present\n"
continue
fi
if do_add_lib "${libname}"; then
@@ -221,4 +229,6 @@ while [ ${still_needed} -eq 1 ]; do
done
done
done
+
+# OK, we're done. Back off.
popd >/dev/null
diff --git a/scripts/saveSample.sh.in b/scripts/saveSample.sh.in
index 6b3f205..4ef71ce 100644
--- a/scripts/saveSample.sh.in
+++ b/scripts/saveSample.sh.in
@@ -59,18 +59,22 @@ unset CT_LOG_PROGRESS_BAR CT_LOG_ERROR CT_LOG_INFO CT_LOG_EXTRA CT_LOG_DEBUG LOG
CT_LOG_WARN=y
CT_LOG_LEVEL_MAX="WARN"
-# Create the sample directory
-if [ ! -d "samples/${CT_TARGET}" ]; then
- mkdir -p "samples/${CT_TARGET}"
-fi
+# Compute the name of the sample directory
+case "${CT_TOOLCHAIN_TYPE}" in
+ cross) samp_name="${CT_TARGET}";;
+ canadian) samp_name="${CT_HOST},${CT_TARGET}";;
+ *) CT_Abort "Unsupported toolchain type '${CT_TOOLCHAIN_TYPE}'";;
+esac
+samp_dir="samples/${samp_name}"
+mkdir -p "${samp_dir}"
# Save the crosstool-NG config file
-"${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;' \
+"${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${samp_name}"|;' \
-e 's|^# CT_LOG_TO_FILE is not set$|CT_LOG_TO_FILE=y|;' \
-e 's|^# CT_LOG_FILE_COMPRESS is not set$|CT_LOG_FILE_COMPRESS=y|;' \
-e 's|^(CT_LOCAL_TARBALLS_DIR)=.*|\1="${HOME}/src"|;' \
<.config \
- >"samples/${CT_TARGET}/crosstool.config"
+ >"${samp_dir}/crosstool.config"
# Function to copy a file to the sample directory
# Needed in case the file is already there (think of a previously available sample)
@@ -94,12 +98,12 @@ fi
# Save the uClibc .config file
if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
# We save the file, and then point the saved sample to this file
- CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
- "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \
- "samples/${CT_TARGET}/crosstool.config"
+ CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
+ "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \
+ "${samp_dir}/crosstool.config"
else
# remove any dangling files
- for f in "samples/${CT_TARGET}/${CT_LIBC}-"*.config; do
+ for f in "${samp_dir}/${CT_LIBC}-"*.config; do
if [ -f "${f}" ]; then rm -f "${f}"; fi
done
fi
@@ -108,7 +112,7 @@ fi
exec >&7
# Fill-in the reported-by info
-[ -f "samples/${CT_TARGET}/reported.by" ] && . "samples/${CT_TARGET}/reported.by"
+[ -f "${samp_dir}/reported.by" ] && . "${samp_dir}/reported.by"
old_name="${reporter_name}"
old_url="${reporter_url}"
read -p "Reporter name [${reporter_name}]: " reporter_name
@@ -123,4 +127,4 @@ reporter_comment=$(cat)
( echo "reporter_name=\"${reporter_name:=${old_name}}\""
echo "reporter_url=\"${reporter_url:=${old_url}}\""
printf "reporter_comment=\"${reporter_comment}\"\n"
-) >"samples/${CT_TARGET}/reported.by"
+) >"${samp_dir}/reported.by"
diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh
index f06a183..e952d64 100755
--- a/scripts/showSamples.sh
+++ b/scripts/showSamples.sh
@@ -34,6 +34,12 @@ dump_single_sample() {
[ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" || printf " "
echo "]"
if [ ${verbose} -ne 0 ]; then
+ case "${CT_TOOLCHAIN_TYPE}" in
+ cross) ;;
+ canadian)
+ printf " Host : ${CT_HOST}\n"
+ ;;
+ esac
echo " OS : ${CT_KERNEL}${CT_KERNEL_VERSION:+-}${CT_KERNEL_VERSION}"
if [ "${CT_GMP_MPFR}" = "y" ]; then
echo " GMP/MPFR : gmp-${CT_GMP_VERSION} / mpfr-${CT_MPFR_VERSION}"
@@ -64,8 +70,13 @@ dump_single_sample() {
printf "| "
[ "${CT_EXPERIMENTAL}" = "y" ] && printf "X"
[ -f "${sample_top}/samples/${sample}/broken" ] && printf "B"
- printf ' '
- printf "| ''${CT_KERNEL}'' |"
+ printf ' | '
+ case "${CT_TOOLCHAIN_TYPE}" in
+ cross) ;;
+ canadian) printf "${CT_HOST}";;
+ *) ;;
+ esac
+ printf " | ''${CT_KERNEL}'' |"
if [ "${CT_KERNEL}" != "bare-metal" ];then
if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" = "y" ]; then
printf " //custom// "
@@ -102,13 +113,7 @@ dump_single_sample() {
printf "| [[http://ymorin.is-a-geek.org/|YEM]] "
fi
)
- sample_updated=$(date -u "+%Y%m%d" \
- -d "$(LC_ALL=C svn info ${sample_top}/samples/${sample} \
- |GREP_OPTIONS= "${grep}" -E '^Last Changed Date:' \
- |"${sed}" -r -e 's/^[^:]+: //;' \
- -e 's/^(.+:.. [+-][[:digit:]]{4}) \(.+\)$/\1/;' \
- )" \
- )
+ sample_updated="$( hg log -l 1 --template '{date|shortdate}' "${sample_top}/samples/${sample}" )"
printf "| ${sample_updated} "
echo "|"
fi
@@ -124,6 +129,7 @@ if [ "${opt}" = -w ]; then
echo "^ @@DATE@@ ^ |||||||||||||"
printf "^ Target "
printf "^ Status "
+ printf "^ Host "
printf "^ Kernel headers\\\\\\\\ version ^"
printf "^ binutils\\\\\\\\ version "
printf "^ C compiler\\\\\\\\ version ^"
diff --git a/scripts/wrapper.in b/scripts/wrapper.in
new file mode 100644
index 0000000..1c501eb
--- /dev/null
+++ b/scripts/wrapper.in
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+canonicalizedname=$(readlink -nm "${0}")
+dirname="$(dirname "${canonicalizedname}")"
+basename="$(basename "${canonicalizedname}")"
+
+ld_lib_path="$(dirname "${dirname}")/lib"
+
+case ":${LD_LIBRARY_PATH}:" in
+ *":${ld_lib_path}:"*) ;;
+ *) LD_LIBRARY_PATH="${ld_lib_path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}";;
+esac
+
+export LD_LIBRARY_PATH
+exec "${dirname}/.${basename}" "$@"
diff --git a/steps.mk b/steps.mk
index bb25061..ba90f79 100644
--- a/steps.mk
+++ b/steps.mk
@@ -21,6 +21,8 @@ CT_STEPS := libc_check_config \
gmp \
mpfr \
ppl \
+ cloog \
+ mpc \
binutils \
elf2flt \
cc_core_pass_1 \