Revert compiler changes.

This commit is contained in:
fewtarius 2022-07-02 17:30:08 -04:00
parent 7f33d74c82
commit dad87daf97
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
9 changed files with 99 additions and 156 deletions

View file

@ -10,7 +10,7 @@
# determine architecture's family
case $TARGET_CPU in
generic|cortex-a35|cortex-a53|cortex-a57|cortex-a72|exynos-m1|qdf24xx|thunderx|xgene1|cortex-a57.cortex-a53|cortex-a55|cortex-a72.cortex-a53)
generic|cortex-a35|cortex-a53|cortex-a57|cortex-a72|exynos-m1|qdf24xx|thunderx|xgene1|cortex-a57.cortex-a53|cortex-a72.cortex-a53)
TARGET_SUBARCH=aarch64
TARGET_VARIANT=armv8-a
TARGET_ABI=eabi

View file

@ -41,7 +41,7 @@
TARGET_FPU_FLAGS="-mfloat-abi=$TARGET_FLOAT -mfpu=$TARGET_FPU"
TARGET_FEATURES+=" neon"
;;
cortex-a35|cortex-a53|cortex-a55|cortex-a72.cortex-a53)
cortex-a35|cortex-a53|cortex-a72.cortex-a53)
TARGET_SUBARCH=armv8-a
TARGET_ABI=eabi
TARGET_FPU_FLAGS="-mfloat-abi=$TARGET_FLOAT -mfpu=$TARGET_FPU"

View file

@ -61,12 +61,18 @@ XORG_PATH_DRIVERS=/usr/lib/xorg/modules/drivers
. config/optimize
# use different toolchain for 64/32 split builds
# use ARM toolchain on 64/32 split builds
if [ -z "$KERNEL_TOOLCHAIN" -a "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then
KERNEL_TOOLCHAIN="aarch64"
if [ "${MACHINE_HARDWARE_NAME}" = "x86_64" ]; then
KERNEL_TOOLCHAIN="aarch64-none-linux-gnu"
elif [ "${MACHINE_HARDWARE_NAME}" = "aarch64" ]; then
KERNEL_TOOLCHAIN="aarch64-none-elf"
else
die "No known toolchain available for ${MACHINE_HARDWARE_NAME}."
fi
fi
if [ -n "$KERNEL_TOOLCHAIN" ]; then
TARGET_KERNEL_PREFIX=$KERNEL_TOOLCHAIN-none-elf-
TARGET_KERNEL_PREFIX=$TOOLCHAIN/lib/gcc-arm-$KERNEL_TOOLCHAIN/bin/$KERNEL_TOOLCHAIN-
else
TARGET_KERNEL_PREFIX=$TARGET_PREFIX
fi

View file

@ -1,52 +0,0 @@
# 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)
PKG_NAME="binutils-aarch64"
PKG_VERSION="$(get_pkg_version binutils)"
PKG_LICENSE="GPL"
PKG_URL=""
PKG_DEPENDS_HOST="toolchain:host"
PKG_LONGDESC="A GNU collection of binary utilities for 64-bit ARM."
PKG_DEPENDS_UNPACK+=" binutils"
PKG_PATCH_DIRS+=" $(get_pkg_directory binutils)/patches"
PKG_CONFIGURE_OPTS_HOST="--target=aarch64-none-elf \
--with-sysroot=${SYSROOT_PREFIX} \
--with-lib-path=${SYSROOT_PREFIX}/lib:${SYSROOT_PREFIX}/usr/lib \
--without-ppl \
--enable-static \
--without-cloog \
--disable-werror \
--disable-multilib \
--disable-libada \
--disable-libssp \
--enable-version-specific-runtime-libs \
--enable-plugins \
--enable-gold \
--enable-ld=default \
--enable-lto \
--disable-nls"
unpack() {
mkdir -p ${PKG_BUILD}
tar --strip-components=1 -xf ${SOURCES}/binutils/binutils-${PKG_VERSION}.tar.xz -C ${PKG_BUILD}
}
pre_configure_host() {
unset CPPFLAGS
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
}
make_host() {
make configure-host
make MAKEINFO=true
}
makeinstall_host() {
cp -v ../include/libiberty.h ${SYSROOT_PREFIX}/usr/include
make -C bfd install # fix parallel build with libctf requiring bfd
make MAKEINFO=true install
}

View file

@ -26,8 +26,8 @@ esac
PKG_KERNEL_CFG_FILE=$(kernel_config_path) || die
if [ -n "${KERNEL_TOOLCHAIN}" ]; then
PKG_DEPENDS_HOST+=" gcc-${KERNEL_TOOLCHAIN}:host"
PKG_DEPENDS_TARGET+=" gcc-${KERNEL_TOOLCHAIN}:host"
PKG_DEPENDS_HOST="${PKG_DEPENDS_HOST} gcc-arm-${KERNEL_TOOLCHAIN}:host"
PKG_DEPENDS_TARGET="${PKG_DEPENDS_TARGET} gcc-arm-${KERNEL_TOOLCHAIN}:host"
HEADERS_ARCH=${TARGET_ARCH}
fi

View file

@ -1,73 +0,0 @@
# 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)
PKG_NAME="gcc-aarch64"
PKG_VERSION="$(get_pkg_version gcc)"
PKG_LICENSE="GPL-2.0-or-later"
PKG_URL=""
PKG_DEPENDS_HOST="toolchain:host ccache:host autoconf:host binutils-aarch64:host gmp:host mpfr:host mpc:host zstd:host"
PKG_LONGDESC="This package contains the GNU Compiler Collection for 64-bit ARM."
PKG_DEPENDS_UNPACK+=" gcc"
PKG_PATCH_DIRS+=" $(get_pkg_directory gcc)/patches"
PKG_CONFIGURE_OPTS_HOST="--target=aarch64-none-elf \
--with-sysroot=${SYSROOT_PREFIX} \
--with-gmp=${TOOLCHAIN} \
--with-mpfr=${TOOLCHAIN} \
--with-mpc=${TOOLCHAIN} \
--with-zstd=${TOOLCHAIN} \
--with-gnu-as \
--with-gnu-ld \
--with-newlib \
--without-ppl \
--without-headers \
--without-cloog \
--enable-__cxa_atexit \
--enable-checking=release \
--enable-gold \
--enable-languages=c \
--enable-ld=default \
--enable-lto \
--enable-plugin \
--enable-static \
--disable-decimal-float \
--disable-gcov \
--disable-libada \
--disable-libatomic \
--disable-libgomp \
--disable-libitm \
--disable-libmpx \
--disable-libmudflap \
--disable-libquadmath \
--disable-libquadmath-support \
--disable-libsanitizer \
--disable-libssp \
--disable-multilib \
--disable-nls \
--disable-shared \
--disable-threads"
unpack() {
mkdir -p ${PKG_BUILD}
tar --strip-components=1 -xf ${SOURCES}/gcc/gcc-${PKG_VERSION}.tar.xz -C ${PKG_BUILD}
}
post_makeinstall_host() {
PKG_GCC_PREFIX="${TOOLCHAIN}/bin/aarch64-none-elf-"
GCC_VERSION=$(${PKG_GCC_PREFIX}gcc -dumpversion)
DATE="0501$(echo ${GCC_VERSION} | sed 's/\./0/g')"
CROSS_CC=${PKG_GCC_PREFIX}gcc-${GCC_VERSION}
rm -f ${PKG_GCC_PREFIX}gcc
cat > ${PKG_GCC_PREFIX}gcc <<EOF
#!/bin/sh
${TOOLCHAIN}/bin/ccache ${CROSS_CC} "\$@"
EOF
chmod +x ${PKG_GCC_PREFIX}gcc
# To avoid cache trashing
touch -c -t ${DATE} ${CROSS_CC}
}

View file

@ -0,0 +1,35 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="gcc-arm-aarch64-none-elf"
PKG_VERSION="11.2-2022.02"
PKG_LICENSE="GPL"
PKG_SITE="https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a"
PKG_URL="https://developer.arm.com/-/media/Files/downloads/gnu/${PKG_VERSION}/binrel/gcc-arm-${PKG_VERSION}-aarch64-aarch64-none-elf.tar.xz"
PKG_DEPENDS_HOST="ccache:host"
PKG_LONGDESC="ARM Aarch64 GNU Linux Binary Toolchain"
PKG_TOOLCHAIN="manual"
makeinstall_host() {
mkdir -p ${TOOLCHAIN}/lib/gcc-arm-aarch64-none-elf/
cp -a * ${TOOLCHAIN}/lib/gcc-arm-aarch64-none-elf
# wrap gcc and g++ with ccache like in gcc package.mk
PKG_GCC_PREFIX="${TOOLCHAIN}/lib/gcc-arm-aarch64-none-elf/bin/aarch64-none-elf-"
cp "${PKG_GCC_PREFIX}gcc" "${PKG_GCC_PREFIX}gcc.real"
cat > "${PKG_GCC_PREFIX}gcc" << EOF
#!/bin/sh
${TOOLCHAIN}/bin/ccache ${PKG_GCC_PREFIX}gcc.real "\$@"
EOF
chmod +x "${PKG_GCC_PREFIX}gcc"
cp "${PKG_GCC_PREFIX}g++" "${PKG_GCC_PREFIX}g++.real"
cat > "${PKG_GCC_PREFIX}g++" << EOF
#!/bin/sh
${TOOLCHAIN}/bin/ccache ${PKG_GCC_PREFIX}g++.real "\$@"
EOF
chmod +x "${PKG_GCC_PREFIX}g++"
}

View file

@ -0,0 +1,35 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="gcc-arm-aarch64-none-linux-gnu"
PKG_VERSION="11.2-2022.02"
PKG_LICENSE="GPL"
PKG_SITE="https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a"
PKG_URL="https://developer.arm.com/-/media/Files/downloads/gnu/${PKG_VERSION}/binrel/gcc-arm-${PKG_VERSION}-x86_64-aarch64-none-linux-gnu.tar.xz"
PKG_DEPENDS_HOST="ccache:host"
PKG_LONGDESC="ARM Aarch64 GNU Linux Binary Toolchain"
PKG_TOOLCHAIN="manual"
makeinstall_host() {
mkdir -p ${TOOLCHAIN}/lib/gcc-arm-aarch64-none-linux-gnu/
cp -a * ${TOOLCHAIN}/lib/gcc-arm-aarch64-none-linux-gnu
# wrap gcc and g++ with ccache like in gcc package.mk
PKG_GCC_PREFIX="${TOOLCHAIN}/lib/gcc-arm-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-"
cp "${PKG_GCC_PREFIX}gcc" "${PKG_GCC_PREFIX}gcc.real"
cat > "${PKG_GCC_PREFIX}gcc" << EOF
#!/bin/sh
${TOOLCHAIN}/bin/ccache ${PKG_GCC_PREFIX}gcc.real "\$@"
EOF
chmod +x "${PKG_GCC_PREFIX}gcc"
cp "${PKG_GCC_PREFIX}g++" "${PKG_GCC_PREFIX}g++.real"
cat > "${PKG_GCC_PREFIX}g++" << EOF
#!/bin/sh
${TOOLCHAIN}/bin/ccache ${PKG_GCC_PREFIX}g++.real "\$@"
EOF
chmod +x "${PKG_GCC_PREFIX}g++"
}

View file

@ -5,38 +5,32 @@
# Copyright (C) 2022-present Fewtarius
PKG_NAME="linux"
PKG_URL="https://github.com/JustEnoughLinuxOS/rockchip-kernel.git"
PKG_VERSION="1a8d74081"
PKG_GIT_CLONE_BRANCH="main"
PKG_LICENSE="GPL"
PKG_SITE="http://www.kernel.org"
PKG_DEPENDS_HOST="ccache:host openssl:host"
PKG_DEPENDS_TARGET="toolchain linux:host cpio:host kmod:host xz:host wireless-regdb keyutils ${KERNEL_EXTRA_DEPENDS_TARGET}"
PKG_DEPENDS_INIT="toolchain"
PKG_NEED_UNPACK="${LINUX_DEPENDS} $(get_pkg_directory busybox)"
PKG_LONGDESC="This package builds the kernel for Rockchip devices"
PKG_LONGDESC="This package builds the kernel for the RG552"
PKG_IS_KERNEL_PKG="yes"
PKG_STAMP="${KERNEL_TARGET} ${KERNEL_MAKE_EXTRACMD}"
PKG_PATCH_DIRS+="${DEVICE}"
PKG_GIT_CLONE_BRANCH="main"
GET_HANDLER_SUPPORT="git"
if [[ "${DEVICE}" =~ RG552 ]]
then
PKG_URL="https://github.com/JustEnoughLinuxOS/rockchip-kernel.git"
PKG_VERSION="1a8d74081"
elif [[ "${DEVICE}" =~ RG351 ]]
if [[ "${DEVICE}" =~ RG351 ]]
then
PKG_URL="https://github.com/JustEnoughLinuxOS/rg351x-kernel.git"
PKG_VERSION="0c4ffa0fe"
elif [[ "${DEVICE}" =~ RG503 ]] || [[ "${DEVICE}" =~ RG353P ]]
then
PKG_URL="https://github.com/JustEnoughLinuxOS/rk356x-kernel.git"
PKG_VERSION="042850fbc"
fi
PKG_KERNEL_CFG_FILE=$(kernel_config_path) || die
if [ -n "${KERNEL_TOOLCHAIN}" ]; then
PKG_DEPENDS_HOST+=" gcc-${KERNEL_TOOLCHAIN}:host"
PKG_DEPENDS_TARGET+=" gcc-${KERNEL_TOOLCHAIN}:host"
PKG_DEPENDS_HOST="${PKG_DEPENDS_HOST} gcc-arm-${KERNEL_TOOLCHAIN}:host"
PKG_DEPENDS_TARGET="${PKG_DEPENDS_TARGET} gcc-arm-${KERNEL_TOOLCHAIN}:host"
HEADERS_ARCH=${TARGET_ARCH}
fi
@ -98,7 +92,14 @@ post_patch() {
}
make_host() {
:
make \
ARCH=${HEADERS_ARCH:-${TARGET_KERNEL_ARCH}} \
HOSTCC="${TOOLCHAIN}/bin/host-gcc" \
HOSTCXX="${TOOLCHAIN}/bin/host-g++" \
HOSTCFLAGS="${HOST_CFLAGS}" \
HOSTCXXFLAGS="${HOST_CXXFLAGS}" \
HOSTLDFLAGS="${HOST_LDFLAGS}" \
headers_check
}
makeinstall_host() {
@ -127,7 +128,7 @@ pre_make_target() {
sed -i "s|CONFIG_EXTRA_FIRMWARE=.*|CONFIG_EXTRA_FIRMWARE=\"${FW_LIST}\"|" ${PKG_BUILD}/.config
fi
yes "" | kernel_make oldconfig
kernel_make oldconfig
# regdb (backward compatability with pre-4.15 kernels)
if grep -q ^CONFIG_CFG80211_INTERNAL_REGDB= ${PKG_BUILD}/.config ; then
@ -228,13 +229,9 @@ make_target() {
KERNEL_TARGET="${KERNEL_UIMAGE_TARGET}"
fi
if [ "${PKG_SOC}" = "rk356x" ]; then
kernel_make ${KERNEL_TARGET} ${KERNEL_MAKE_EXTRACMD} ARCH=arm64 ${DEVICE_DTB}.img
fi
}
makeinstall_target() {
. ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/options
if [ "${BOOTLOADER}" = "u-boot" ]; then
mkdir -p ${INSTALL}/usr/share/bootloader
for dtb in arch/${TARGET_KERNEL_ARCH}/boot/dts/*.dtb arch/${TARGET_KERNEL_ARCH}/boot/dts/*/*.dtb; do
@ -242,11 +239,6 @@ makeinstall_target() {
cp -v ${dtb} ${INSTALL}/usr/share/bootloader
fi
done
if [ "${PKG_SOC}" = "rk356x" ]; then
ARCH=arm64 scripts/mkimg --dtb ${DEVICE_DTB}.dtb
cp -v resource.img ${INSTALL}/usr/share/bootloader
ARCH=${TARGET_ARCH}
fi
elif [ "${BOOTLOADER}" = "bcm2835-bootloader" ]; then
mkdir -p ${INSTALL}/usr/share/bootloader/overlays