# SPDX-License-Identifier: GPL-2.0-or-later # Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2023-present Fewtarius PKG_NAME="gcc" PKG_VERSION="12.3.0" PKG_LICENSE="GPL-2.0-or-later" PKG_SITE="https://gcc.gnu.org/" PKG_URL="https://ftpmirror.gnu.org/gcc/${PKG_NAME}-${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}.tar.xz" PKG_DEPENDS_BOOTSTRAP="ccache:host autoconf:host binutils:host gmp:host mpfr:host mpc:host zstd:host" PKG_DEPENDS_TARGET="toolchain" PKG_DEPENDS_HOST="ccache:host autoconf:host binutils:host gmp:host mpfr:host mpc:host zstd:host glibc" PKG_DEPENDS_INIT="toolchain" PKG_LONGDESC="This package contains the GNU Compiler Collection." if [ "${MOLD_SUPPORT}" = "yes" ]; then PKG_DEPENDS_HOST+=" mold:host" fi case ${TARGET_ARCH} in arm|aarch64|riscv64) OPTS_LIBATOMIC="--enable-libatomic" ;; *) OPTS_LIBATOMIC="--disable-libatomic" ;; esac GCC_COMMON_CONFIGURE_OPTS="--target=${TARGET_NAME} \ --with-sysroot=${SYSROOT_PREFIX} \ --with-gmp=${TOOLCHAIN} \ --with-mpfr=${TOOLCHAIN} \ --with-mpc=${TOOLCHAIN} \ --with-zstd=${TOOLCHAIN} \ --with-gnu-as \ --with-gnu-ld \ --enable-plugin \ --enable-lto \ --enable-gold \ --enable-ld=default \ --with-linker-hash-style=gnu \ --disable-multilib \ --disable-nls \ --enable-checking=release \ --without-ppl \ --without-cloog \ --disable-libada \ --disable-libmudflap \ --disable-libitm \ --disable-libquadmath \ --enable-libgomp \ --disable-libmpx \ --disable-libssp \ --disable-static \ --enable-shared \ --enable-__cxa_atexit" PKG_CONFIGURE_OPTS_BOOTSTRAP="${GCC_COMMON_CONFIGURE_OPTS} \ --enable-cloog-backend=isl \ --disable-decimal-float \ --disable-gcov \ --enable-languages=c \ --disable-libatomic \ --disable-libgomp \ --disable-libsanitizer \ --disable-shared \ --disable-threads \ --without-headers \ --with-newlib \ ${GCC_OPTS}" PKG_CONFIGURE_OPTS_HOST="${GCC_COMMON_CONFIGURE_OPTS} \ --enable-languages=c,c++ \ ${OPTS_LIBATOMIC} \ --enable-decimal-float \ --enable-tls \ --enable-shared \ --disable-static \ --enable-long-long \ --enable-threads=posix \ --disable-libstdcxx-pch \ --enable-libstdcxx-time \ --enable-clocale=gnu \ ${GCC_OPTS}" PKG_CONFIGURE_OPTS_TARGET="${PKG_CONFIGURE_OPTS_HOST}" post_makeinstall_bootstrap() { GCC_VERSION=$(${TOOLCHAIN}/bin/${TARGET_NAME}-gcc -dumpversion) DATE="0401$(echo ${GCC_VERSION} | sed 's/\./0/g')" CROSS_CC=${TARGET_PREFIX}gcc-${GCC_VERSION} rm -f ${TARGET_PREFIX}gcc cat > ${TARGET_PREFIX}gcc < ${TARGET_PREFIX}gcc < ${TARGET_PREFIX}g++ <