61 lines
1.7 KiB
Plaintext
61 lines
1.7 KiB
Plaintext
# Description: The GNU Compiler Collection
|
|
# URL: https://gcc.gnu.org
|
|
# Maintainer: CRUX System Team, core-ports at crux dot nu
|
|
# Depends on: libmpc zlib zstd
|
|
|
|
name=gcc
|
|
version=12.3.0
|
|
release=2
|
|
source=(https://sourceware.org/pub/gcc/releases/gcc-$version/$name-$version.tar.xz
|
|
$name-nocheck-fixincludes.patch $name-4.7.3-multilib-dirs.patch
|
|
fix-nested-generic-lambda.patch)
|
|
|
|
build() {
|
|
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
|
|
patch -d $name-$version -p1 -i $SRC/fix-nested-generic-lambda.patch
|
|
|
|
# pipe fails tests
|
|
CFLAGS=${CFLAGS/-pipe/}
|
|
CXXFLAGS=${CXXFLAGS/-pipe/}
|
|
|
|
mkdir build
|
|
cd build
|
|
../$name-$version/configure \
|
|
--prefix=/usr \
|
|
--libexecdir=/usr/lib \
|
|
--enable-languages=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}
|
|
}
|