diff options
Diffstat (limited to 'main/gcc')
-rw-r--r-- | main/gcc/09_all_gcc-4.5-Wtrampolines.patch | 64 | ||||
-rw-r--r-- | main/gcc/15_all_gcc-libgomp-no-werror.patch | 16 | ||||
-rw-r--r-- | main/gcc/50_all_pr45312-kernel-miscompile.patch | 181 | ||||
-rw-r--r-- | main/gcc/51_all_gcc-3.4-libiberty-pic.patch | 10 | ||||
-rw-r--r-- | main/gcc/APKBUILD | 317 | ||||
-rw-r--r-- | main/gcc/PR32219.patch | 101 | ||||
-rw-r--r-- | main/gcc/boehem-gc-uclibc.patch | 11 | ||||
-rw-r--r-- | main/gcc/gcc-4.5-dynamic-linker.patch | 457 | ||||
-rw-r--r-- | main/gcc/gcc-pure64.patch | 12 | ||||
-rw-r--r-- | main/gcc/gcc-spec-env.patch | 41 | ||||
-rw-r--r-- | main/gcc/gcc4-stack-protector-uclibc-no_tls.patch | 84 | ||||
-rw-r--r-- | main/gcc/pt_gnu_eh_frame.patch | 12 | ||||
-rw-r--r-- | main/gcc/uclibc-getipinfo.patch | 19 |
13 files changed, 1325 insertions, 0 deletions
diff --git a/main/gcc/09_all_gcc-4.5-Wtrampolines.patch b/main/gcc/09_all_gcc-4.5-Wtrampolines.patch new file mode 100644 index 000000000..9c95c1e94 --- /dev/null +++ b/main/gcc/09_all_gcc-4.5-Wtrampolines.patch @@ -0,0 +1,64 @@ +2010-07-15 Magnus Granberg <zorry@gentoo.org> + Kevin F. Quinn <kevquinn@gentoo.org> + + * builtins.c (expand_builtin_init_trampoline): If + -Wtrampolines make a warning. + * common.opt: Add -Wtrampolines. + * doc/invoke.texi: Add -Wtrampolines. + +2010-07-31 Magnus Granberg <zorry@gentoo.org> + + #328451 set -Wtrampolines as default + +http://gcc.gnu.org/viewcvs?view=revision&revision=162205 + +--- a/gcc/builtins.c ++++ b/gcc/builtins.c +@@ -5155,6 +5155,10 @@ expand_builtin_init_trampoline (tree exp) + targetm.calls.trampoline_init (m_tramp, t_func, r_chain); + + trampolines_created = 1; ++ ++ warning_at (DECL_SOURCE_LOCATION (t_func), OPT_Wtrampolines, ++ "trampoline generated for nested function %qD", t_func); ++ + return const0_rtx; + } + +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -192,6 +192,10 @@ Wsystem-headers + Common Var(warn_system_headers) Warning + Do not suppress warnings from system headers + ++Wtrampolines ++Common Var(warn_trampolines) Init(1) Warning ++Warn whenever a trampoline is generated ++ + Wtype-limits + 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 +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -3611,6 +3611,21 @@ code. However, note that using @option{-Wall} in conjunction with this + option will @emph{not} warn about unknown pragmas in system + headers---for that, @option{-Wunknown-pragmas} must also be used. + ++@item -Wtrampolines ++@opindex Wtrampolines ++@opindex Wno-trampolines ++ Warn about trampolines generated for pointers to nested functions. ++ ++ NOTE: In Gentoo, @option{-Wtrampolines} is set by default. ++ To disable, specify @option{-Wno-trampolines} ++ ++ A trampoline is a small piece of data or code that is created at run ++ time on the stack when the address of a nested function is taken, and ++ is used to call the nested function indirectly. For some targets, it ++ is made up of data only and thus requires no special treatment. But, ++ for most targets, it is made up of code and thus requires the stack ++ to be made executable in order for the program to work properly. ++ + @item -Wfloat-equal + @opindex Wfloat-equal + @opindex Wno-float-equal diff --git a/main/gcc/15_all_gcc-libgomp-no-werror.patch b/main/gcc/15_all_gcc-libgomp-no-werror.patch new file mode 100644 index 000000000..1c3ec3a1e --- /dev/null +++ b/main/gcc/15_all_gcc-libgomp-no-werror.patch @@ -0,0 +1,16 @@ +libgomp does not respect --disable-werror + +http://bugs.gentoo.org/229059 +http://gcc.gnu.org/PR38436 + +--- gcc-4.3.2/libgomp/configure ++++ gcc-4.3.2/libgomp/configure +@@ -3297,7 +3297,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/main/gcc/50_all_pr45312-kernel-miscompile.patch b/main/gcc/50_all_pr45312-kernel-miscompile.patch new file mode 100644 index 000000000..b9b1a7d7f --- /dev/null +++ b/main/gcc/50_all_pr45312-kernel-miscompile.patch @@ -0,0 +1,181 @@ +GCC 4.4.4 miscompiles the Linux kernel +http://gcc.gnu.org/PR45312 +https://bugzilla.kernel.org/show_bug.cgi?id=16612 +https://bugs.gentoo.org/334269 + +--- a/gcc/reload1.c ++++ b/gcc/reload1.c +@@ -431,7 +431,6 @@ static void failed_reload (rtx, int); + static int set_reload_reg (int, int); + static void choose_reload_regs_init (struct insn_chain *, rtx *); + static void choose_reload_regs (struct insn_chain *); +-static void merge_assigned_reloads (rtx); + static void emit_input_reload_insns (struct insn_chain *, struct reload *, + rtx, int); + static void emit_output_reload_insns (struct insn_chain *, struct reload *, +@@ -4215,12 +4214,6 @@ reload_as_needed (int live_known) + Record the choices of reload reg in reload_reg_rtx. */ + choose_reload_regs (chain); + +- /* Merge any reloads that we didn't combine for fear of +- increasing the number of spill registers needed but now +- discover can be safely merged. */ +- if (SMALL_REGISTER_CLASSES) +- merge_assigned_reloads (insn); +- + /* Generate the insns to reload operands into or out of + their reload regs. */ + emit_reload_insns (chain); +@@ -6598,152 +6591,6 @@ deallocate_reload_reg (int r) + reload_spill_index[r] = -1; + } + +-/* If SMALL_REGISTER_CLASSES is nonzero, we may not have merged two +- reloads of the same item for fear that we might not have enough reload +- registers. However, normally they will get the same reload register +- and hence actually need not be loaded twice. +- +- Here we check for the most common case of this phenomenon: when we have +- a number of reloads for the same object, each of which were allocated +- the same reload_reg_rtx, that reload_reg_rtx is not used for any other +- reload, and is not modified in the insn itself. If we find such, +- merge all the reloads and set the resulting reload to RELOAD_OTHER. +- This will not increase the number of spill registers needed and will +- prevent redundant code. */ +- +-static void +-merge_assigned_reloads (rtx insn) +-{ +- int i, j; +- +- /* Scan all the reloads looking for ones that only load values and +- are not already RELOAD_OTHER and ones whose reload_reg_rtx are +- assigned and not modified by INSN. */ +- +- for (i = 0; i < n_reloads; i++) +- { +- int conflicting_input = 0; +- int max_input_address_opnum = -1; +- int min_conflicting_input_opnum = MAX_RECOG_OPERANDS; +- +- if (rld[i].in == 0 || rld[i].when_needed == RELOAD_OTHER +- || rld[i].out != 0 || rld[i].reg_rtx == 0 +- || reg_set_p (rld[i].reg_rtx, insn)) +- continue; +- +- /* Look at all other reloads. Ensure that the only use of this +- reload_reg_rtx is in a reload that just loads the same value +- as we do. Note that any secondary reloads must be of the identical +- class since the values, modes, and result registers are the +- same, so we need not do anything with any secondary reloads. */ +- +- for (j = 0; j < n_reloads; j++) +- { +- if (i == j || rld[j].reg_rtx == 0 +- || ! reg_overlap_mentioned_p (rld[j].reg_rtx, +- rld[i].reg_rtx)) +- continue; +- +- if (rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS +- && rld[j].opnum > max_input_address_opnum) +- max_input_address_opnum = rld[j].opnum; +- +- /* If the reload regs aren't exactly the same (e.g, different modes) +- or if the values are different, we can't merge this reload. +- But if it is an input reload, we might still merge +- RELOAD_FOR_INPUT_ADDRESS and RELOAD_FOR_OTHER_ADDRESS reloads. */ +- +- if (! rtx_equal_p (rld[i].reg_rtx, rld[j].reg_rtx) +- || rld[j].out != 0 || rld[j].in == 0 +- || ! rtx_equal_p (rld[i].in, rld[j].in)) +- { +- if (rld[j].when_needed != RELOAD_FOR_INPUT +- || ((rld[i].when_needed != RELOAD_FOR_INPUT_ADDRESS +- || rld[i].opnum > rld[j].opnum) +- && rld[i].when_needed != RELOAD_FOR_OTHER_ADDRESS)) +- break; +- conflicting_input = 1; +- if (min_conflicting_input_opnum > rld[j].opnum) +- min_conflicting_input_opnum = rld[j].opnum; +- } +- } +- +- /* If all is OK, merge the reloads. Only set this to RELOAD_OTHER if +- we, in fact, found any matching reloads. */ +- +- if (j == n_reloads +- && max_input_address_opnum <= min_conflicting_input_opnum) +- { +- gcc_assert (rld[i].when_needed != RELOAD_FOR_OUTPUT); +- +- for (j = 0; j < n_reloads; j++) +- if (i != j && rld[j].reg_rtx != 0 +- && rtx_equal_p (rld[i].reg_rtx, rld[j].reg_rtx) +- && (! conflicting_input +- || rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS +- || rld[j].when_needed == RELOAD_FOR_OTHER_ADDRESS)) +- { +- rld[i].when_needed = RELOAD_OTHER; +- rld[j].in = 0; +- reload_spill_index[j] = -1; +- transfer_replacements (i, j); +- } +- +- /* If this is now RELOAD_OTHER, look for any reloads that +- load parts of this operand and set them to +- RELOAD_FOR_OTHER_ADDRESS if they were for inputs, +- RELOAD_OTHER for outputs. Note that this test is +- equivalent to looking for reloads for this operand +- number. +- +- We must take special care with RELOAD_FOR_OUTPUT_ADDRESS; +- it may share registers with a RELOAD_FOR_INPUT, so we can +- not change it to RELOAD_FOR_OTHER_ADDRESS. We should +- never need to, since we do not modify RELOAD_FOR_OUTPUT. +- +- It is possible that the RELOAD_FOR_OPERAND_ADDRESS +- instruction is assigned the same register as the earlier +- RELOAD_FOR_OTHER_ADDRESS instruction. Merging these two +- instructions will cause the RELOAD_FOR_OTHER_ADDRESS +- instruction to be deleted later on. */ +- +- if (rld[i].when_needed == RELOAD_OTHER) +- for (j = 0; j < n_reloads; j++) +- if (rld[j].in != 0 +- && rld[j].when_needed != RELOAD_OTHER +- && rld[j].when_needed != RELOAD_FOR_OTHER_ADDRESS +- && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS +- && rld[j].when_needed != RELOAD_FOR_OPERAND_ADDRESS +- && (! conflicting_input +- || rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS +- || rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS) +- && reg_overlap_mentioned_for_reload_p (rld[j].in, +- rld[i].in)) +- { +- int k; +- +- rld[j].when_needed +- = ((rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS +- || rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS) +- ? RELOAD_FOR_OTHER_ADDRESS : RELOAD_OTHER); +- +- /* Check to see if we accidentally converted two +- reloads that use the same reload register with +- different inputs to the same type. If so, the +- resulting code won't work. */ +- if (rld[j].reg_rtx) +- for (k = 0; k < j; k++) +- gcc_assert (rld[k].in == 0 || rld[k].reg_rtx == 0 +- || rld[k].when_needed != rld[j].when_needed +- || !rtx_equal_p (rld[k].reg_rtx, +- rld[j].reg_rtx) +- || rtx_equal_p (rld[k].in, +- rld[j].in)); +- } +- } +- } +-} +- + /* These arrays are filled by emit_reload_insns and its subroutines. */ + static rtx input_reload_insns[MAX_RECOG_OPERANDS]; + static rtx other_input_address_reload_insns = 0; diff --git a/main/gcc/51_all_gcc-3.4-libiberty-pic.patch b/main/gcc/51_all_gcc-3.4-libiberty-pic.patch new file mode 100644 index 000000000..d9a95a21b --- /dev/null +++ b/main/gcc/51_all_gcc-3.4-libiberty-pic.patch @@ -0,0 +1,10 @@ +--- gcc-4.1.0-orig/libiberty/Makefile.in 2006-03-01 15:49:14.000000000 -0500 ++++ gcc-4.1.0/libiberty/Makefile.in 2006-03-01 18:10:46.000000000 -0500 +@@ -232,6 +232,7 @@ + $(AR) $(AR_FLAGS) $(TARGETLIB) \ + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ + $(RANLIB) $(TARGETLIB); \ ++ cp $(TARGETLIB) ../ ; \ + cd ..; \ + else true; fi + diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD new file mode 100644 index 000000000..1c2c0d72f --- /dev/null +++ b/main/gcc/APKBUILD @@ -0,0 +1,317 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=gcc +pkgver=4.5.3 +_piepatchver=0.4.5 +_specs_ver=0.2.0 +_specs_gcc_ver=4.4.3 + +_uclibc_abiver=0.9.32 + +pkgrel=0 +pkgdesc="The GNU Compiler Collection" +url="http://gcc.gnu.org" +arch="all" +license="GPL LGPL" +depends="binutils libgcc libgomp libobjc" +makedepends="bison flex gmp-dev mpfr-dev texinfo libmpc-dev gawk zlib-dev zip" +subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp" +replaces="libstdc++" + +if [ "$LANG_OBJC" != "off" ]; then + subpackages="$subpackages libobjc" +fi +if [ "$LANG_JAVA" != "off" ]; then + subpackages="$subpackages $pkgname-java libgcj" +fi + +source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-core-$pkgver.tar.bz2 + ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-g++-$pkgver.tar.bz2 + ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-objc-$pkgver.tar.bz2 + ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-java-$pkgver.tar.bz2 + http://distfiles.gentoo.org/distfiles/gcc-4.5.1-piepatches-v${_piepatchver}.tar.bz2 + http://distfiles.gentoo.org/distfiles/gcc-$_specs_gcc_ver-specs-$_specs_ver.tar.bz2 + ftp://sourceware.org/pub/java/ecj-latest.jar + + 09_all_gcc-4.5-Wtrampolines.patch + 15_all_gcc-libgomp-no-werror.patch + 51_all_gcc-3.4-libiberty-pic.patch + + gcc-spec-env.patch + pt_gnu_eh_frame.patch + uclibc-getipinfo.patch + gcc-4.5-dynamic-linker.patch + PR32219.patch + boehem-gc-uclibc.patch + gcc-pure64.patch + " + +# we build out-of-tree +_gccdir="$srcdir"/gcc-$pkgver +_builddir="$srcdir/build" + +prepare() { + cd "$_gccdir" + # verify we have set CHOST + if [ -z "$CHOST" ]; then + error "CHOST not set" + return 1 + fi + + # PIE patches from gentoo + # thanks to Zorry for hard work on those patches + for i in "$srcdir"/piepatch/*.patch; do + msg "Applying $i" + patch -p0 -i $i || return 1 + done + + # Gentoo and uclibc patches + for i in $source; do + case "$i" in + *.patch) + msg "Applying $i" + patch -p1 -i "$srcdir"/$i || return 1 + ;; + esac + done + + #PR33200 + sed -i 's/use_fixproto=yes/:/' gcc/config.gcc || return 1 + + # enable hardened cflags by default + # building gcc wih PIE seem to hit some strange bug. we probably run + # out of some resource. so we disable PIE for gcc while enabling it + # by default for everything else. + local _hard_cflags="-DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW" + sed -e "/^ALL_CFLAGS/iHARD_CFLAGS = ${_hard_cflags}" \ + -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) -fno-PIE |' \ + -i gcc/Makefile.in || return 1 + sed -e "/stage1_cflags=/s/-fno-stack-protector/-fno-stack-protector -fno-PIE/" \ + -i configure + + # see http://gcc.gnu.org/ml/java/2008-04/msg00027.html + mv "$srcdir"/ecj-latest.jar ecj.jar + + echo ${pkgver} > gcc/BASE-VER +} + +build() { + local _languages= _dynamic_linker= + cd "$_gccdir" + export CFLAGS="-fno-stack-protector" + [ -z "$CBUILD" ] && CBUILD="$CHOST" + [ -z "$CTARGET" ] && CTARGET="$CHOST" + + case "$CHOST" in + x86_64-*-uclibc) + _dynamic_linker="--with-dynamic-linker=ld64-uClibc.so.$_uclibc_abiver" + ;; + *-uclibc) + _dynamic_linker="--with-dynamic-linker=ld-uClibc.so.$_uclibc_abiver" + ;; + *) _dynamic_linker= + ;; + esac + + _languages=c,c++ + # we can disable OBJC with LANG_OBJC=off + if [ "$LANG_OBJC" != "off" ]; then + _languages=$_languages,objc + fi + + # and disable java with LANG_JAVA=off + if [ "$LANG_JAVA" != "off" ]; then + _languages="$_languages,java" + fi + + # --enable-target-optspace is broken on powerpc + if [ "$CARCH" != "powerpc" ]; then + _target_optspace="--enable-target-optspace" + fi + + msg "Building the following:" + echo "" + echo " CBUILD=$CBUILD" + echo " CHOST=$CHOST" + echo " CTARGET=$CTARGET" + echo " languages=$_languages" + echo " dynamic_linker=$_dynamic_linker" + echo " target_optspace=$_target_optspace" + echo "" + + mkdir -p "$_builddir" + cd "$_builddir" + "$_gccdir"/configure --prefix=/usr \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --build=${CBUILD} \ + --host=${CHOST} \ + --target=${CTARGET} \ + --with-pkgversion='Alpine' \ + --disable-altivec \ + --disable-checking \ + --disable-fixed-point \ + --disable-libssp \ + --disable-libstdcxx-pch \ + --disable-multilib \ + --disable-nls \ + --disable-werror \ + --enable-__cxa_atexit \ + --enable-cld \ + --enable-esp \ + --enable-languages=$_languages \ + --enable-shared \ + $_target_optspace \ + --enable-tls \ + --enable-threads \ + $_dynamic_linker \ + --with-dynamic-linker-prefix=/lib \ + --with-system-zlib \ + --without-system-libunwind + + make || return 1 +} + +package() { + cd "$_builddir" + make -j1 DESTDIR="${pkgdir}" install || return 1 + ln -s gcc "$pkgdir"/usr/bin/cc + + # binutils provides libiberty.a + rm -f "$pkgdir"/usr/lib/libiberty.a + + # install the specs + cd "$srcdir"/specs + install -d "$pkgdir"/usr/share/gcc + for i in *.specs; do + install -m644 $i "$pkgdir"/usr/share/gcc/$i || return 1 + done + + # we dont support gcj -static + # and saving 35MB is not bad. + find "$pkgdir" -name libgcj.a -o -name libgtkpeer.a \ + -o -name libgjsmalsa.a -o -name libgcj-tools.a \ + -o -name libjvm.a -o -name libgij.a -o -name libgcj_bc.a \ + -o -name libjavamath.a \ + | xargs rm -f \ + || return 1 + + [ "$LANG_JAVA" = "on" ] && \ + sed -i -e 's/lib: /&%{static:%eJava programs cannot be linked statically}/' \ + "$pkdir"/usr/lib/libgcj.spec + + # remove ffi + rm "$pkgdir"/usr/lib/libffi* + find "$pkgdir" -name 'ffi*.h' | xargs rm -f + + mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/lib + mv "$pkgdir"/usr/lib/*-gdb.py \ + "$pkgdir"/usr/share/gdb/python/auto-load/usr/lib/ +} + +libcxx() { + pkgdesc="GNU C++ standard runtime library" + depends= + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libstdc++.so.* "$subpkgdir"/usr/lib/ +} + +gpp() { + pkgdesc="GNU C++ standard library and compiler" + depends="libstdc++" + local libexec=usr/libexec/gcc/${CHOST:-$_chost}/$pkgver + mkdir -p "$subpkgdir/$libexec" \ + "$subpkgdir"/usr/bin \ + "$subpkgdir"/usr/include \ + "$subpkgdir"/usr/lib \ + + mv "$pkgdir/$libexec/cc1plus" "$subpkgdir/$libexec/" + mv "$pkgdir"/usr/lib/*++* "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/include/c++ "$subpkgdir"/usr/include/ + mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/ +} + +libobjc() { + pkgdesc="GNU ObjectiveC library" + replaces="objc" + mkdir -p "$subpkgdir"/usr/lib + + mv "$pkgdir"/usr/lib/*objc* "$subpkgdir"/usr/lib/ +} + +libgcc() { + pkgdesc="GNU C compiler runtime libraries" + depends= + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libgcc_s.so.* "$subpkgdir"/usr/lib/ +} + +libgomp() { + pkgdesc="GCC shared-memory parallel programming API library" + depends= + replaces="gcc" + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libgomp.so.* "$subpkgdir"/usr/lib/ +} + +java() { + pkgdesc="Java support for GCC" + mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib + cd "$pkgdir"/usr/bin + mv gcj gcj-dbtool gjavah gcjh jcf-dump "$subpkgdir"/usr/bin/ + cd "$pkgdir" + for i in $(find usr/ -name ecj1 -o -name jc1 -o -name jvgenmain); do + mkdir -p "$subpkgdir"/${i%/*} + mv "$pkgdir"/$i "$subpkgdir"/$i || return 1 + done + mv \ + "$pkgdir"/usr/lib/libgcj*.so \ + "$pkgdir"/usr/lib/libgcj*.la \ + "$pkgdir"/usr/lib/libgij.so \ + "$pkgdir"/usr/lib/libgij.la \ + "$pkgdir"/usr/lib/libgcj.spec \ + "$subpkgdir"/usr/lib/ +} + +libgcj() { + pkgdesc="Java runtime library for gcc" + mkdir -p "$subpkgdir"/usr/bin + cd "$pkgdir"/usr/bin + mv aot-compile gappletviewer gc-analyze gij gjar gjarsigner gkeytool\ + gnative2ascii gorbd grmic grmid grmiregistry gserialver \ + gtnameserv i486-alpine-linux-uclibc-gcj jv-convert \ + rebuild-gcj-db \ + "$subpkgdir"/usr/bin/ + cd "$pkgdir" + for i in $(find usr/lib -name jc1 -o -name jvgenmain); do + mkdir -p "$subpkgdir"/${i%/*} + mv "$pkgdir"/$i "$subpkgdir"/$i || return 1 + done + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/gcj-* \ + "$pkgdir"/usr/lib/libgcj*.so.* \ + "$pkgdir"/usr/lib/libgij.so.* \ + "$pkgdir"/usr/lib/logging.properties \ + "$pkgdir"/usr/lib/security \ + "$subpkgdir"/usr/lib/ + + mkdir -p "$subpkgdir"/usr/share/ + mv "$pkgdir"/usr/share/java "$subpkgdir"/usr/share/ +} + +md5sums="98be5094b5b5a7b9087494291bc7f522 gcc-core-4.5.3.tar.bz2 +2c78bf1d5f08a0b116f280de88d3ffe7 gcc-g++-4.5.3.tar.bz2 +9bb53e37e589515ba55979a19be9c036 gcc-objc-4.5.3.tar.bz2 +08e045fdbdc22ac9af3aec3b8d16dbab gcc-java-4.5.3.tar.bz2 +1f86fe5dc7d506b7fc04fcd8b7d2693c gcc-4.5.1-piepatches-v0.4.5.tar.bz2 +441c76504e1d97170117c294e65c7a72 gcc-4.4.3-specs-0.2.0.tar.bz2 +d7cd6a27c8801e66cbaa964a039ecfdb ecj-latest.jar +ab090760506eb70aa4436a349c6bd788 09_all_gcc-4.5-Wtrampolines.patch +1c00bd9d12891a3e2311b32b98deb6fa 15_all_gcc-libgomp-no-werror.patch +45951dd3bbc979c9e043c7203745cf31 51_all_gcc-3.4-libiberty-pic.patch +c4045bfa85d8be780affd465be9d8ca8 gcc-spec-env.patch +2db1e3482c5dd59dab70f701afa2ca80 pt_gnu_eh_frame.patch +6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch +7f35da0f88f4d9c3d3839498bbda0eb3 gcc-4.5-dynamic-linker.patch +6c866c7fb8d56deb8f6d652bee64e228 PR32219.patch +2c6cb49bb9bfd8b6e690222e66ccc901 boehem-gc-uclibc.patch +d1d3ad2b0c185b5548125a1b81bee154 gcc-pure64.patch" diff --git a/main/gcc/PR32219.patch b/main/gcc/PR32219.patch new file mode 100644 index 000000000..b926e941f --- /dev/null +++ b/main/gcc/PR32219.patch @@ -0,0 +1,101 @@ +From gcc-patches-return-258497-listarch-gcc-patches=gcc dot gnu dot org at gcc dot gnu dot org Tue Mar 16 13:32:55 2010 +Return-Path: <gcc-patches-return-258497-listarch-gcc-patches=gcc dot gnu dot org at gcc dot gnu dot org> +Delivered-To: listarch-gcc-patches at gcc dot gnu dot org +Received: (qmail 25550 invoked by alias); 16 Mar 2010 13:32:54 -0000 +Received: (qmail 25534 invoked by uid 22791); 16 Mar 2010 13:32:53 -0000 +X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,SUBJ_ALL_CAPS +X-Spam-Check-By: sourceware.org +Received: from mail-bw0-f210.google.com (HELO mail-bw0-f210.google.com) (209.85.218.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Mar 2010 13:32:48 +0000 +Received: by bwz2 with SMTP id 2so4002140bwz.30 for <multiple recipients>; Tue, 16 Mar 2010 06:32:45 -0700 (PDT) +Received: by 10.204.14.84 with SMTP id f20mr2900449bka.209.1268746365293; Tue, 16 Mar 2010 06:32:45 -0700 (PDT) +Received: from s42.loc (85-127-85-230.dynamic.xdsl-line.inode.at [85.127.85.230]) by mx.google.com with ESMTPS id 14sm3626793bwz.14.2010.03.16.06.32.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 16 Mar 2010 06:32:44 -0700 (PDT) +Received: from cow by s42.loc with local (Exim 4.71) (envelope-from <rep.dot.nop@gmail.com>) id 1NrX2W-0008Nj-5o; Tue, 16 Mar 2010 14:42:32 +0100 +From: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com> +To: gcc-patches at gcc dot gnu dot org +Cc: rguenth at gcc dot gnu dot org, Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com> +Subject: [PATCH] PR32219 +Date: Tue, 16 Mar 2010 14:42:27 +0100 +Message-Id: <1268746947-32108-1-git-send-email-rep.dot.nop@gmail.com> +Mailing-List: contact gcc-patches-help at gcc dot gnu dot org; run by ezmlm +Precedence: bulk +List-Id: <gcc-patches.gcc.gnu.org> +List-Archive: <http://gcc.gnu.org/ml/gcc-patches/> +List-Post: <mailto:gcc-patches at gcc dot gnu dot org> +List-Help: <mailto:gcc-patches-help at gcc dot gnu dot org> +Sender: gcc-patches-owner at gcc dot gnu dot org +Delivered-To: mailing list gcc-patches at gcc dot gnu dot org + +Hi, + +As suggested by richi. +regtested on i686-linux-gnu with all default languages and no regressions. +Ok for trunk? + +gcc/ChangeLog +2010-03-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org> + + PR target/32219 + * varasm.c (default_binds_local_p_1): Weak data is not local. + +gcc/testsuite/ChangeLog +2010-03-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org> + + PR target/32219 + * gcc.dg/visibility-21.c: New test. + +Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> +--- + gcc/testsuite/gcc.dg/visibility-21.c | 14 ++++++++++++++ + gcc/varasm.c | 8 ++++---- + 2 files changed, 18 insertions(+), 4 deletions(-) + create mode 100644 gcc/testsuite/gcc.dg/visibility-21.c + +diff --git a/gcc/testsuite/gcc.dg/visibility-21.c b/gcc/testsuite/gcc.dg/visibility-21.c +new file mode 100644 +index 0000000..be7deda +--- /dev/null ++++ b/gcc/testsuite/gcc.dg/visibility-21.c +@@ -0,0 +1,14 @@ ++/* PR target/32219 */ ++/* { dg-do run } */ ++/* { dg-require-visibility "" } */ ++/* { dg-options "-fPIC" { target fpic } } */ ++ ++extern void f() __attribute__((weak,visibility("hidden"))); ++extern int puts( char const* ); ++int main() ++{ ++ if (f) ++ f(); ++ return 0; ++} ++ +diff --git a/gcc/varasm.c b/gcc/varasm.c +index 6b8222f..6b9269a 100644 +--- a/gcc/varasm.c ++++ b/gcc/varasm.c +@@ -6613,6 +6613,10 @@ default_binds_local_p_1 (const_tree exp, int shlib) + /* Static variables are always local. */ + else if (! TREE_PUBLIC (exp)) + local_p = true; ++ /* Weak data can be overridden by a strong symbol ++ in another module and so are not local. */ ++ else if (DECL_WEAK (exp)) ++ local_p = false; + /* A variable is local if the user has said explicitly that it will + be. */ + else if (DECL_VISIBILITY_SPECIFIED (exp) +@@ -6625,10 +6629,6 @@ default_binds_local_p_1 (const_tree exp, int shlib) + local. */ + else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) + local_p = true; +- /* Default visibility weak data can be overridden by a strong symbol +- in another module and so are not local. */ +- else if (DECL_WEAK (exp)) +- local_p = false; + /* If PIC, then assume that any global name can be overridden by + symbols resolved from other modules, unless we are compiling with + -fwhole-program, which assumes that names are local. */ +-- +1.7.0 + diff --git a/main/gcc/boehem-gc-uclibc.patch b/main/gcc/boehem-gc-uclibc.patch new file mode 100644 index 000000000..0fa688410 --- /dev/null +++ b/main/gcc/boehem-gc-uclibc.patch @@ -0,0 +1,11 @@ +--- ./boehm-gc/include/gc.h.orig ++++ ./boehm-gc/include/gc.h +@@ -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/main/gcc/gcc-4.5-dynamic-linker.patch b/main/gcc/gcc-4.5-dynamic-linker.patch new file mode 100644 index 000000000..a11c7f934 --- /dev/null +++ b/main/gcc/gcc-4.5-dynamic-linker.patch @@ -0,0 +1,457 @@ +commit d929f627aba264e63cf779cd4ca51af97b076445 +Author: Natanael Copa <ncopa@alpinelinux.org> +Date: Tue Sep 28 09:45:17 2010 +0000 + + Submitted By: Kevin Day <thekevinday AT gmail DOT com> + Date: 2008-12-19 + Initial Package Version: 4.3.2 + Upstream Status: Not submitted + Description: Why not just be able to define the prefix of the dynamic linker instead of hardcoding it.. + This includes the --nostdinc patch as well, so think of this as a specs-3 patch + This also allows for specifying the dynamic-linker as well + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index ae2416b..b0b9b2c 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -971,7 +971,7 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@ + # This is the variable actually used when we compile. If you change this, + # you probably want to update BUILD_CFLAGS in configure.ac + ALL_CFLAGS = $(T_CFLAGS) \ +- $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ ++ $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ @NOSTDINC@ + + # The C++ version. + ALL_CXXFLAGS = $(T_CFLAGS) $(CXXFLAGS) $(INTERNAL_CFLAGS) \ +@@ -2105,6 +2105,8 @@ DRIVER_DEFINES = \ + -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \ + -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ + -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \ ++ -DDYNAMIC_LINKER_PREFIX=\"@DYNAMICLINKERPREFIX@\" \ ++ -DDYNAMIC_LINKER=\"@DYNAMICLINKER@\" \ + -DDEFAULT_TARGET_VERSION=\"$(version)\" \ + -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \ + -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \ +diff --git a/gcc/config/alpha/gnu.h b/gcc/config/alpha/gnu.h +index f98c3e7..bd16dcf 100644 +--- a/gcc/config/alpha/gnu.h ++++ b/gcc/config/alpha/gnu.h +@@ -34,7 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + } while (0) + + #undef ELF_DYNAMIC_LINKER +-#define ELF_DYNAMIC_LINKER "/lib/ld.so" ++#define ELF_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef STARTFILE_SPEC + #define STARTFILE_SPEC \ +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index c48fc93..3068717 100644 +--- a/gcc/config/alpha/linux-elf.h ++++ b/gcc/config/alpha/linux-elf.h +@@ -27,8 +27,8 @@ along with GCC; see the file COPYING3. If not see + #define EXTRA_SPECS \ + { "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define UCLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + #if UCLIBC_DEFAULT + #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" + #else +diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h +index fce1ed1..c3bcd50 100644 +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -61,7 +61,7 @@ + /* Use ld-linux.so.3 so that it will be possible to run "classic" + GNU/Linux binaries on an EABI system. */ + #undef GLIBC_DYNAMIC_LINKER +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index 9fdca41..65b0a5a 100644 +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -62,7 +62,7 @@ + + #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \ + %{b} \ +diff --git a/gcc/config/bfin/linux.h b/gcc/config/bfin/linux.h +index 5c716cd..b5e464e 100644 +--- a/gcc/config/bfin/linux.h ++++ b/gcc/config/bfin/linux.h +@@ -45,7 +45,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + %{shared:-G -Bdynamic} \ + %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +- %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \ ++ %{!dynamic-linker:-dynamic-linker DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER}} \ + %{static}} -init __init -fini __fini" + + #define MD_UNWIND_SUPPORT "config/bfin/linux-unwind.h" +diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h +index 38f0a7e..6893407 100644 +--- a/gcc/config/cris/linux.h ++++ b/gcc/config/cris/linux.h +@@ -103,7 +103,7 @@ along with GCC; see the file COPYING3. If not see + #undef CRIS_DEFAULT_CPU_VERSION + #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + /* We need an -rpath-link to ld.so.1, and presumably to each directory + specified with -B. */ +diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h +index 84d8127..fb3e79a 100644 +--- a/gcc/config/freebsd-spec.h ++++ b/gcc/config/freebsd-spec.h +@@ -144,9 +144,9 @@ is built with the --enable-threads configure-time option.} \ + #endif + + #if FBSD_MAJOR < 6 +-#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1" ++#define FBSD_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + #else +-#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1" ++#define FBSD_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + #endif + + #if defined(HAVE_LD_EH_FRAME_HDR) +diff --git a/gcc/config/frv/linux.h b/gcc/config/frv/linux.h +index 71cd094..221d01d 100644 +--- a/gcc/config/frv/linux.h ++++ b/gcc/config/frv/linux.h +@@ -35,7 +35,7 @@ + #define ENDFILE_SPEC \ + "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef LINK_SPEC + #define LINK_SPEC "\ +diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h +index 2a31880..9c08adb 100644 +--- a/gcc/config/i386/linux.h ++++ b/gcc/config/i386/linux.h +@@ -100,7 +100,7 @@ along with GCC; see the file COPYING3. If not see + + /* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */ + #define LINK_EMULATION "elf_i386" +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef ASM_SPEC + #define ASM_SPEC \ +diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h +index 867de59..274acca 100644 +--- a/gcc/config/i386/linux64.h ++++ b/gcc/config/i386/linux64.h +@@ -58,8 +58,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + When the -shared link option is used a final link is not being + done. */ + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" ++#define GLIBC_DYNAMIC_LINKER32 "/" DYNAMIC_LINKER ++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #if TARGET_64BIT_DEFAULT + #define SPEC_32 "m32" +diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h +index 587a4f4..450fcb5 100644 +--- a/gcc/config/ia64/linux.h ++++ b/gcc/config/ia64/linux.h +@@ -61,7 +61,7 @@ do { \ + /* Define this for shared library support because it isn't in the main + linux.h file. */ + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef LINK_SPEC + #define LINK_SPEC "\ +diff --git a/gcc/config/knetbsd-gnu.h b/gcc/config/knetbsd-gnu.h +index 4cc8eb7..bb7a063 100644 +--- a/gcc/config/knetbsd-gnu.h ++++ b/gcc/config/knetbsd-gnu.h +@@ -34,5 +34,5 @@ along with GCC; see the file COPYING3. If not see + + #ifdef GLIBC_DYNAMIC_LINKER + #undef GLIBC_DYNAMIC_LINKER +-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + #endif +diff --git a/gcc/config/linux.h b/gcc/config/linux.h +index e567e9a..c052fd0 100644 +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -117,9 +117,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + GLIBC_DYNAMIC_LINKER must be defined for each target using them, or + GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets + supporting both 32-bit and 64-bit compilation. */ +-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" +-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" ++#define UCLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define UCLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define UCLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + #define LINUX_DYNAMIC_LINKER \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) + #define LINUX_DYNAMIC_LINKER32 \ +@@ -135,3 +135,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define TARGET_HAS_SINCOS (OPTION_GLIBC) + + #define TARGET_POSIX_IO ++ ++#ifdef NOSTDINC ++#undef STANDARD_INCLUDE_DIR ++#define STANDARD_INCLUDE_DIR 0 ++#endif +diff --git a/gcc/config/m32r/linux.h b/gcc/config/m32r/linux.h +index 0515e5b..019e850 100644 +--- a/gcc/config/m32r/linux.h ++++ b/gcc/config/m32r/linux.h +@@ -58,7 +58,7 @@ + + /* If ELF is the default format, we should not use /lib/elf. */ + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef LINK_SPEC + #if TARGET_LITTLE_ENDIAN +diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h +index 1d73ee0..e57cf50 100644 +--- a/gcc/config/m68k/linux.h ++++ b/gcc/config/m68k/linux.h +@@ -84,7 +84,7 @@ along with GCC; see the file COPYING3. If not see + + /* If ELF is the default format, we should not use /lib/elf. */ + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef LINK_SPEC + #define LINK_SPEC "-m m68kelf %{shared} \ +diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h +index 0512ef7..7efe2fd 100644 +--- a/gcc/config/mips/linux.h ++++ b/gcc/config/mips/linux.h +@@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see + #undef MIPS_DEFAULT_GVALUE + #define MIPS_DEFAULT_GVALUE 0 + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + /* Borrowed from sparc/linux.h */ + #undef LINK_SPEC +diff --git a/gcc/config/mips/linux64.h b/gcc/config/mips/linux64.h +index 2f24dfa..850cb22 100644 +--- a/gcc/config/mips/linux64.h ++++ b/gcc/config/mips/linux64.h +@@ -35,10 +35,10 @@ along with GCC; see the file COPYING3. If not see + %{!shared: \ + %{profile:-lc_p} %{!profile:-lc}}" + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1" +-#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1" +-#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0" ++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define GLIBC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define UCLIBC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + #define LINUX_DYNAMIC_LINKERN32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32) + +diff --git a/gcc/config/mn10300/linux.h b/gcc/config/mn10300/linux.h +index ac9f8c5..8ab78b1 100644 +--- a/gcc/config/mn10300/linux.h ++++ b/gcc/config/mn10300/linux.h +@@ -32,7 +32,7 @@ + #undef ASM_SPEC + #define ASM_SPEC "%{Wa,*:%*}" + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef LINK_SPEC + #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index da7bca3..c36e7d6 100644 +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -348,10 +348,10 @@ extern int dot_symbols; + #undef LINK_OS_DEFAULT_SPEC + #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" +-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" +-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" ++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define UCLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define UCLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + #if UCLIBC_DEFAULT + #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" + #else +diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h +index ddbcfa9..59bfd28 100644 +--- a/gcc/config/s390/linux.h ++++ b/gcc/config/s390/linux.h +@@ -72,8 +72,8 @@ along with GCC; see the file COPYING3. If not see + #define MULTILIB_DEFAULTS { "m31" } + #endif + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" +-#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1" ++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef LINK_SPEC + #define LINK_SPEC \ +diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h +index d513af8..2ad27a7 100644 +--- a/gcc/config/sh/linux.h ++++ b/gcc/config/sh/linux.h +@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see + + #define TARGET_ASM_FILE_END file_end_indicate_exec_stack + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef SUBTARGET_LINK_EMUL_SUFFIX + #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" +diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +index b12c881..83bdd8e 100644 +--- a/gcc/config/sparc/linux.h ++++ b/gcc/config/sparc/linux.h +@@ -83,7 +83,7 @@ along with GCC; see the file COPYING3. If not see + + /* If ELF is the default format, we should not use /lib/elf. */ + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef LINK_SPEC + #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ +diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h +index c2e78d7..8481a34 100644 +--- a/gcc/config/sparc/linux64.h ++++ b/gcc/config/sparc/linux64.h +@@ -109,8 +109,8 @@ along with GCC; see the file COPYING3. If not see + + /* If ELF is the default format, we should not use /lib/elf. */ + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #ifdef SPARC_BI_ARCH + +diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h +index 69ab626..ebc8e0b 100644 +--- a/gcc/config/xtensa/linux.h ++++ b/gcc/config/xtensa/linux.h +@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see + %{mlongcalls:--longcalls} \ + %{mno-longcalls:--no-longcalls}" + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER + + #undef LINK_SPEC + #define LINK_SPEC \ +diff --git a/gcc/configure b/gcc/configure +index b623a4a..230719b 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -757,6 +757,9 @@ AWK + SET_MAKE + REPORT_BUGS_TEXI + REPORT_BUGS_TO ++DYNAMICLINKER ++DYNAMICLINKERPREFIX ++NOSTDINC + PKGVERSION + onestep + CONFIGURE_SPECS +@@ -1657,6 +1660,14 @@ Optional Packages: + --with-gc={page,zone} choose the garbage collection mechanism to use + with the compiler + --with-system-zlib use installed libz ++ --with-dynamic-linker=PATH ++ specifies path to dynamic linker. ++ example: "/lib/ld-linux.so.2", where this defines "ld-linux.so.2" ++ --with-dynamic-linker-prefix=PATH ++ specifies path to dynamic linker. ++ example: "/lib/ld-linux.so.2", where this defines "/lib" ++ --with-nostdinc build gcc to ignore standard include directories. ++ You will have to use --with-local-prefix with this option. + --with-slibdir=DIR shared libraries in DIR [LIBDIR] + + Some influential environment variables: +@@ -6065,6 +6076,47 @@ fi + + + ++# Check whether --with-dynamic-linker was given. ++ ++DYNAMICLINKER="ld-linux.so.2" ; ++if test "${with_dynamic_linker+set}" = set; then ++ withval="$with_dynamic_linker" ++ case "${withval}" in ++yes) { { echo "$as_me:$LINENO: error: bad value "${withval}". Use something like --with-dynamic-linker=$DYNAMICLINKER" >&5 ++echo "$as_me: error: bad value "${withval}". Use something like --with-dynamic-linker=$DYNAMICLINKER" >&2;} ++ { (exit 1); exit 1; }; } ;; ++no) ;; ++*) DYNAMICLINKER=$withval ;; ++esac ++fi; ++ ++# Check whether --with-dynamic-linker-prefix= was given. ++ ++DYNAMICLINKERPREFIX="/lib" ; ++if test "${with_dynamic_linker_prefix+set}" = set; then ++ withval="$with_dynamic_linker_prefix" ++ case "${withval}" in ++yes) { { echo "$as_me:$LINENO: error: bad value "${withval}". Use --with-dynamic-linker-prefix=/path/to/lib/" >&5 ++echo "$as_me: error: bad value "${withval}". Use --with-dynamic-linker-prefix=/path/to/lib/" >&2;} ++ { (exit 1); exit 1; }; } ;; ++no) ;; ++*) DYNAMICLINKERPREFIX=$withval ;; ++esac ++ ++fi; ++ ++# Check whether --with-nostdinc was given. ++ ++if test "${with_nostdinc+set}" = set; then ++ withval="$with_nostdinc" ++ case "${withval}" in ++yes) NOSTDINC="-DNOSTDINC" ;; ++no) ;; ++*) NOSTDINC="-DNOSTDINC" ;; ++esac ++fi; ++ ++ + + # --------------------- + # Warnings and checking diff --git a/main/gcc/gcc-pure64.patch b/main/gcc/gcc-pure64.patch new file mode 100644 index 000000000..f9ab69326 --- /dev/null +++ b/main/gcc/gcc-pure64.patch @@ -0,0 +1,12 @@ +diff -Naur gcc-4.2.0.orig/gcc/config/i386/t-linux64 gcc-4.2.0/gcc/config/i386/t-linux64 +--- gcc-4.2.0.orig/gcc/config/i386/t-linux64 2007-05-16 19:21:19.000000000 -0400 ++++ gcc-4.2.0/gcc/config/i386/t-linux64 2007-05-18 17:04:36.000000000 -0400 +@@ -6,7 +6,7 @@ + + MULTILIB_OPTIONS = m64/m32 + MULTILIB_DIRNAMES = 64 32 +-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) ++MULTILIB_OSDIRNAMES = ../lib ../lib32 + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib diff --git a/main/gcc/gcc-spec-env.patch b/main/gcc/gcc-spec-env.patch new file mode 100644 index 000000000..9d5e666a5 --- /dev/null +++ b/main/gcc/gcc-spec-env.patch @@ -0,0 +1,41 @@ + Add support for external spec file via the GCC_SPECS env var. This + allows us to easily control pie/ssp defaults with gcc-config profiles. + + Original patch by Rob Holland. Extended to support multiple + entries separated by ':' by Kevin F. Quinn + +--- gcc-4/gcc/gcc.c ++++ gcc-4/gcc/gcc.c +@@ -6482,6 +6482,32 @@ + + /* Process any user specified specs in the order given on the command + line. */ ++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32)) ++ /* Add specs listed in GCC_SPECS. Note; in the process of separating ++ * each spec listed, the string is overwritten at token boundaries ++ * (':') with '\0', an effect of strtok_r(). ++ */ ++ GET_ENVIRONMENT (specs_file, "GCC_SPECS"); ++ if (specs_file && (strlen(specs_file) > 0)) ++ { ++ char *spec, *saveptr; ++ for (spec=strtok_r(specs_file,":",&saveptr); ++ spec!=NULL; ++ spec=strtok_r(NULL,":",&saveptr)) ++ { ++ struct user_specs *user = (struct user_specs *) ++ xmalloc (sizeof (struct user_specs)); ++ ++ user->next = (struct user_specs *) 0; ++ user->filename = spec; ++ if (user_specs_tail) ++ user_specs_tail->next = user; ++ else ++ user_specs_head = user; ++ user_specs_tail = user; ++ } ++ } ++#endif + for (uptr = user_specs_head; uptr; uptr = uptr->next) + { + char *filename = find_a_file (&startfile_prefixes, uptr->filename, diff --git a/main/gcc/gcc4-stack-protector-uclibc-no_tls.patch b/main/gcc/gcc4-stack-protector-uclibc-no_tls.patch new file mode 100644 index 000000000..c9b54adbe --- /dev/null +++ b/main/gcc/gcc4-stack-protector-uclibc-no_tls.patch @@ -0,0 +1,84 @@ +diff -u gcc/config/i386/linux.h gcc/config/i386/linux.h +--- a/gcc/config/i386/linux.h 2 Jul 2005 08:52:20 -0000 1.60 ++++ b/gcc/config/i386/linux.h 2 Jul 2005 08:52:20 -0000 1.60 +@@ -186,7 +186,7 @@ + /* This macro may be overridden in i386/k*bsd-gnu.h. */ + #define REG_NAME(reg) reg + +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ + /* i386 glibc provides __stack_chk_guard in %gs:0x14. */ + #define TARGET_THREAD_SSP_OFFSET 0x14 + #endif +diff -u gcc/config/i386/linux64.h gcc/config/i386/linux64.h +--- a/gcc/config/i386/linux64.h 2 Jul 2005 08:52:20 -0000 1.33 ++++ b/gcc/config/i386/linux64.h 2 Jul 2005 08:52:20 -0000 1.33 +@@ -74,7 +74,7 @@ + /* This macro may be overridden in i386/k*bsd-gnu.h. */ + #define REG_NAME(reg) reg + +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ + /* i386 glibc provides __stack_chk_guard in %gs:0x14, + x86_64 glibc provides it in %fs:0x28. */ + #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14) +diff -u gcc/config/rs6000/linux.h gcc/config/rs6000/linux.h +--- a/gcc/config/rs6000/linux.h 2 Jul 2005 08:52:11 -0000 1.53 ++++ b/gcc/config/rs6000/linux.h 2 Jul 2005 08:52:11 -0000 1.53 +@@ -114,7 +114,7 @@ + + #define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h" + +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ + /* ppc32 glibc provides __stack_chk_guard in -0x7008(2). */ + #define TARGET_THREAD_SSP_OFFSET -0x7008 + #endif +diff -u gcc/config/rs6000/linux64.h gcc/config/rs6000/linux64.h +--- a/gcc/config/rs6000/linux64.h 2 Jul 2005 08:52:15 -0000 1.81 ++++ b/gcc/config/rs6000/linux64.h 2 Jul 2005 08:52:15 -0000 1.81 +@@ -548,7 +548,7 @@ + + #define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h" + +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ + /* ppc32 glibc provides __stack_chk_guard in -0x7008(2), + ppc64 glibc provides it at -0x7010(13). */ + #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? -0x7010 : -0x7008) +diff -u gcc/config/s390/linux.h gcc/config/s390/linux.h +--- a/gcc/config/s390/linux.h 2005-08-22 15:53:01.000000000 +0200 1.40 ++++ b/gcc/config/s390/linux.h 2005-08-22 15:53:01.000000000 +0200 1.40 +@@ -94,7 +94,7 @@ + + #define MD_UNWIND_SUPPORT "config/s390/linux-unwind.h" + +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ + /* s390 glibc provides __stack_chk_guard in 0x14(tp), + s390x glibc provides it at 0x28(tp). */ + #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14) +diff -u gcc/config/sparc/linux.h gcc/config/sparc/linux.h +--- a/gcc/config/sparc/linux.h 6 Jul 2005 07:48:57 -0000 1.72 ++++ b/gcc/config/sparc/linux.h 6 Jul 2005 07:48:57 -0000 1.72 +@@ -230,7 +230,7 @@ + #undef NEED_INDICATE_EXEC_STACK + #define NEED_INDICATE_EXEC_STACK 1 + +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ + /* sparc glibc provides __stack_chk_guard in [%g7 + 0x14]. */ + #define TARGET_THREAD_SSP_OFFSET 0x14 + #endif +diff -u gcc/config/sparc/linux64.h gcc/config/sparc/linux64.h +--- a/gcc/config/sparc/linux64.h 6 Jul 2005 07:48:57 -0000 1.95 ++++ b/gcc/config/sparc/linux64.h 6 Jul 2005 07:48:57 -0000 1.95 +@@ -364,7 +364,7 @@ + #undef NEED_INDICATE_EXEC_STACK + #define NEED_INDICATE_EXEC_STACK 1 + +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ + /* sparc glibc provides __stack_chk_guard in [%g7 + 0x14], + sparc64 glibc provides it at [%g7 + 0x28]. */ + #define TARGET_THREAD_SSP_OFFSET (TARGET_ARCH64 ? 0x28 : 0x14) diff --git a/main/gcc/pt_gnu_eh_frame.patch b/main/gcc/pt_gnu_eh_frame.patch new file mode 100644 index 000000000..3e029104a --- /dev/null +++ b/main/gcc/pt_gnu_eh_frame.patch @@ -0,0 +1,12 @@ +--- gcc-4.3.2/gcc/crtstuff.c.orig Mon Nov 17 16:02:38 2008 ++++ gcc-4.3.2/gcc/crtstuff.c Mon Nov 17 16:02:52 2008 +@@ -94,8 +94,7 @@ + #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) \ ++# if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ + || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) + # define USE_PT_GNU_EH_FRAME + # endif diff --git a/main/gcc/uclibc-getipinfo.patch b/main/gcc/uclibc-getipinfo.patch new file mode 100644 index 000000000..3abbbdd7a --- /dev/null +++ b/main/gcc/uclibc-getipinfo.patch @@ -0,0 +1,19 @@ +--- a/libstdc++-v3/configure 2009-08-04 15:41:02.000000000 +0000 ++++ b/libstdc++-v3/configure 2009-08-04 15:46:20.000000000 +0000 +@@ -113523,14 +113523,14 @@ + # Based on system-libunwind and target, do we have ipinfo? + if test x$with_system_libunwind = xyes; then + case ${target} in +- ia64-*-*) have_unwind_getipinfo=no ;; ++ ia64-*-*|*-uclibc*) have_unwind_getipinfo=no ;; + *) have_unwind_getipinfo=yes ;; + esac + else + # Darwin before version 9 does not have _Unwind_GetIPInfo. + + case ${target} in +- *-*-darwin[3-8]|*-*-darwin[3-8].*) have_unwind_getipinfo=no ;; ++ *-*-darwin[3-8]|*-*-darwin[3-8].*|*-uclibc*) have_unwind_getipinfo=no ;; + *) have_unwind_getipinfo=yes ;; + esac + |