core/gcc/Pkgfile

77 lines
2.4 KiB
Plaintext
Raw Normal View History

2006-02-23 16:26:10 +01:00
# Description: The GNU Compiler Collection
2022-01-07 18:37:13 +01:00
# URL: https://gcc.gnu.org
2021-04-09 15:00:32 +02:00
# Maintainer: CRUX System Team, core-ports at crux dot nu
2024-05-19 15:22:13 +02:00
# Depends on: libgmp libmpc libmpfr zlib zstd
2006-02-23 16:26:10 +01:00
name=gcc
2024-08-01 18:17:43 +02:00
version=14.2.0
2023-08-21 22:17:01 +02:00
release=1
2021-12-28 16:57:54 +01:00
source=(https://sourceware.org/pub/gcc/releases/gcc-$version/$name-$version.tar.xz
2023-12-24 12:43:51 +01:00
$name-nocheck-fixincludes.patch $name-4.7.3-multilib-dirs.patch)
2008-09-17 10:43:39 +02:00
2006-02-23 16:26:10 +01:00
build() {
2023-12-24 12:43:51 +01:00
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
2023-08-21 22:17:01 +02:00
2024-05-19 15:22:13 +02:00
sed -e '/m64=/s/lib64/lib/' -i $SRC/$name-$version/gcc/config/i386/t-linux64
2023-08-21 22:17:01 +02:00
2023-12-24 12:43:51 +01:00
# pipe fails tests
CFLAGS=${CFLAGS/-pipe/}
CXXFLAGS=${CXXFLAGS/-pipe/}
2023-08-21 22:17:01 +02:00
2023-12-24 12:43:51 +01:00
mkdir build
cd build
../$name-$version/configure \
--prefix=/usr \
--libexecdir=/usr/lib \
--enable-threads=posix \
2024-05-19 15:22:13 +02:00
--with-build-config=bootstrap-lto \
2023-12-24 12:43:51 +01:00
--with-linker-hash-style=gnu \
2024-05-19 15:22:13 +02:00
--with-system-zlib \
--enable-languages=c,c++,lto \
--enable-stage1-languages=c,lto \
2023-12-24 12:43:51 +01:00
--enable-link-serialization=1 \
--enable-linker-build-id \
--enable-gnu-indirect-function \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-shared \
--enable-lto \
--enable-multilib \
--enable-plugin \
--enable-default-pie \
--enable-default-ssp \
2024-05-19 15:22:13 +02:00
--enable-host-pie \
2023-12-24 12:43:51 +01:00
--with-pkgversion="CRUX-x86_64-multilib" \
2024-05-19 15:22:13 +02:00
--with-x=no \
--disable-fixincludes \
2023-12-24 12:43:51 +01:00
--disable-nls
2023-08-21 22:17:01 +02:00
2023-12-24 12:43:51 +01:00
make -O STAGE1_CFLAGS="-O2" \
BOOT_CFLAGS="$CFLAGS" \
BOOT_LDFLAGS="$LDFLAGS" \
LDFLAGS_FOR_TARGET="$LDFLAGS" \
bootstrap
make -j1 DESTDIR=$PKG install
2023-08-21 22:17:01 +02:00
2023-12-24 12:43:51 +01:00
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++
2023-08-21 22:17:01 +02:00
2023-12-24 12:43:51 +01:00
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}
2023-08-21 22:17:01 +02:00
2023-12-24 12:43:51 +01:00
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
2023-08-21 22:17:01 +02:00
2024-05-19 15:22:13 +02:00
mkdir $PKG/usr/lib/bfd-plugins
ln -sfv ../../lib/gcc/$($PKG/usr/bin/gcc -dumpmachine)/14.1.0/liblto_plugin.so \
$PKG/usr/lib/bfd-plugins/
2023-12-24 12:43:51 +01:00
sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib{,32}/{libstdc++.la,libsupc++.la}
2006-02-23 16:26:10 +01:00
}