# Description: The GNU Compiler Collection # URL: https://gcc.gnu.org # Contributor: CRUX System Team, core-ports at crux dot nu # Maintainer: Erich Eckner, crux at eckner dot net # Depends on: libmpc zlib zstd # You can use http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7 # to bootstrap (then you only need core/gcc installed). Run # > find $install_dir \( -name ld -o -name -as \) -delete # and # export PATH="$install_dir/bin:$PATH" # before compiling ($install_dir should be the directory into which you # temporarily installed gnat-gpl). name=gcc version=12.4.0 release=1 source=(https://sourceware.org/pub/gcc/releases/gcc-$version/$name-$version.tar.xz $name-nocheck-fixincludes.patch $name-4.7.3-multilib-dirs.patch) build() { # fix libasan.a sed -e '/static.*SIGSTKSZ/d' \ -e 's/return kAltStackSize/return SIGSTKSZ * 4/' \ -i $name-$version/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp patch -d $name-$version -p1 -i $SRC/$name-nocheck-fixincludes.patch patch -d $name-$version -p1 -i $SRC/$name-4.7.3-multilib-dirs.patch # pipe fails tests CFLAGS=${CFLAGS/-pipe/} CXXFLAGS=${CXXFLAGS/-pipe/} mkdir build cd build ../$name-$version/configure \ --prefix=/usr \ --libexecdir=/usr/lib \ --enable-languages=ada,c,c++,lto \ --enable-threads=posix \ --enable-__cxa_atexit \ --enable-clocale=gnu \ --enable-shared \ --enable-lto \ --with-x=no \ --enable-multilib \ --enable-plugin \ --enable-default-pie \ --enable-default-ssp \ --with-pkgversion="CRUX-x86_64-multilib" \ --with-system-zlib \ --disable-nls make bootstrap make -j1 DESTDIR=$PKG install install -d $PKG/lib ln -sf ../usr/bin/cpp $PKG/lib/cpp ln -sf gcc $PKG/usr/bin/cc ln -sf g++ $PKG/usr/bin/c++ mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/ rm -r $PKG/usr/share/{info,$name-$version} rm -r $PKG/usr/bin/*-linux-gnu-* rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed} for D in lib{,32}; do install -d -m 0755 $PKG/usr/share/gdb/auto-load/usr/${D} mv $PKG/usr/${D}/libstdc++.so.*-gdb.py $PKG/usr/share/gdb/auto-load/usr/${D} done sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib{,32}/{libstdc++.la,libsupc++.la} }