diff options
author | Xiaotian Wu | 2022-09-11 21:26:19 +0800 |
---|---|---|
committer | Xiaotian Wu | 2022-09-11 21:26:19 +0800 |
commit | 7683adca779feb107d337965b918f87b42ef29f4 (patch) | |
tree | ae6fc980269967b7407f664ade8dae0875e10b02 | |
download | aur-7683adca779feb107d337965b918f87b42ef29f4.tar.gz |
gcc-12.2.1-20220911
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 102 |
2 files changed, 125 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..69cefdc81420 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = loongarch64-linux-gnu-gcc-bootstrap + pkgdesc = Cross compiler for LoongArch 64-bit + pkgver = 12.2.1 + pkgrel = 1 + url = https://gcc.gnu.org/ + arch = x86_64 + groups = loongarch + license = GPL + license = LGPL + license = FDL + depends = loongarch64-linux-gnu-binutils + depends = loongarch64-linux-gnu-glibc + depends = libmpc + depends = libisl + depends = zstd + provides = loongarch64-linux-gnu-gcc + conflicts = loongarch64-linux-gnu-gcc + options = !emptydirs + options = !strip + source = https://github.com/yetist/gcc/releases/download/v20220911/gcc-12.2.1-20220911.tar.xz + sha256sums = cbdf44fb512a626a3d8d3141fd20ea22737b738ca46e55f3c7af9195bdef11a7 + +pkgname = loongarch64-linux-gnu-gcc-bootstrap diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..ffe0b43fa5dd --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,102 @@ +_target=loongarch64-linux-gnu +pkgname=$_target-gcc-bootstrap +pkgver=12.2.1 +_pkgdate=20220911 +pkgrel=1 +pkgdesc='Cross compiler for LoongArch 64-bit' +arch=('x86_64') +url='https://gcc.gnu.org/' +license=('GPL' 'LGPL' 'FDL') +groups=('loongarch') +depends=("$_target-binutils" "$_target-glibc" 'libmpc' 'libisl' 'zstd') +options=('!emptydirs' '!strip') +provides=($_target-gcc) +conflicts=($_target-gcc) +source=("https://github.com/yetist/gcc/releases/download/v${_pkgdate}/gcc-${pkgver}-${_pkgdate}.tar.xz") +sha256sums=('cbdf44fb512a626a3d8d3141fd20ea22737b738ca46e55f3c7af9195bdef11a7') + +prepare() { + cd gcc-$pkgver + + echo $pkgver > gcc/BASE-VER + + # Do not run fixincludes + sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in + + rm -rf "$srcdir/gcc-build" + mkdir "$srcdir/gcc-build" +} + +build() { + cd gcc-build + + CFLAGS=${CFLAGS/-Werror=format-security/} + CXXFLAGS=${CXXFLAGS/-Werror=format-security/} + + # Using -pipe causes spurious test-suite failures. + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565 + CFLAGS=${CFLAGS/-pipe/} + CXXFLAGS=${CXXFLAGS/-pipe/} + + "$srcdir/gcc-$pkgver/configure" \ + --prefix=/usr \ + --program-prefix=$_target- \ + --with-local-prefix=/usr/$_target \ + --with-sysroot=/usr/$_target \ + --with-build-sysroot=/usr/$_target \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --target=$_target \ + --host=$CHOST \ + --build=$CHOST \ + --with-system-zlib \ + --with-isl \ + --disable-nls \ + --disable-libunwind-exceptions \ + --disable-libssp \ + --disable-multilib \ + --disable-werror \ + --enable-languages=c \ + --disable-shared \ + --enable-linker-build-id \ + --with-gnu-as \ + --with-gnu-ld \ + --with-newlib \ + --without-headers \ + --without-included-gettext \ + --enable-lto \ + --disable-multilib \ + --enable-plugin \ + --disable-decimal-float \ + --disable-gold \ + --disable-libatomic \ + --disable-libgcj \ + --disable-libvtv \ + --disable-threads \ + --enable-tls \ + --enable-checking=release + + make -j`nproc` +} + +package() { + make -C gcc-build DESTDIR="$pkgdir" \ + install-gcc install-target-{libgcc,libstdc++-v3,libgomp,libgfortran,libquadmath,libatomic} +#install-gcc install-target-libgcc install-target-libstdc++-v3 + + # Strip target binaries + find "$pkgdir/usr/lib/gcc/$_target/" -type f \ + -and \( -name \*.a -or -name \*.o \) -exec $_target-objcopy \ + -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames \ + -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str \ + -R .debug_ranges -R .debug_loc '{}' \; + + # Strip host binaries + find "$pkgdir/usr/bin/" "$pkgdir/usr/lib/gcc/$_target/" -type f \ + -and \( -executable \) -exec strip '{}' \; || true + + # Remove files that conflict with host gcc package + rm -r "$pkgdir/usr/share/"{man,info} +} + +# vim: ts=2 sw=2 et: |