Commit af3ef82a authored by Natanael Copa's avatar Natanael Copa

main/gcc: moved 4.4.1 from testing to main

parent b2140f79
--- gcc-4.0.old/gcc/gcc.c.mps Sun Nov 14 21:10:35 2004
+++ gcc-4.0/gcc/gcc.c Sun Nov 14 21:43:17 2004
@@ -794,6 +794,8 @@
/* NB: This is shared amongst all front-ends. */
static const char *cc1_options =
"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
+ %{shared:%{static|pie|fPIE|fpie|fno-PIC|fno-pic:%e-shared and -static|pie|fPIE|fpie|fno-PIC|fno-pic are incompatible}}\
+ %{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible}}\
%1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}\
%{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi}\
--- gcc-4.0.2/gcc/gcc.c.nondef~ 2006-01-09 00:09:50 +0100
+++ gcc-4.0.2/gcc/gcc.c 2006-01-09 00:15:31 +0100
@@ -764,6 +764,6 @@
static const char *asm_debug;
static const char *cpp_spec = CPP_SPEC;
-static const char *cc1_spec = CC1_SPEC;
+static const char *cc1_spec = CC1_SPEC CC1_HARDENED_SPEC;
static const char *cc1plus_spec = CC1PLUS_SPEC;
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
diff -Nru /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/gcc/config.gcc /root/hardened/gcc-4.3.1-r1/work/gcc-4.3.1/gcc/config.gcc
--- gcc-4.3.1/gcc/config.gcc 2008-06-11 04:13:33.000000000 +0200
+++ gcc-4.3.1/gcc/config.gcc 2008-06-11 04:41:39.000000000 +0200
@@ -493,7 +493,7 @@
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
# Must come before *-*-gnu* (because of *-*-linux-gnu* systems).
- extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
+ extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtbeginTS.o crtend.o crtendS.o"
extra_options="${extra_options} linux.opt"
gas=yes
gnu_ld=yes
diff -Nru /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/gcc/Makefile.in /root/hardened/gcc-4.3.1-r1/work/gcc-4.3.1/gcc/Makefile.in
--- gcc-4.3.1/gcc/Makefile.in 2008-06-11 04:13:37.000000000 +0200
+++ gcc-4.3.1/gcc/Makefile.in 2008-06-11 04:42:27.000000000 +0200
@@ -1665,36 +1665,43 @@
# constructors.
$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
+ $(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
-c $(srcdir)/crtstuff.c -DCRT_BEGIN \
-o $(T)crtbegin$(objext)
$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
+ $(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
-c $(srcdir)/crtstuff.c -DCRT_END \
-o $(T)crtend$(objext)
# These are versions of crtbegin and crtend for shared libraries.
$(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
+ $(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
-c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
-o $(T)crtbeginS$(objext)
$(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
+ $(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
-c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
-o $(T)crtendS$(objext)
# This is a version of crtbegin for -static links.
$(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
+ $(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
-c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
-o $(T)crtbeginT$(objext)
+# This is a version of crtbegin for -static -fPIE links.
+$(T)crtbeginTS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
+ $(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
+ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O \
+ -o $(T)crtbeginTS$(objext)
+
# Compile the start modules crt0.o and mcrt0.o that are linked with
# every program
$(T)crt0.o: s-crt0 ; @true
diff -Nru /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/config.host /root/hardened/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/config.host
--- gcc-4.3.1/libgcc/config.host 2008-01-25 21:49:04.000000000 +0100
+++ gcc-4.3.1/libgcc/config.host 2008-06-11 04:42:09.000000000 +0200
@@ -164,7 +164,7 @@
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
# Must come before *-*-gnu* (because of *-*-linux-gnu* systems).
- extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
+ extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtbeginTS.o crtend.o crtendS.o"
;;
*-*-gnu*)
;;
diff -Nru /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/Makefile.in /root/hardened/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/Makefile.in
--- gcc-4.3.1/libgcc/Makefile.in 2008-06-11 04:13:37.000000000 +0200
+++ gcc-4.3.1/libgcc/Makefile.in 2008-06-11 04:42:09.000000000 +0200
@@ -783,6 +783,11 @@
crtbeginT.o: $(gcc_srcdir)/crtstuff.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS) \
-c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O
+
+# This is a version of crtbegin for -static -fPIE links.
+crtbeginTS.o: $(gcc_srcdir)/crtstuff.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
+ -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O
endif
# Build extra startfiles in the libgcc directory.
This diff is collapsed.
This patch defines the hardened specs hard in the gcc.c file.
--- gcc-4.3.2/gcc/gcc.c.orig2 Sun Nov 23 11:35:41 2008
+++ gcc-4.3.2/gcc/gcc.c Sun Nov 23 11:51:58 2008
@@ -703,9 +703,9 @@
#ifndef LINK_PIE_SPEC
#ifdef HAVE_LD_PIE
-#define LINK_PIE_SPEC "%{pie:-pie} "
-#define CC1_PIE_SPEC "%{pie:-fPIE}"
-#define ASM_PIE_SPEC "%{pie:-K PIC}"
+#define LINK_PIE_SPEC "%{pie:-pie} %{!pie: %{!A: %{!fno-pie:%{!fno-PIE: %{!shared:%{!static:%{!r: %{!nopie:-pie} }}} }} } }%{pie:-pie} %{!pie: %{!A: %{!fno-pie:%{!fno-PIE: %{!shared:%{!static:%{!r: %{!nopie:-pie} }}} }} } } "
+#define CC1_PIE_SPEC "%{pie:-fPIE} %{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: %{!shared: %{!nopie:-fPIE} } }}}} }}}} }"
+#define ASM_PIE_SPEC "%{pie:-K PIC} %{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: %{!shared: %{!nopie:-K PIC} } }}}} }}}} }"
#else
#define LINK_PIE_SPEC "%{pie:} "
#define CC1_PIE_SPEC ""
@@ -717,28 +717,28 @@
#define CC1_HARDENED_SPEC " %{!D__KERNEL__: %(cc1_pie) %(cc1_ssp) %(cc1_fortify) %(cc1_strict) }"
#endif
#ifndef CC1_SSP_SPEC
-#define CC1_SSP_SPEC ""
+#define CC1_SSP_SPEC "%{!nostdlib:%{!nodefaultlibs: %{!fno-stack-protector:%{!fstack-protector:%{!fstack-protector-all:-fstack-protector %(cc1_ssp_all) }}} }}"
#endif
#ifndef CC1_SSP_ALL_SPEC
-#define CC1_SSP_ALL_SPEC ""
+#define CC1_SSP_ALL_SPEC ""
#endif
#ifndef CRTFILE_PIE_SPEC
-#define CRTFILE_PIE_SPEC "%{static:crt1.o%s;pie:Scrt1.o%s;:crt1.o%s}"
+#define CRTFILE_PIE_SPEC "%{fno-pie|fno-PIE|nopie:crt1.o%s;:Scrt1.o%s}"
#endif
#ifndef STARTFILE_PIE_SPEC
-#define STARTFILE_PIE_SPEC "%{static:crtbegin.o%s;pie:crtbeginS.o%s;:crtbegin.o%s}"
+#define STARTFILE_PIE_SPEC "%{fno-pie|fno-PIE|nopie:crtbegin.o%s;:crtbeginS.o%s}"
#endif
#ifndef STARTFILE_PIE_T_SPEC
-#define STARTFILE_PIE_T_SPEC "%{static:crtbeginT.o%s;pie:crtbeginS.o%s;:crtbegin.o%s}"
+#define STARTFILE_PIE_T_SPEC "%{static: %{fno-pie|fno-PIE|nopie:crtbeginT.o%s;:crtbeginTS.o%s} } %{!static: %{fno-pie|fno-PIE|nopie:crtbegin.o%s;:crtbeginS.o%s} }"
#endif
#ifndef ENDFILE_PIE_SPEC
-#define ENDFILE_PIE_SPEC "%{pie:crtendS.o%s;:crtend.o%s}"
+#define ENDFILE_PIE_SPEC "%{fno-pie|fno-PIE|nopie:crtend.o%s;:crtendS.o%s}"
#endif
#ifndef LINK_RELRO_SPEC
-#define LINK_RELRO_SPEC "%{norelro:}"
+#define LINK_RELRO_SPEC "%{!norelro:-z relro}"
#endif
#ifndef LINK_NOW_SPEC
-#define LINK_NOW_SPEC "%{nonow:}"
+#define LINK_NOW_SPEC "%{!nonow:-z now}"
#endif
/* -u* was put back because both BSD and SysV seem to support it. */
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gcc
pkgver=4.3.3
pkgrel=2
pkgver=4.4.1
_specsver=0.1.4
_espfver=0.3.1
pkgrel=1
pkgdesc="The GNU Compiler Collection"
url="http://gcc.gnu.org"
license="GPL LGPL"
depends="gmp mpfr libgcc binutils"
depends="binutils"
makedepends="bison flex gmp-dev mpfr-dev texinfo"
subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc"
subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp"
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
00_all_gcc-4.0-cvs-incompat.patch
01_all_gcc-4.0.2-v9.0.0-start_endfile-boundschecking-no.patch
01_all_gcc-4.3.1-crtbeginTS-stuff.patch
02_all_gcc-4.3.1-v10.0.1-start_endfile.patch
03_all_gcc-4.3.2-hardened-default.patch
http://weaver.gentooenterprise.com/hardened/patches/gcc-$pkgver-espf-$_espfver.tar.bz2
http://weaver.gentooenterprise.com/hardened/patches/gcc-$pkgver-specs-$_specsver.tar.bz2
gcc4-stack-protector-uclibc-no_tls.patch
gcc-4.2.0-cc1-no-stack-protector.patch
pt_gnu_eh_frame.patch
gcc-spec-env.patch
uclibc-getipinfo.patch
"
# ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-objc-$pkgver.tar.bz2
build ()
{
cd ${srcdir}/gcc-${pkgver}
build ()
{
cd ${srcdir}/gcc-${pkgver};
# uclibc patches
for i in ../*.patch; do
if ! patch -p1 -i $i; then
error "$i failed"
return 1
fi
msg "Applying $i"
patch -p1 -i $i || return 1
done
echo ${pkgver} > gcc/BASE-VER;
# Don't build crtbegin/end with ssp
sed -e 's|^CRTSTUFF_CFLAGS = |CRTSTUFF_CFLAGS = -fno-stack-protector |' \
-i gcc/Makefile.in || return 1
# Don't build libgcc with SSP
sed -e 's|^LIBGCC2_CFLAGS = |LIBGCC2_CFLAGS = -fno-stack-protector -U_FORTIFY_SOURCE |' \
-i gcc/Makefile.in || return 1
# Use SSP from libc
msg "Enabling SSP from libc"
sed -e 's|^LIBGCC2_CFLAGS = |LIBGCC2_CFLAGS = -D_LIBC_PROVIDES_SSP_ |' \
-i gcc/Makefile.in || return 1
# ESPF patches. we dont use objc yet
rm -f ../espf-gcc-$pkgver/*_objc*lang-specs*.patch
# thanks to Zorry for hard work on those patches
for i in ../espf-gcc-$pkgver/*.patch; do
msg "Applying $i"
patch -p0 -i $i || return 1
done
echo ${pkgver} > gcc/BASE-VER
mkdir build
cd build
../configure --prefix=/usr \
......@@ -59,15 +51,18 @@ build ()
--disable-libstdcxx-pch \
--disable-multilib \
--disable-nls \
--disable-threads \
--disable-tls \
--disable-werror \
--enable-__cxa_atexit \
--enable-cld \
--enable-espf \
--enable-languages=c,c++ \
--enable-shared \
--enable-target-optspace \
--disable-threads \
--with-arch=i486 \
--with-system-zlib
--with-system-zlib \
--without-system-libunwind
make || return 1
make -j1 DESTDIR="${pkgdir}" install || return 1
......@@ -75,18 +70,25 @@ build ()
# 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
}
libcxx() {
pkgdesc="GNU C++ standard runtime library"
depends="uclibc libgcc"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libstdc++.so* "$subpkgdir"/usr/lib/
}
gpp() {
pkgdesc="GNU C++ standard library and compiler"
depends="uclibc libstdc++"
depends=
local libexec=usr/libexec/gcc/${CHOST:-i486-alpine-linux-uclibc}/$pkgver
mkdir -p "$subpkgdir/$libexec" \
"$subpkgdir"/usr/bin \
......@@ -100,21 +102,24 @@ gpp() {
}
libgcc() {
pkgdesc="GNU C compiler runtime library"
depends="uclibc"
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/
}
md5sums="1739288c2c7b1472796b33d641dbdbbd gcc-core-4.3.3.tar.bz2
18428e313a9927d38b313e688c62219b gcc-g++-4.3.3.tar.bz2
f0c6c419318537505ec2717a139a091b 00_all_gcc-4.0-cvs-incompat.patch
3cb2148075e818f09c34718725f335d9 01_all_gcc-4.0.2-v9.0.0-start_endfile-boundschecking-no.patch
1c6294b95f13a59ed7cbf7be2dde7804 01_all_gcc-4.3.1-crtbeginTS-stuff.patch
019522a38f2e25b6a820766402ff2ee4 02_all_gcc-4.3.1-v10.0.1-start_endfile.patch
ed3f5a947fed432fbef1dc0e71977ae7 03_all_gcc-4.3.2-hardened-default.patch
md5sums="d19693308aa6b2052e14c071111df59f gcc-core-4.4.1.tar.bz2
d449047b5761348ceec23739f5553e0b gcc-g++-4.4.1.tar.bz2
43d0bbd676bbb2acd67ddabd0ea1bc2b gcc-4.4.1-espf-0.3.1.tar.bz2
da8d9165e828bbb9809ef86f1c72886f gcc-4.4.1-specs-0.1.4.tar.bz2
15e77082db0e1a131af98debd3016290 gcc4-stack-protector-uclibc-no_tls.patch
cff2e73a8455bfa844dcdd9c229b0875 gcc-4.2.0-cc1-no-stack-protector.patch
2db1e3482c5dd59dab70f701afa2ca80 pt_gnu_eh_frame.patch
c4045bfa85d8be780affd465be9d8ca8 gcc-spec-env.patch"
6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch"
--- a/gcc/Makefile.in.orig 2007-05-20 14:44:14.000000000 +0200
+++ b/gcc/Makefile.in 2007-05-20 14:44:27.000000000 +0200
@@ -2641,7 +2641,7 @@
output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \
$(TARGET_DEF_H) $(FUNCTION_H) $(SCHED_INT_H) $(TM_P_H) $(EXPR_H) \
langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) tm-constrs.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
+ $(CC) -c $(ALL_CFLAGS) -fno-stack-protector $(ALL_CPPFLAGS) \
$(out_file) $(OUTPUT_OPTION)
# Build auxiliary files that support ecoff format.
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,
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gcc
pkgver=4.4.1
_specsver=0.1.4
_espfver=0.3.1
pkgrel=1
pkgdesc="The GNU Compiler Collection"
url="http://gcc.gnu.org"
license="GPL LGPL"
depends="binutils"
makedepends="bison flex gmp-dev mpfr-dev texinfo"
subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp"
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
http://weaver.gentooenterprise.com/hardened/patches/gcc-$pkgver-espf-$_espfver.tar.bz2
http://weaver.gentooenterprise.com/hardened/patches/gcc-$pkgver-specs-$_specsver.tar.bz2
gcc4-stack-protector-uclibc-no_tls.patch
pt_gnu_eh_frame.patch
uclibc-getipinfo.patch
"
# ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-objc-$pkgver.tar.bz2
build ()
{
cd ${srcdir}/gcc-${pkgver}
# uclibc patches
for i in ../*.patch; do
msg "Applying $i"
patch -p1 -i $i || return 1
done
# ESPF patches. we dont use objc yet
rm -f ../espf-gcc-$pkgver/*_objc*lang-specs*.patch
# thanks to Zorry for hard work on those patches
for i in ../espf-gcc-$pkgver/*.patch; do
msg "Applying $i"
patch -p0 -i $i || return 1
done
echo ${pkgver} > gcc/BASE-VER
mkdir build
cd build
../configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--build=${CHOST:-i486-alpine-linux-uclibc} \
--disable-altivec \
--disable-checking \
--disable-fixed-point \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-nls \
--disable-threads \
--disable-tls \
--disable-werror \
--enable-__cxa_atexit \
--enable-cld \
--enable-espf \
--enable-languages=c,c++ \
--enable-shared \
--enable-target-optspace \
--with-arch=i486 \
--with-system-zlib \
--without-system-libunwind
make || return 1
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
}
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=
local libexec=usr/libexec/gcc/${CHOST:-i486-alpine-linux-uclibc}/$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/
}
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/
}
md5sums="d19693308aa6b2052e14c071111df59f gcc-core-4.4.1.tar.bz2
d449047b5761348ceec23739f5553e0b gcc-g++-4.4.1.tar.bz2
43d0bbd676bbb2acd67ddabd0ea1bc2b gcc-4.4.1-espf-0.3.1.tar.bz2
da8d9165e828bbb9809ef86f1c72886f gcc-4.4.1-specs-0.1.4.tar.bz2
15e77082db0e1a131af98debd3016290 gcc4-stack-protector-uclibc-no_tls.patch
2db1e3482c5dd59dab70f701afa2ca80 pt_gnu_eh_frame.patch
6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch"
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)
--- 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment