From 0c7d7e30647d0555cd7ca36693578617a907b6b8 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Fri, 22 Nov 2019 07:26:24 +0100 Subject: [PATCH] gcc native: move cross compiler outside source tree --- cross/init.sh | 220 ++++-------------- .../patch/autoconf/build-aux/git-version-gen | 2 - cross/patch/binutils/ld/configure.tgt | 14 +- cross/patch/gcc.patch | 71 ++++++ cross/patch/gcc/config.sub | 3 - .../patch/gcc/contrib/download_prerequisites | 71 ------ cross/patch/gcc/fixincludes/mkfixinc.sh | 1 - cross/patch/gcc/gcc/config.gcc | 31 --- cross/patch/gcc/gcc/config/jehanne.h | 6 +- cross/patch/gcc/libgcc/config.host | 4 - cross/patch/gcc/libgcc/config.host.sed | 3 - cross/patch/gcc/libstdc++-v3/crossconfig.m4 | 6 - cross/patch/libgmp.patch | 11 + cross/patch/libmpc.patch | 11 + cross/patch/libmpfr.patch | 11 + cross/src/.gitignore | 7 - cross/src/fetch.json | 39 ++-- 17 files changed, 178 insertions(+), 333 deletions(-) delete mode 100755 cross/patch/autoconf/build-aux/git-version-gen create mode 100644 cross/patch/gcc.patch delete mode 100644 cross/patch/gcc/config.sub delete mode 100644 cross/patch/gcc/contrib/download_prerequisites delete mode 100644 cross/patch/gcc/fixincludes/mkfixinc.sh delete mode 100644 cross/patch/gcc/gcc/config.gcc delete mode 100644 cross/patch/gcc/libgcc/config.host delete mode 100644 cross/patch/gcc/libgcc/config.host.sed delete mode 100644 cross/patch/gcc/libstdc++-v3/crossconfig.m4 create mode 100644 cross/patch/libgmp.patch create mode 100644 cross/patch/libmpc.patch create mode 100644 cross/patch/libmpfr.patch delete mode 100644 cross/src/.gitignore diff --git a/cross/init.sh b/cross/init.sh index 6291a4c..18cca60 100755 --- a/cross/init.sh +++ b/cross/init.sh @@ -2,7 +2,7 @@ # This file is part of Jehanne. # -# Copyright (C) 2016 Giacomo Tesio +# Copyright (C) 2016-2019 Giacomo Tesio # # Jehanne is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,198 +21,80 @@ if [ "$JEHANNE" = "" ]; then exit 1 fi -# setup Jehanne's headers -usyscalls header $JEHANNE/sys/src/sysconf.json > $JEHANNE/arch/amd64/include/syscalls.h - -# -# WELLCOME TO HELL ! ! ! -# - -# If you want to understand _WHY_ Jehanne exists, you should try to -# create a GCC crosscompiler in Debian without requiring root access or Tex. -# And this despite the extreme quality of Debian GNU/Linux! - -# To create a Jehanne version of GCC, we need specific OUTDATED versions -# of Autotools that won't compile easily in a modern Linux distro. - -echo -n please wait. -( - # Inside parentheses, and therefore a subshell . . . - while [ 1 ] # Endless loop. - do - echo -n "." - sleep 3 - done -) & -dotter=$! -date > cross-toolchain.build.log +REPONAME=`basename $JEHANNE` +WORKING_DIR=`dirname $JEHANNE` +WORKING_DIR="$WORKING_DIR/$REPONAME.TOOLCHAIN" +CROSS_DIR="$JEHANNE/hacking/cross" +LOG="$WORKING_DIR/cross.build.log" function failOnError { # $1 -> exit status on a previous command # $2 -> task description if [ $1 -ne 0 ]; then - kill $dotter - wait $dotter 2>/dev/null - echo "ERROR $2" echo echo BUILD LOG: echo - cat cross-toolchain.build.log + cat $LOG exit $1 fi } -# fetch all sources -(cd src && fetch) >> cross-toolchain.build.log 2>&1 -failOnError $? "fetching sources" - -# build m4 1.4.14 -# - workaround a bug in lib/stdio.in.h, see http://lists.gnu.org/archive/html/bug-m4/2012-08/msg00008.html -# - workaround a bug in src/m4.h, see https://bugs.archlinux.org/task/19829 -# both bugs exists thanks to changes in external code -if [ ! -f tmp/bin/m4 ]; then -( - cd src/m4 && - sed -i '/_GL_WARN_ON_USE (gets/d' lib/stdio.in.h && - ( grep -q '#include ' src/m4.h || sed -i 's:.*\#include .*:&\n#include :g' src/m4.h ) && - ./configure --prefix=$JEHANNE/hacking/cross/tmp && - make && make install -) >> cross-toolchain.build.log 2>&1 -failOnError $? "building m4" -fi -# build autoconf 2.64 -# - hack git-version-gen to avoid the -dirty flag in version on make -# - autoreconf -# - disable doc build -# - disable man build -if [ ! -f tmp/bin/autoconf ]; then -( - cd src/autoconf && - cp ../../patch/autoconf/build-aux/git-version-gen build-aux/git-version-gen && - autoreconf && - ./configure --prefix=$JEHANNE/hacking/cross/tmp && - cp ../../patch/MakeNothing.in ../autoconf/doc/Makefile.in && - cp ../../patch/MakeNothing.in ../autoconf/man/Makefile.in && - make && make install -) >> cross-toolchain.build.log 2>&1 -failOnError $? "building autoconf" -fi -# build automake 1.11.1 -# - autoreconf to avoid conflicts with installed automake -# - automake; configure; make (that will fail) and then automake again -# to workaround this hell -# - disable doc build -# - disable disable tests build -if [ ! -f tmp/bin/automake ]; then -( - cd src/automake && - echo > doc/Makefile.am && - touch NEWS AUTHORS && autoreconf -i && - automake && - (./configure --prefix=$JEHANNE/hacking/cross/tmp && make; automake) && - ./configure --prefix=$JEHANNE/hacking/cross/tmp && - cp ../../patch/MakeNothing.in doc/Makefile.in && - cp ../../patch/MakeNothing.in tests/Makefile.in && - make && make install -) >> cross-toolchain.build.log 2>&1 -failOnError $? "building automake" -fi -# build libtool 2.4 -if [ ! -f tmp/bin/libtool ]; then -( - cd src/libtool && - ./configure --prefix=$JEHANNE/hacking/cross/tmp && - make && make install -) >> cross-toolchain.build.log 2>&1 -failOnError $? "building libtool" -fi - -# FINALLY! We have our OUTDATED autotools in tmp/bin -export PATH=$JEHANNE/hacking/cross/tmp/bin:$PATH -export CROSS_DIR=$JEHANNE/hacking/cross -if [ "$BUILD_DIRS_ROOT" = "" ]; then - export BUILD_DIRS_ROOT=$JEHANNE/hacking/cross/src -fi -if [ ! -d $BUILD_DIRS_ROOT ]; then - mkdir $BUILD_DIRS_ROOT -fi - function dynpatch { - # $1 -> path from cross/src + # $1 -> path from $WORKING_DIR/src # $2 -> string to search - ( cd $JEHANNE/hacking/cross/src && + ( cd $WORKING_DIR/src && grep -q jehanne $1 || - sed -n -i -e "/$2/r ../patch/$1" -e '1x' -e '2,${x;p}' -e '${x;p}' $1 + sed -n -i -e "/$2/r $CROSS_DIR/patch/$1" -e '1x' -e '2,${x;p}' -e '${x;p}' $1 ) } + +# setup Jehanne's headers +usyscalls header $JEHANNE/sys/src/sysconf.json > $JEHANNE/arch/amd64/include/syscalls.h + +mkdir -p $WORKING_DIR +date > $LOG + +# verify libtool is installed +libtool --version >> $LOG +failOnError $? "libtool installation check" + + +cp -fpr $JEHANNE/hacking/cross/src $WORKING_DIR +cd $WORKING_DIR/src +fetch >> $LOG +failOnError $? "fetching sources" + +mkdir -p $WORKING_DIR/build +mkdir -p $WORKING_DIR/cross + # Patch and build binutils -if [ "$BINUTILS_BUILD_DIR" = "" ]; then - export BINUTILS_BUILD_DIR=$BUILD_DIRS_ROOT/build-binutils -fi -if [ ! -d $BINUTILS_BUILD_DIR ]; then - mkdir $BINUTILS_BUILD_DIR -fi -if [ ! -f toolchain/bin/x86_64-jehanne-ar ]; then -( +export BINUTILS_BUILD_DIR=$WORKING_DIR/build/binutils +mkdir -p $BINUTILS_BUILD_DIR + +( ( grep -q jehanne $WORKING_DIR/src/binutils/config.sub || ( + cd $WORKING_DIR sed -i '/jehanne/b; /ELF_TARGET_ID/,/elf_backend_can_gc_sections/s/0x200000/0x1000 \/\/ jehanne hack/g' src/binutils/bfd/elf64-x86-64.c && - sed -i '/jehanne/b; s/| -tirtos/| -tirtos* | -jehanne/g' src/binutils/config.sub && + sed -i '/jehanne/b; s/| midnightbsd\*/| midnightbsd* | jehanne*/g' src/binutils/config.sub && dynpatch 'binutils/bfd/config.bfd' '\# END OF targmatch.h' && - dynpatch 'binutils/gas/configure.tgt' ' i860-\*-\*)' && - ( grep -q jehanne src/binutils/ld/configure.tgt || patch -p1 < patch/binutils/ld/configure.tgt ) && - cp patch/binutils/ld/emulparams/elf_x86_64_jehanne.sh src/binutils/ld/emulparams/ && - cp patch/binutils/ld/emulparams/elf_i386_jehanne.sh src/binutils/ld/emulparams/ && + dynpatch 'binutils/gas/configure.tgt' ' i386-\*-darwin\*)' && + ( grep -q jehanne src/binutils/ld/configure.tgt || patch -p1 < $CROSS_DIR/patch/binutils/ld/configure.tgt ) && + cp $CROSS_DIR/patch/binutils/ld/emulparams/elf_x86_64_jehanne.sh src/binutils/ld/emulparams/ && + cp $CROSS_DIR/patch/binutils/ld/emulparams/elf_i386_jehanne.sh src/binutils/ld/emulparams/ && dynpatch 'binutils/ld/Makefile.am' 'eelf_x86_64.c: ' && (grep 'eelf_i386_jehanne.c \\' src/binutils/ld/Makefile.am || sed -i 's/.*ALL_EMULATION_SOURCES = \\.*/&\n\teelf_i386_jehanne.c \\/' src/binutils/ld/Makefile.am) && (grep 'eelf_x86_64_jehanne.c \\' src/binutils/ld/Makefile.am || sed -i 's/.*ALL_64_EMULATION_SOURCES = \\.*/&\n\teelf_x86_64_jehanne.c \\/' src/binutils/ld/Makefile.am) && - cd src/binutils/ld && automake && cd ../ && + cd src/binutils/ld && automake-1.15 && cd ../ + ) ) && cd $BINUTILS_BUILD_DIR && - $CROSS_DIR/src/binutils/configure --prefix=$JEHANNE/hacking/cross/toolchain --with-sysroot=$JEHANNE --target=x86_64-jehanne --enable-interwork --enable-multilib --disable-nls --disable-werror && - cp $CROSS_DIR/patch/MakeNothing.in $CROSS_DIR/src/binutils/bfd/doc/Makefile && - cp $CROSS_DIR/patch/MakeNothing.in $CROSS_DIR/src/binutils/bfd/po/Makefile && - cp $CROSS_DIR/patch/MakeNothing.in $CROSS_DIR/src/binutils/gas/doc/Makefile && - cp $CROSS_DIR/patch/MakeNothing.in $CROSS_DIR/src/binutils/binutils/doc/Makefile && - make MAKEINFO=true MAKEINFOHTML=true TEXI2DVI=true TEXI2PDF=true DVIPS=true && - make MAKEINFO=true MAKEINFOHTML=true TEXI2DVI=true TEXI2PDF=true DVIPS=true install -) >> cross-toolchain.build.log 2>&1 -failOnError $? "building binutils" -fi + $WORKING_DIR/src/binutils/configure --target=x86_64-jehanne --prefix=/posix --with-sysroot=$JEHANNE --target=x86_64-jehanne --enable-interwork --enable-multilib --enable-newlib-long-time_t --disable-nls --disable-werror && + cp $CROSS_DIR/patch/MakeNothing.in $WORKING_DIR/src/binutils/bfd/doc/Makefile.in && + cp $CROSS_DIR/patch/MakeNothing.in $WORKING_DIR/src/binutils/bfd/po/Makefile.in && + cp $CROSS_DIR/patch/MakeNothing.in $WORKING_DIR/src/binutils/gas/doc/Makefile.in && + cp $CROSS_DIR/patch/MakeNothing.in $WORKING_DIR/src/binutils/binutils/doc/Makefile.in && + make && + make DESTDIR=$WORKING_DIR/cross install +) >> $LOG 2>&1 +failOnError $? "Building binutils" -# Patch and build gcc -if [ "$GCC_BUILD_DIR" = "" ]; then - export GCC_BUILD_DIR=$BUILD_DIRS_ROOT/build-gcc -fi -if [ ! -d $GCC_BUILD_DIR ]; then - mkdir $GCC_BUILD_DIR -fi -( - pwd && - ( grep -q jehanne src/gcc/gcc/config.gcc || patch -p1 < patch/gcc/gcc/config.gcc ) && - cd src && - cp ../patch/gcc/contrib/download_prerequisites gcc/contrib/download_prerequisites && - ( cd gcc && ./contrib/download_prerequisites ) && - dynpatch 'gcc/config.sub' '-none)' && - cp ../patch/gcc/gcc/config/jehanne.h gcc/gcc/config && - dynpatch 'gcc/libstdc++-v3/crossconfig.m4' ' \*)' && - cd gcc/libstdc++-v3 && autoconf -i && cd ../../ && - ( pwd && grep -q jehanne gcc/libgcc/config.host || - sed -i -f ../patch/gcc/libgcc/config.host.sed gcc/libgcc/config.host - ) && - dynpatch 'gcc/fixincludes/mkfixinc.sh' 'i\?86-\*-cygwin\*' && - cd $GCC_BUILD_DIR && - $CROSS_DIR/src/gcc/configure --target=x86_64-jehanne --prefix=$JEHANNE/hacking/cross/toolchain --with-sysroot=$JEHANNE --enable-languages=c,c++ && - make MAKEINFO=true MAKEINFOHTML=true TEXI2DVI=true TEXI2PDF=true DVIPS=true all-gcc all-target-libgcc && - make MAKEINFO=true MAKEINFOHTML=true TEXI2DVI=true TEXI2PDF=true DVIPS=true install-gcc install-target-libgcc -# && -# make MAKEINFO=true MAKEINFOHTML=true TEXI2DVI=true TEXI2PDF=true DVIPS=true all-target-libstdc++-v3 && -# make MAKEINFO=true MAKEINFOHTML=true TEXI2DVI=true TEXI2PDF=true DVIPS=true install-target-libstdc++-v3 -) >> cross-toolchain.build.log 2>&1 -failOnError $? "building gcc" - -# add sh -ln -sf /bin/bash $JEHANNE/hacking/cross/toolchain/bin/x86_64-jehanne-sh - -kill $dotter -wait $dotter 2>/dev/null -echo "done." diff --git a/cross/patch/autoconf/build-aux/git-version-gen b/cross/patch/autoconf/build-aux/git-version-gen deleted file mode 100755 index 26bab70..0000000 --- a/cross/patch/autoconf/build-aux/git-version-gen +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo "2.64" | tr -d '\012' diff --git a/cross/patch/binutils/ld/configure.tgt b/cross/patch/binutils/ld/configure.tgt index a87ce56..27ef033 100644 --- a/cross/patch/binutils/ld/configure.tgt +++ b/cross/patch/binutils/ld/configure.tgt @@ -1,18 +1,18 @@ diff --git a/src/binutils/ld/configure.tgt b/src/binutils/ld/configure.tgt -index 6b6bbf2..29b5f30 100644 +index fad8b2e..ba3ddc9 100644 --- a/src/binutils/ld/configure.tgt +++ b/src/binutils/ld/configure.tgt -@@ -383,6 +383,9 @@ x86_64-*-nacl*) targ_emul=elf32_x86_64_nacl - targ_extra_libpath=$targ_extra_emuls +@@ -370,6 +370,9 @@ targ_extra_emuls="elf_i386_nacl elf_x86_64_nacl armelf_nacl armelfb_nacl" + targ_extra_libpath=$targ_extra_emuls tdir_elf_i386_nacl=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;; +x86_64*-jehanne*) targ_emul=elf_x86_64_jehanne + targ_extra_emuls="elf_i386_jehanne elf_x86_64 elf_i386" + ;; - i860-*-coff) targ_emul=coff_i860 ;; - i860-stardent-sysv4* | i860-stardent-elf*) - targ_emul=elf32_i860 -@@ -852,6 +855,10 @@ ia64-*-aix*) + ia16-*-elf*) targ_emul=elf_i386 targ_extra_emuls=i386msdos ;; + ia64-*-elf*) targ_emul=elf64_ia64 ;; + ia64-*-freebsd* | ia64-*-kfreebsd*-gnu) +@@ -806,6 +809,10 @@ ia64-*-aix*) NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib' ;; diff --git a/cross/patch/gcc.patch b/cross/patch/gcc.patch new file mode 100644 index 0000000..ccf70e4 --- /dev/null +++ b/cross/patch/gcc.patch @@ -0,0 +1,71 @@ +diff --git a/src/gcc/gcc/config.gcc b/src/gcc/gcc/config.gcc +index f02ddbd..e5ebfe0 100644 +--- a/src/gcc/gcc/config.gcc ++++ b/src/gcc/gcc/config.gcc +@@ -862,6 +862,16 @@ case ${target} in + tmake_file="$tmake_file vms/t-vmsnative" + fi + ;; ++*-*-jehanne*) ++ gas=yes ++ gnu_ld=yes ++ default_use_cxa_atexit=yes ++ case $target in ++ x86_64-*) ++ native_system_header_dir="/arch/amd64/include" ++ ;; ++ esac ++ ;; + *-*-vxworks*) + tmake_file=t-vxworks + xm_defines=POSIX +@@ -1347,6 +1357,9 @@ x86_64-*-darwin*) + i[34567]86-*-elf*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h" + ;; ++x86_64-*-jehanne*) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h jehanne.h" ++ ;; + x86_64-*-elf*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h" + ;; +diff --git a/src/gcc/config.sub b/src/gcc/config.sub +index 75bb6a3..1905540 100755 +--- a/src/gcc/config.sub ++++ b/src/gcc/config.sub +@@ -1363,7 +1363,7 @@ case $os in + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ +- | midnightbsd* | amdhsa* | unleashed* | emscripten*) ++ | jehanne* | midnightbsd* | amdhsa* | unleashed* | emscripten*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + qnx*) +diff --git a/src/gcc/fixincludes/mkfixinc.sh b/src/gcc/fixincludes/mkfixinc.sh +index 0f96486..9f0ee74 100755 +--- a/src/gcc/fixincludes/mkfixinc.sh ++++ b/src/gcc/fixincludes/mkfixinc.sh +@@ -14,6 +14,7 @@ case $machine in + i?86-*-cygwin* | \ + i?86-*-mingw32* | \ + x86_64-*-mingw32* | \ ++ *-jehanne* | \ + powerpc-*-eabisim* | \ + powerpc-*-eabi* | \ + powerpc-*-rtems* | \ +diff --git a/src/gcc/libgcc/config.host b/src/gcc/libgcc/config.host +index 91abc84..a994e3a 100644 +--- a/src/gcc/libgcc/config.host ++++ b/src/gcc/libgcc/config.host +@@ -1414,6 +1414,10 @@ nvptx-*) + tmake_file="$tmake_file nvptx/t-nvptx" + extra_parts="crt0.o" + ;; ++x86_64-*-jehanne*) ++ extra_parts="$extra_parts crtbegin.o crtend.o" ++ tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic" ++ ;; + *) + echo "*** Configuration ${host} not supported" 1>&2 + exit 1 diff --git a/cross/patch/gcc/config.sub b/cross/patch/gcc/config.sub deleted file mode 100644 index 9555a9b..0000000 --- a/cross/patch/gcc/config.sub +++ /dev/null @@ -1,3 +0,0 @@ - -jehanne*) - os=-jehanne - ;; diff --git a/cross/patch/gcc/contrib/download_prerequisites b/cross/patch/gcc/contrib/download_prerequisites deleted file mode 100644 index 932dc36..0000000 --- a/cross/patch/gcc/contrib/download_prerequisites +++ /dev/null @@ -1,71 +0,0 @@ -#! /bin/sh - -# Download some prerequisites needed by gcc. -# Run this from the top level of the gcc source tree and the gcc -# build will do the right thing. -# -# (C) 2010 Free Software Foundation -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. - -# If you want to build GCC with the Graphite loop optimizations, -# set GRAPHITE_LOOP_OPT=yes to download optional prerequisties -# ISL Library and CLooG. -GRAPHITE_LOOP_OPT=yes - -if [ ! -e gcc/BASE-VER ] ; then - echo "You must run this script in the top level GCC source directory." - exit 1 -fi - -# Necessary to build GCC. -MPFR=mpfr-2.4.2 -GMP=gmp-4.3.2 -MPC=mpc-0.8.1 - -if [ ! -d $MPFR ]; then - wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure/$MPFR.tar.bz2 || exit 1 - tar xjf $MPFR.tar.bz2 || exit 1 - ln -sf $MPFR mpfr || exit 1 -fi - -if [ ! -d $GMP ]; then - wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure/$GMP.tar.bz2 || exit 1 - tar xjf $GMP.tar.bz2 || exit 1 - ln -sf $GMP gmp || exit 1 -fi - -if [ ! -d $MPC ]; then - wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure/$MPC.tar.gz || exit 1 - tar xzf $MPC.tar.gz || exit 1 - ln -sf $MPC mpc || exit 1 -fi - -# Necessary to build GCC with the Graphite loop optimizations. -if [ "$GRAPHITE_LOOP_OPT" = "yes" ] ; then - ISL=isl-0.12.2 - CLOOG=cloog-0.18.1 - - if [ ! -d $ISL ]; then - wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure/$ISL.tar.bz2 || exit 1 - tar xjf $ISL.tar.bz2 || exit 1 - ln -sf $ISL isl || exit 1 - fi - - if [ ! -d $CLOOG ]; then - wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure/$CLOOG.tar.gz || exit 1 - tar xzf $CLOOG.tar.gz || exit 1 - ln -sf $CLOOG cloog || exit 1 - fi -fi diff --git a/cross/patch/gcc/fixincludes/mkfixinc.sh b/cross/patch/gcc/fixincludes/mkfixinc.sh deleted file mode 100644 index dc0e343..0000000 --- a/cross/patch/gcc/fixincludes/mkfixinc.sh +++ /dev/null @@ -1 +0,0 @@ - *-jehanne* | \ diff --git a/cross/patch/gcc/gcc/config.gcc b/cross/patch/gcc/gcc/config.gcc deleted file mode 100644 index 0ee95ab..0000000 --- a/cross/patch/gcc/gcc/config.gcc +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/src/gcc/gcc/config.gcc b/src/gcc/gcc/config.gcc -index f02ddbd..e5ebfe0 100644 ---- a/src/gcc/gcc/config.gcc -+++ b/src/gcc/gcc/config.gcc -@@ -862,6 +862,16 @@ case ${target} in - tmake_file="$tmake_file vms/t-vmsnative" - fi - ;; -+*-*-jehanne*) -+ gas=yes -+ gnu_ld=yes -+ default_use_cxa_atexit=yes -+ case $target in -+ x86_64-*) -+ native_system_header_dir="/arch/amd64/include" -+ ;; -+ esac -+ ;; - *-*-vxworks*) - tmake_file=t-vxworks - xm_defines=POSIX -@@ -1347,6 +1357,9 @@ x86_64-*-darwin*) - i[34567]86-*-elf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h" - ;; -+x86_64-*-jehanne*) -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h jehanne.h" -+ ;; - x86_64-*-elf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h" - ;; diff --git a/cross/patch/gcc/gcc/config/jehanne.h b/cross/patch/gcc/gcc/config/jehanne.h index 1977cfb..7f99e6c 100644 --- a/cross/patch/gcc/gcc/config/jehanne.h +++ b/cross/patch/gcc/gcc/config/jehanne.h @@ -1,7 +1,7 @@ /* * This file is part of Jehanne. * - * Copyright (C) 2016 Giacomo Tesio + * Copyright (C) 2016-2019 Giacomo Tesio * * Jehanne is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,10 +68,6 @@ #undef ENDFILE_SPEC #define ENDFILE_SPEC "crtend.o%s crtn.o%s" -/* Don't automatically add extern "C" { } around header files. */ -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C 1 - /* Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67132 */ #undef WCHAR_TYPE #define WCHAR_TYPE "unsigned int" diff --git a/cross/patch/gcc/libgcc/config.host b/cross/patch/gcc/libgcc/config.host deleted file mode 100644 index 390276f..0000000 --- a/cross/patch/gcc/libgcc/config.host +++ /dev/null @@ -1,4 +0,0 @@ -x86_64-*-jehanne*) - extra_parts="$extra_parts crtbegin.o crtend.o" - tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic" - ;; diff --git a/cross/patch/gcc/libgcc/config.host.sed b/cross/patch/gcc/libgcc/config.host.sed deleted file mode 100644 index 6854d52..0000000 --- a/cross/patch/gcc/libgcc/config.host.sed +++ /dev/null @@ -1,3 +0,0 @@ -/enable_execute_stack=enable-execute-stack-empty.c;/,/Configuration ${host} not supported/{ - /^case ${host} in$/r ../patch/gcc/libgcc/config.host -} diff --git a/cross/patch/gcc/libstdc++-v3/crossconfig.m4 b/cross/patch/gcc/libstdc++-v3/crossconfig.m4 deleted file mode 100644 index a74ca37..0000000 --- a/cross/patch/gcc/libstdc++-v3/crossconfig.m4 +++ /dev/null @@ -1,6 +0,0 @@ - *-jehanne*) - GLIBCXX_CHECK_COMPILER_FEATURES - GLIBCXX_CHECK_LINKER_FEATURES - GLIBCXX_CHECK_MATH_SUPPORT - GLIBCXX_CHECK_STDLIB_SUPPORT - ;; diff --git a/cross/patch/libgmp.patch b/cross/patch/libgmp.patch new file mode 100644 index 0000000..7a33851 --- /dev/null +++ b/cross/patch/libgmp.patch @@ -0,0 +1,11 @@ +diff -Naru ../orig/configfsf.sub ./configfsf.sub +--- ../orig/configfsf.sub 2018-11-26 11:59:08.897396848 +0100 ++++ ./configfsf.sub 2018-11-26 12:20:10.079672849 +0100 +@@ -1399,6 +1399,7 @@ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ ++ | -jehanne* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; diff --git a/cross/patch/libmpc.patch b/cross/patch/libmpc.patch new file mode 100644 index 0000000..b207673 --- /dev/null +++ b/cross/patch/libmpc.patch @@ -0,0 +1,11 @@ +diff -Naru ../orig/config.sub ./config.sub +--- ../orig/config.sub 2018-11-27 00:30:59.807843647 +0100 ++++ ./config.sub 2018-11-27 00:32:49.224841688 +0100 +@@ -1393,6 +1393,7 @@ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ ++ | -jehanne* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; diff --git a/cross/patch/libmpfr.patch b/cross/patch/libmpfr.patch new file mode 100644 index 0000000..74f3e61 --- /dev/null +++ b/cross/patch/libmpfr.patch @@ -0,0 +1,11 @@ +diff -Naru ../orig/config.sub ./config.sub +--- ../orig/config.sub 2018-11-26 14:23:59.224388851 +0100 ++++ ./config.sub 2018-11-26 14:24:55.300412850 +0100 +@@ -1416,6 +1416,7 @@ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ ++ | -jehanne* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; diff --git a/cross/src/.gitignore b/cross/src/.gitignore deleted file mode 100644 index e3300fa..0000000 --- a/cross/src/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -gcc -binutils -autoconf -automake -libtool -m4 -build-* diff --git a/cross/src/fetch.json b/cross/src/fetch.json index 5e93a19..6ea8069 100644 --- a/cross/src/fetch.json +++ b/cross/src/fetch.json @@ -1,38 +1,28 @@ { - "autoconf" : { - "Upstream":"https://ftp.gnu.org/gnu/autoconf/autoconf-2.64.tar.bz2", + "libgmp" : { + "Upstream":"https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2", "Digest": { - "sha256":"872f4cadf12e7e7c8a2414e047fdff26b517c7f1a977d72433c124d0d3acaa85" + "sha256":"5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2" }, "Compress":"bzip2", "RemovePrefix": true, "Exclude": [ ] }, - "m4": { - "Upstream":"https://ftp.gnu.org/gnu/m4/m4-1.4.14.tar.bz2", + "libmpfr" : { + "Upstream":"https://www.mpfr.org/mpfr-4.0.1/mpfr-4.0.1.tar.bz2", "Digest": { - "sha256":"0885ffa93256353a96b1cf0bcbc4d639ed09953b687e6cc412c4048e656f4dd2" + "sha256":"a4d97610ba8579d380b384b225187c250ef88cfe1d5e7226b89519374209b86b" }, "Compress":"bzip2", "RemovePrefix": true, "Exclude": [ ] }, - "automake": { - "Upstream":"https://ftp.gnu.org/gnu/automake/automake-1.11.1.tar.bz2", + "libmpc" : { + "Upstream":"https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz", "Digest": { - "sha256":"5b159d3c0e0a1f87de71b68bcb9f1a1c49e9e71749c9b723f17e2e1e0295c7ae" - }, - "Compress":"bzip2", - "RemovePrefix": true, - "Exclude": [ - ] - }, - "libtool": { - "Upstream":"https://ftp.gnu.org/gnu/libtool/libtool-2.4.tar.gz", - "Digest": { - "sha256":"13df57ab63a94e196c5d6e95d64e53262834fe780d5e82c28f177f9f71ddf62e" + "sha256":"6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e" }, "Compress":"gzip", "RemovePrefix": true, @@ -40,9 +30,9 @@ ] }, "binutils": { - "Upstream":"https://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.bz2", + "Upstream":"http://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2", "Digest": { - "sha256":"c2ace41809542f5237afc7e3b8f32bb92bc7bc53c6232a84463c423b0714ecd9" + "sha256":"0cb4843da15a65a953907c96bad658283f3c4419d6bcc56bf2789db16306adb2" }, "Compress":"bzip2", "RemovePrefix": true, @@ -50,13 +40,14 @@ ] }, "gcc": { - "Upstream":"https://ftp.gnu.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.bz2", + "Upstream":"https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.gz", "Digest": { - "sha256":"6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092" + "sha256":"a931a750d6feadacbeecb321d73925cd5ebb6dfa7eff0802984af3aef63759f4" }, - "Compress":"bzip2", + "Compress":"gzip", "RemovePrefix": true, "Exclude": [ ] } + }