diff options
author | Andreas Grapentin <andreas@grapentin.org> | 2018-06-22 09:31:53 +0200 |
---|---|---|
committer | Andreas Grapentin <andreas@grapentin.org> | 2018-06-22 09:31:53 +0200 |
commit | a5fd90dcce72f58af61880857d7ab0f2e44e9874 (patch) | |
tree | 727048402665b287675825a6d95a81fd356a18ab /src/stage4 | |
parent | 56ec7e46cbdd2f7319574710d3ce3d38b9338108 (diff) |
rebootstrapped powerpc64le toolchain with multilib, and added grub
Diffstat (limited to 'src/stage4')
-rw-r--r-- | src/stage4/patches/generic/binutils.patch | 31 | ||||
-rw-r--r-- | src/stage4/patches/generic/gcc.patch | 26 | ||||
-rw-r--r-- | src/stage4/patches/generic/glibc.patch | 30 | ||||
-rw-r--r-- | src/stage4/patches/generic/grub.patch | 58 | ||||
-rw-r--r-- | src/stage4/patches/powerpc64le/binutils.patch | 13 | ||||
-rw-r--r-- | src/stage4/stage4.sh | 2 |
6 files changed, 123 insertions, 37 deletions
diff --git a/src/stage4/patches/generic/binutils.patch b/src/stage4/patches/generic/binutils.patch deleted file mode 100644 index 893089d..0000000 --- a/src/stage4/patches/generic/binutils.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff -rupN a/PKGBUILD b/PKGBUILD ---- a/PKGBUILD 2018-05-28 16:39:38.041700185 +0200 -+++ b/PKGBUILD 2018-05-28 16:44:11.358369579 +0200 -@@ -20,13 +20,15 @@ options=(staticlibs !distcc !ccache) - source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz{,.sig} - 0001-PR22741-objcopy-segfault-on-fuzzed-COFF-object.patch - 0002-PR22829-objcopy-strip-removes-PT_GNU_RELRO-from-lld-.patch -- 0003-PR22836-r-s-doesnt-work-with-g3-using-GCC-7.patch) -+ 0003-PR22836-r-s-doesnt-work-with-g3-using-GCC-7.patch -+ https://raw.githubusercontent.com/archlinux32/packages/master/core/binutils/binutils-2.30-branch.patch) - validpgpkeys=(3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F) - md5sums=('ffc476dd46c96f932875d1b2e27e929f' - 'SKIP' - '469164f3c93a0e92a697537b60c9806c' - '0c679b37e90fb23de60a4d28329b956a' -- '53b5682e09c0a27e9994c3efdfe01d29') -+ '53b5682e09c0a27e9994c3efdfe01d29' -+ 'a5ba9fc9de327b2eff071e19429c6e67') - - prepare() { - mkdir -p binutils-build -@@ -43,8 +45,7 @@ prepare() { - # https://sourceware.org/bugzilla/show_bug.cgi?id=22829 - patch -p1 -i "$srcdir/0002-PR22829-objcopy-strip-removes-PT_GNU_RELRO-from-lld-.patch" - -- # https://sourceware.org/bugzilla/show_bug.cgi?id=22836 -- patch -p1 -i "$srcdir/0003-PR22836-r-s-doesnt-work-with-g3-using-GCC-7.patch" -+ patch -p1 -i "$srcdir/binutils-2.30-branch.patch" - } - - build() { diff --git a/src/stage4/patches/generic/gcc.patch b/src/stage4/patches/generic/gcc.patch index 4bb7c5e..8a19896 100644 --- a/src/stage4/patches/generic/gcc.patch +++ b/src/stage4/patches/generic/gcc.patch @@ -14,8 +14,8 @@ diff -rupN a/0001-pthread-reentrant.patch b/0001-pthread-reentrant.patch + -melf" XLEN_SPEC "lriscv \ + %{shared} \ diff -rupN a/PKGBUILD b/PKGBUILD ---- a/PKGBUILD 2018-06-07 04:45:58.776560502 +0200 -+++ b/PKGBUILD 2018-06-07 11:52:53.533482750 +0200 +--- a/PKGBUILD 2018-06-18 09:38:54.252885520 +0200 ++++ b/PKGBUILD 2018-06-20 20:07:49.301652884 +0200 @@ -5,8 +5,9 @@ # toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc # NOTE: libtool requires rebuilt with each new gcc version @@ -213,3 +213,25 @@ diff -rupN a/PKGBUILD b/PKGBUILD install-{toolexeclibDATA,nodist_fincludeHEADERS} make -C $CHOST/libgomp DESTDIR="$pkgdir" install-nodist_fincludeHEADERS make -C gcc DESTDIR="$pkgdir" fortran.install-{common,man,info} +@@ -365,20 +350,12 @@ package_lib32-gcc-libs() { + + for lib in libatomic \ + libgfortran \ +- libgo \ + libgomp \ +- libitm \ + libquadmath \ +- libsanitizer/{a,l,ub}san \ +- libstdc++-v3/src \ +- libvtv; do ++ libstdc++-v3/src; do + make -C $CHOST/32/$lib DESTDIR="$pkgdir" install-toolexeclibLTLIBRARIES + done + +- make -C $CHOST/32/libobjc DESTDIR="$pkgdir" install-libs +- make -C $CHOST/32/libmpx DESTDIR="$pkgdir" install +- rm -f "$pkgdir/usr/lib32/libmpx.spec" +- + # remove files provided by gcc-libs + rm -rf "$pkgdir"/usr/lib + diff --git a/src/stage4/patches/generic/glibc.patch b/src/stage4/patches/generic/glibc.patch index ca64f4c..68cb28e 100644 --- a/src/stage4/patches/generic/glibc.patch +++ b/src/stage4/patches/generic/glibc.patch @@ -32,7 +32,7 @@ diff -rupN a/PKGBUILD b/PKGBUILD --disable-profile --disable-werror ) -@@ -70,6 +70,8 @@ build() { +@@ -70,6 +72,8 @@ build() { # remove fortify for building libraries CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} @@ -41,12 +41,34 @@ diff -rupN a/PKGBUILD b/PKGBUILD "$srcdir/glibc/configure" \ --libdir=/usr/lib \ -@@ -87,6 +89,8 @@ build() { +@@ -87,9 +91,11 @@ build() { echo "CXX += -D_FORTIFY_SOURCE=2" >> configparms make + [ "x@MULTILIB@" == "xenable" ] || return 0 + cd "$srcdir/lib32-glibc-build" - export CC="gcc -m32 -mstackrealign" - export CXX="g++ -m32 -mstackrealign" +- export CC="gcc -m32 -mstackrealign" +- export CXX="g++ -m32 -mstackrealign" ++ export CC="gcc @PLATFORM32_CFLAGS@" ++ export CXX="g++ @PLATFORM32_CFLAGS@" + + echo "slibdir=/usr/lib32" >> configparms + echo "rtlddir=/usr/lib32" >> configparms +@@ -102,7 +108,7 @@ build() { + CXXFLAGS=${CXXFLAGS/-fno-plt/} + + "$srcdir/glibc/configure" \ +- --host=i686-pc-linux-gnu \ ++ --host=@CHOST32@ \ + --libdir=/usr/lib32 \ + --libexecdir=/usr/lib32 \ + ${_configure_flags[@]} +@@ -117,7 +123,6 @@ build() { + echo "CC += -D_FORTIFY_SOURCE=2" >> configparms + echo "CXX += -D_FORTIFY_SOURCE=2" >> configparms + make +- + } + + check() { diff --git a/src/stage4/patches/generic/grub.patch b/src/stage4/patches/generic/grub.patch new file mode 100644 index 0000000..7787421 --- /dev/null +++ b/src/stage4/patches/generic/grub.patch @@ -0,0 +1,58 @@ +diff -rupN a/PKGBUILD b/PKGBUILD +--- a/PKGBUILD 2018-06-18 09:38:57.866218889 +0200 ++++ b/PKGBUILD 2018-06-21 11:19:08.038865128 +0200 +@@ -7,7 +7,7 @@ + # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> + + ## '1' to enable Xen support, '0' to disable +-_XEN='1' ++_XEN='0' + + ## '1' to enable IA32-EFI build in Arch x86_64, '0' to disable + _IA32_EFI_IN_ARCH_X64='1' +@@ -351,7 +351,7 @@ _build_grub-ieee1275() { + msg 'Run ./configure for IEEE1275 (OpenFirmware) build' + ./configure \ + --with-platform='ieee1275' \ +- --target='i386' \ ++ --target="$CARCH" \ + --disable-efiemu \ + --enable-mm-debug \ + --enable-nls \ +@@ -560,6 +560,11 @@ _build_grub-uboot() { + build() { + cd "${srcdir}/grub-${pkgver}/" + ++ if [[ "${CARCH}" = 'powerpc64le' ]]; then ++ msg "Build grub ieee1275 stuff" ++ _build_grub-ieee1275 ++ fi ++ + if [[ "${CARCH}" = 'x86_64' ]] || [[ "${CARCH}" = 'i686' ]] || [[ "${CARCH}" = 'armv7h' ]]; then + msg "Build grub ${_EFI_ARCH} EFI stuff" + _build_grub-efi +@@ -661,9 +666,9 @@ _package_grub-ieee1275() { + make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install + + msg 'Remove gdb debugging related files for IEEE1275 (OpenFirmware) build' +- rm -f "${pkgdir}/usr/lib/grub/i386-ieee1275"/*.module || true +- rm -f "${pkgdir}/usr/lib/grub/i386-ieee1275"/*.image || true +- rm -f "${pkgdir}/usr/lib/grub/i386-ieee1275"/{kernel.exec,gdb_grub,gmodule.pl} || true ++ rm -f "${pkgdir}/usr/lib/grub/${CARCH}-ieee1275"/*.module || true ++ rm -f "${pkgdir}/usr/lib/grub/${CARCH}-ieee1275"/*.image || true ++ rm -f "${pkgdir}/usr/lib/grub/${CARCH}-ieee1275"/{kernel.exec,gdb_grub,gmodule.pl} || true + } + + _package_grub-libreboot() { +@@ -728,6 +733,11 @@ package_grub() { + + cd "${srcdir}/grub-${pkgver}/" + ++ if [[ "${CARCH}" = 'powerpc64le' ]]; then ++ msg "Package grub ieee1275 stuff" ++ _package_grub-ieee1275 ++ fi ++ + if [[ "${CARCH}" = 'x86_64' ]] || [[ "${CARCH}" = 'i686' ]] || [[ "${CARCH}" = 'armv7h' ]]; then + msg "Package grub ${_EFI_ARCH} EFI stuff" + _package_grub-efi diff --git a/src/stage4/patches/powerpc64le/binutils.patch b/src/stage4/patches/powerpc64le/binutils.patch new file mode 100644 index 0000000..b85c25c --- /dev/null +++ b/src/stage4/patches/powerpc64le/binutils.patch @@ -0,0 +1,13 @@ +diff -rupN a/PKGBUILD b/PKGBUILD +--- a/PKGBUILD 2018-06-18 09:36:34.209550790 +0200 ++++ b/PKGBUILD 2018-06-20 08:01:20.661217960 +0200 +@@ -61,7 +61,8 @@ build() { + --enable-plugins \ + --enable-relro \ + --enable-shared \ +- --enable-targets=x86_64-pep \ ++ --enable-targets=spu \ ++ --enable-targets=powerpc-linux \ + --enable-threads \ + --disable-gdb \ + --disable-werror \ diff --git a/src/stage4/stage4.sh b/src/stage4/stage4.sh index 9b9b81a..e5154c6 100644 --- a/src/stage4/stage4.sh +++ b/src/stage4/stage4.sh @@ -35,6 +35,8 @@ stage4_makepkg() { # substitute common variables sed "s#@MULTILIB@#${MULTILIB:-disable}#g; \ s#@PLATFORM_CFLAGS@#${PLATFORM_CFLAGS[*]}#g; \ + s#@CHOST32@#${CHOST32}#g; \ + s#@PLATFORM32_CFLAGS@#${PLATFORM32_CFLAGS[*]}#g; \ s#@GCC_CONFIG_FLAGS@#${GCC_CONFIG_FLAGS[*]}#g" \ PKGBUILD.in > PKGBUILD |