diff options
-rw-r--r-- | testing/gcc/APKBUILD | 46 | ||||
-rw-r--r-- | testing/gcc/gcc-go.patch | 11 | ||||
-rw-r--r-- | testing/gcc/gcc-libgcc-x86.get_pc_thunk.bx.patch | 38 |
3 files changed, 91 insertions, 4 deletions
diff --git a/testing/gcc/APKBUILD b/testing/gcc/APKBUILD index 3126953de5..3d5ce070e9 100644 --- a/testing/gcc/APKBUILD +++ b/testing/gcc/APKBUILD @@ -7,7 +7,7 @@ _specs_gcc_ver=4.4.3 _uclibc_abiver=0.9.32 -pkgrel=2 +pkgrel=3 pkgdesc="The GNU Compiler Collection" url="http://gcc.gnu.org" arch="all" @@ -15,7 +15,8 @@ license="GPL LGPL" depends="binutils libgcc libgomp libobjc" makedepends="bison flex gmp-dev mpfr-dev texinfo libmpc-dev gawk zlib-dev zip cloog-dev" -subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp" +subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp $pkgname-go + libgo" replaces="libstdc++" if [ -n "$BOOTSTRAP" ]; then @@ -30,11 +31,17 @@ if [ "$LANG_JAVA" != "off" ]; then subpackages="$subpackages $pkgname-java libgcj" makedepends="$makedepends paxctl" fi +if [ "$LANG_GO" != "off" ]; then + _languages="$_languages,go" + 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 + ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-go-$pkgver.tar.bz2 http://distfiles.gentoo.org/distfiles/gcc-4.6.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 @@ -54,6 +61,8 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-core-$pkgver.tar.bz2 gcc-4.6-pr32219.patch boehem-gc-uclibc.patch gcc-pure64.patch + gcc-go.patch + gcc-libgcc-x86.get_pc_thunk.bx.patch " # we build out-of-tree @@ -143,6 +152,10 @@ build() { _languages="$_languages,java" fi + if [ "$LANG_GO" != "off" ]; then + _languages="$_languages,go" + fi + # --enable-target-optspace is broken on powerpc if [ "$CARCH" != "powerpc" ]; then _target_optspace="--enable-target-optspace" @@ -319,11 +332,34 @@ libgcj() { mkdir -p "$subpkgdir"/usr/share/ mv "$pkgdir"/usr/share/java "$subpkgdir"/usr/share/ } - + +libgo() { + pkgdesc="Go runtime library for GCC" + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/ +} + +go() { + pkgdesc="Go support for GCC" + depends="libgo" + local libexec=usr/libexec/gcc/${CHOST:-$_chost}/$pkgver + mkdir -p "$subpkgdir"/$libexec \ + "$subpkgdir"/usr/lib \ + "$subpkgdir"/usr/bin || return 1 + mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/ || return 1 + mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/ || return 1 + mv "$pkgdir"/$libexec/go1 "$subpkgdir"/$libexec/ || return 1 + mv "$pkgdir"/usr/lib/libgo.a \ + "$pkgdir"/usr/lib/libgo.so \ + "$pkgdir"/usr/lib/libgobegin.a \ + "$subpkgdir"/usr/lib/ || return 1 +} + md5sums="0c0e7e35d2215e19de9c97efba507553 gcc-core-4.6.1.tar.bz2 0d75ca7ca35b1e7f252223f9d23a6ad1 gcc-g++-4.6.1.tar.bz2 cbf0d4b701827922cf37ba6a4ace0079 gcc-objc-4.6.1.tar.bz2 32431ba42c1d18e64f2abfdfc834ef94 gcc-java-4.6.1.tar.bz2 +a69f9f156172c2e1da5590faa70f4fc7 gcc-go-4.6.1.tar.bz2 5dc7efd84b526801b94fed21462aea62 gcc-4.6.1-piepatches-v0.4.5.tar.bz2 441c76504e1d97170117c294e65c7a72 gcc-4.4.3-specs-0.2.0.tar.bz2 d7cd6a27c8801e66cbaa964a039ecfdb ecj-latest.jar @@ -340,4 +376,6 @@ a695d7648509b4f8e18b389a19e6037c gcc-spec-env.patch 3be85df859fa1d5c875bbfcc2dee8288 gcc-4.6-dynamic-linker.patch 32e8e4c0e23ed8f5de95a591cb30f1da gcc-4.6-pr32219.patch 2c6cb49bb9bfd8b6e690222e66ccc901 boehem-gc-uclibc.patch -d1d3ad2b0c185b5548125a1b81bee154 gcc-pure64.patch" +d1d3ad2b0c185b5548125a1b81bee154 gcc-pure64.patch +c94014ece84407a36d239417a2bad25d gcc-go.patch +978e3fac97ad99902a86bafc6f283727 gcc-libgcc-x86.get_pc_thunk.bx.patch" diff --git a/testing/gcc/gcc-go.patch b/testing/gcc/gcc-go.patch new file mode 100644 index 0000000000..a882a5a38e --- /dev/null +++ b/testing/gcc/gcc-go.patch @@ -0,0 +1,11 @@ +--- gcc-4.6.1.orig/gcc/go/Make-lang.in ++++ gcc-4.6.1/gcc/go/Make-lang.in +@@ -63,7 +63,7 @@ + go/unsafe.o + + go1$(exeext): $(GO_OBJS) attribs.o $(BACKEND) $(LIBDEPS) +- $(CXX) $(ALL_CXXFLAGS) $(LDFLAGS) -o $@ \ ++ $(CXX) $(ALL_CXXFLAGS) $(LDFLAGS) -fno-PIE -o $@ \ + $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS) + + # Documentation. diff --git a/testing/gcc/gcc-libgcc-x86.get_pc_thunk.bx.patch b/testing/gcc/gcc-libgcc-x86.get_pc_thunk.bx.patch new file mode 100644 index 0000000000..551e6150ab --- /dev/null +++ b/testing/gcc/gcc-libgcc-x86.get_pc_thunk.bx.patch @@ -0,0 +1,38 @@ +Index: libgcc/config/i386/morestack.S +=================================================================== +--- ./libgcc/config/i386/morestack.S (revision 173993) ++++ ./libgcc/config/i386/morestack.S (revision 173994) +@@ -278,8 +278,7 @@ + movl 4(%esp),%eax # Function argument. + movl %eax,(%esp) + #ifdef __PIC__ +-#undef __i686 +- call __i686.get_pc_thunk.bx # %ebx may not be set up for us. ++ call __x86.get_pc_thunk.bx # %ebx may not be set up for us. + addl $_GLOBAL_OFFSET_TABLE_, %ebx + call _Unwind_Resume@PLT # Resume unwinding. + #else +@@ -449,6 +448,23 @@ + .size __morestack, . - __morestack + #endif + ++#if !defined(__x86_64__) && defined(__PIC__) ++# Output the thunk to get PC into bx, since we use it above. ++ .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat ++ .globl __x86.get_pc_thunk.bx ++ .hidden __x86.get_pc_thunk.bx ++#ifdef __ELF__ ++ .type __x86.get_pc_thunk.bx, @function ++#endif ++__x86.get_pc_thunk.bx: ++ .cfi_startproc ++ movl (%esp), %ebx ++ ret ++ .cfi_endproc ++#ifdef __ELF__ ++ .size __x86.get_pc_thunk.bx, . - __x86.get_pc_thunk.bx ++#endif ++#endif + + # The exception table. This tells the personality routine to execute + # the exception handler. |