AArch64 projects: add 32-bit userspace support

This commit is contained in:
Radostan Riedel 2016-11-24 09:36:06 +01:00
parent 195c4b164e
commit de9d1af69f
35 changed files with 152 additions and 63 deletions

View File

@ -45,13 +45,21 @@
TARGET_FPU_FLAGS="-mfloat-abi=$TARGET_FLOAT -mfpu=$TARGET_FPU"
SIMD_SUPPORT="yes"
;;
cortex-a53)
TARGET_SUBARCH=armv8-a
TARGET_ABI=eabi
TARGET_EXTRA_FLAGS="-mcpu=${TARGET_CPU}"
TARGET_FPU_FLAGS="-mfloat-abi=$TARGET_FLOAT -mfpu=$TARGET_FPU"
SIMD_SUPPORT="yes"
;;
esac
TARGET_VARIANT="${TARGET_SUBARCH}${TARGET_CPU_FLAGS}"
TARGET_GCC_ARCH=${TARGET_SUBARCH/-}
TARGET_KERNEL_ARCH=arm
TARGET_KERNEL_ARCH=${TARGET_KERNEL_ARCH:-arm}
# setup ARCH specific *FLAGS
TARGET_CFLAGS="-march=$TARGET_SUBARCH -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated $TARGET_EXTRA_FLAGS"
TARGET_CFLAGS="-march=$TARGET_VARIANT -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated $TARGET_EXTRA_FLAGS"
[ -n "$TARGET_FPU" ] && TARGET_CFLAGS="$TARGET_CFLAGS $TARGET_FPU_FLAGS"
TARGET_LDFLAGS="-march=$TARGET_SUBARCH -mtune=$TARGET_CPU"
TARGET_LDFLAGS="-march=$TARGET_VARIANT -mtune=$TARGET_CPU"
GCC_OPTS="--with-abi=aapcs-linux --with-arch=$TARGET_SUBARCH --with-float=$TARGET_FLOAT --with-fpu=$TARGET_FPU"

View File

@ -342,8 +342,8 @@ dashes="==========================="
linux_config_dir="$PROJECT_DIR/$PROJECT/linux"
fi
if [ ! -e $linux_config_dir/linux.$TARGET_ARCH.conf ] &&
! ls $linux_config_dir/*/linux.$TARGET_ARCH.conf &>/dev/null; then
if [ ! -e $linux_config_dir/linux.${TARGET_PATCH_ARCH:-$TARGET_ARCH}.conf ] &&
! ls $linux_config_dir/*/linux.${TARGET_PATCH_ARCH:-$TARGET_ARCH}.conf &>/dev/null; then
check_arch="$check_arch\n $dashes$dashes$dashes"
check_arch="$check_arch\n ERROR: Architecture not found, use a valid Architecture"
check_arch="$check_arch\n for your project or create a new config"

View File

@ -33,6 +33,7 @@ PKG_AUTORECONF="no"
PKG_IS_ADDON="yes"
PKG_ADDON_NAME="Sapphire Remote Driver"
PKG_ADDON_TYPE="xbmc.service"
PKG_IS_KERNEL_PKG="yes"
if [ -f $SYSROOT_PREFIX/usr/include/linux/input-event-codes.h ]; then
INPUT_H="$SYSROOT_PREFIX/usr/include/linux/input-event-codes.h"

View File

@ -47,7 +47,7 @@ else
fi
if [ "$KODIPLAYER_DRIVER" = "libamcodec" ]; then
if [ "$TARGET_ARCH" = "aarch64" ]; then
if [ "$TARGET_KERNEL_ARCH" = "arm64" ]; then
PKG_CMAKE_OPTS_TARGET="$PKG_CMAKE_OPTS_TARGET -DHAVE_AOCEC_API=1"
else
PKG_CMAKE_OPTS_TARGET="$PKG_CMAKE_OPTS_TARGET -DHAVE_AMLOGIC_API=1"

View File

@ -51,11 +51,12 @@ make_target() {
imx6)
make platform=armv7-cortexa9-neon-hardfloat
;;
WeTek_Play|WeTek_Core)
make platform=armv7-cortexa9-neon-hardfloat
;;
Odroid_C2|WeTek_Hub|WeTek_Play_2)
make platform=aarch64
WeTek_Play|WeTek_Core|Odroid_C2|WeTek_Hub|WeTek_Play_2)
if [ "$TARGET_ARCH" = "aarch64" ]; then
make platform=aarch64
else
make platform=armv7-cortexa9-neon-hardfloat
fi
;;
Generic)
make

View File

@ -58,11 +58,12 @@ make_target() {
imx6)
make -f Makefile.libretro platform=imx6
;;
WeTek_Play|WeTek_Core)
make -f Makefile.libretro platform=armv7-neon-gles-cortex-a9
;;
Odroid_C2|WeTek_Hub|WeTek_Play_2)
make -f Makefile.libretro platform=aarch64
WeTek_Play|WeTek_Core|Odroid_C2|WeTek_Hub|WeTek_Play_2)
if [ "$TARGET_ARCH" = "aarch64" ]; then
make -f Makefile.libretro platform=aarch64
else
make -f Makefile.libretro platform=armv7-neon-gles-cortex-a9
fi
;;
Generic)
make -f Makefile.libretro

View File

@ -41,14 +41,11 @@ configure_target() {
}
make_target() {
case $PROJECT in
RPi|imx6|WeTek_Play|WeTek_Core)
make ARM=1
;;
Generic|Odroid_C2|WeTek_Hub|WeTek_Play_2)
make
;;
esac
if [ "$TARGET_ARCH" = "arm" ]; then
make ARM=1
else
make
fi
}
makeinstall_target() {

View File

@ -58,11 +58,12 @@ make_target() {
imx6)
make platform=armv7-neon-hardfloat-cortex-a9
;;
WeTek_Play|WeTek_Core)
make platform=armv7-neon-hardfloat-cortex-a9
;;
Odroid_C2|WeTek_Hub|WeTek_Play_2)
make platform=aarch64
WeTek_Play|WeTek_Core|Odroid_C2|WeTek_Hub|WeTek_Play_2)
if [ "$TARGET_ARCH" = "aarch64" ]; then
make platform=aarch64
else
make platform=armv7-neon-hardfloat-cortex-a9
fi
;;
Generic)
make

View File

@ -58,11 +58,12 @@ make_target() {
imx6)
make platform=armv7-neon-hardfloat-cortex-a9
;;
WeTek_Play|WeTek_Core)
make platform=armv7-neon-hardfloat-cortex-a9
;;
Odroid_C2|WeTek_Hub|WeTek_Play_2)
make platform=aarch64
WeTek_Play|WeTek_Core|Odroid_C2|WeTek_Hub|WeTek_Play_2)
if [ "$TARGET_ARCH" = "aarch64" ]; then
make platform=aarch64
else
make platform=armv7-neon-hardfloat-cortex-a9
fi
;;
Generic)
make

View File

@ -51,11 +51,12 @@ make_target() {
imx6)
make platform=imx6
;;
WeTek_Play|WeTek_Core)
make platform=armv7-neon-gles-cortex-a9
;;
Odroid_C2|WeTek_Hub|WeTek_Play_2)
make platform=aarch64
WeTek_Play|WeTek_Core|Odroid_C2|WeTek_Hub|WeTek_Play_2)
if [ "$TARGET_ARCH" = "aarch64" ]; then
make platform=aarch64
else
make platform=armv7-neon-gles-cortex-a9
fi
;;
Generic)
make WITH_DYNAREC=x86_64

View File

@ -60,11 +60,12 @@ make_target() {
imx6)
make -f Makefile.libretro platform=armv7-neon-hardfloat-cortex-a9
;;
WeTek_Play|WeTek_Core)
make -f Makefile.libretro platform=armv7-neon-hardfloat-cortex-a9
;;
Odroid_C2|WeTek_Hub|WeTek_Play_2)
make -f Makefile.libretro platform=aarch64
WeTek_Play|WeTek_Core|Odroid_C2|WeTek_Hub|WeTek_Play_2)
if [ "$TARGET_ARCH" = "aarch64" ]; then
make -f Makefile.libretro platform=aarch64
else
make -f Makefile.libretro platform=armv7-neon-hardfloat-cortex-a9
fi
;;
Generic)
make -f Makefile.libretro

View File

@ -29,8 +29,12 @@ case $MESON_FAMILY in
PKG_SHA256="21a8376668c84bf1b9e64a917fcfa1cf74689035fed8e4630833c9cde28d40c1"
;;
gxbb)
PKG_VERSION="gxbb-r5p1-01rel0"
;;
if [ "$TARGET_ARCH" = "arm" ]; then
PKG_VERSION="8-r5p1-01rel0-armhf"
else
PKG_VERSION="gxbb-r5p1-01rel0"
fi
;;
esac
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain"

View File

@ -0,0 +1,13 @@
diff -Naur Python-2.7.13.orig/Lib/platform.py Python-2.7.13/Lib/platform.py
--- Python-2.7.13.orig/Lib/platform.py 2017-01-08 11:57:36.615886244 +0100
+++ Python-2.7.13/Lib/platform.py 2017-01-08 12:12:44.567848271 +0100
@@ -1250,6 +1250,9 @@
system = 'Windows'
release = 'Vista'
+ if machine == 'aarch64' and architecture()[0] == '32bit':
+ machine = 'armv7l'
+
_uname_cache = system,node,release,version,machine,processor
return _uname_cache

View File

@ -24,7 +24,6 @@ PKG_LICENSE="GPL"
PKG_SITE=""
PKG_URL="https://releases.linaro.org/components/toolchain/binaries/${PKG_VERSION}/aarch64-elf/gcc-linaro-${PKG_VERSION}-x86_64_aarch64-elf.tar.xz"
PKG_SOURCE_DIR="gcc-linaro-${PKG_VERSION}-x86_64_aarch64-elf"
PKG_DEPENDS_HOST="toolchain"
PKG_SECTION="lang"
PKG_SHORTDESC=""
PKG_LONGDESC=""

View File

@ -33,6 +33,7 @@ PKG_LONGDESC="Realtek RTL81xxEU Linux 3.x driver"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS

View File

@ -32,6 +32,7 @@ PKG_LONGDESC="Realtek RTL81xxCU Linux 3.x driver"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS

View File

@ -32,6 +32,7 @@ PKG_LONGDESC="Realtek RTL8192DU Linux 3.x driver"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS

View File

@ -32,6 +32,7 @@ PKG_LONGDESC="Realtek RTL8192EU Linux 3.x driver"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS

View File

@ -31,6 +31,7 @@ PKG_SHORTDESC="Realtek RTL8812AU Linux 3.x driver"
PKG_LONGDESC="Realtek RTL8812AU Linux 3.x driver"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS

View File

@ -34,6 +34,7 @@ PKG_LONGDESC="These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
make_target() {
cd x86-64

View File

@ -31,6 +31,7 @@ PKG_LONGDESC="brcmap6xxx-aml: Linux drivers for AP6xxx WLAN chips used in some d
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
make_target() {
cd bcmdhd_1_201_59_x

View File

@ -33,6 +33,7 @@ PKG_LONGDESC="A linux DVB driver for the HDHomeRun TV tuner (http://www.silicond
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
PKG_CMAKE_SCRIPT="userhdhomerun/CMakeLists.txt"

View File

@ -33,6 +33,7 @@ PKG_LONGDESC="gpu-aml: Linux drivers for Mali GPUs found in Amlogic Meson SoCs"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
make_target() {
LDFLAGS="" make -C $(kernel_path) M=$PKG_BUILD/mali \

View File

@ -31,6 +31,7 @@ PKG_LONGDESC="Intel NUC7i[x]BN and NUC6CAY LED Control for Linux"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS

View File

@ -31,6 +31,7 @@ PKG_SHORTDESC="DVB drivers that replace the version shipped with the kernel"
PKG_LONGDESC="DVB drivers that replace the version shipped with the kernel"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
export KERNEL_VER=$(get_module_dir)

View File

@ -31,6 +31,7 @@ PKG_LONGDESC="linux kernel modules for the Slice box"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS

View File

@ -31,6 +31,7 @@ PKG_LONGDESC="These package contains Wetek's DVB driver "
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
make_target() {
: # nothing todo

View File

@ -72,8 +72,16 @@ esac
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_IS_KERNEL_PKG="yes"
PKG_MAKE_OPTS_HOST="ARCH=$TARGET_KERNEL_ARCH headers_check"
if [ "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then
PKG_DEPENDS_HOST="$PKG_DEPENDS_HOST gcc-linaro-aarch64-elf:host"
PKG_DEPENDS_TARGET="$PKG_DEPENDS_HOST gcc-linaro-aarch64-elf:host"
TARGET_PREFIX=$TOOLCHAIN/lib/gcc-linaro-aarch64-elf/bin/aarch64-elf-
HEADERS_ARCH=$TARGET_ARCH
fi
PKG_MAKE_OPTS_HOST="ARCH=${HEADERS_ARCH:-$TARGET_KERNEL_ARCH} headers_check"
if [ "$TARGET_ARCH" = "x86_64" ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET intel-ucode:host kernel-firmware"
@ -84,18 +92,25 @@ if [ "$BUILD_ANDROID_BOOTIMG" = "yes" ]; then
fi
post_patch() {
if [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_VERSION/$PKG_NAME.$TARGET_ARCH.conf ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_VERSION/$PKG_NAME.$TARGET_ARCH.conf
elif [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_NAME.$TARGET_ARCH.conf ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_NAME.$TARGET_ARCH.conf
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_VERSION/$PKG_NAME.$TARGET_ARCH.conf ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_VERSION/$PKG_NAME.$TARGET_ARCH.conf
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_NAME.$TARGET_ARCH.conf ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_NAME.$TARGET_ARCH.conf
elif [ -f $PKG_DIR/config/$PKG_VERSION/$PKG_NAME.$TARGET_ARCH.conf ]; then
KERNEL_CFG_FILE=$PKG_DIR/config/$PKG_VERSION/$PKG_NAME.$TARGET_ARCH.conf
CFG_FILE="$PKG_NAME.${TARGET_PATCH_ARCH:-$TARGET_ARCH}.conf"
if [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_VERSION/$CFG_FILE ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_VERSION/$CFG_FILE
elif [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$LINUX/$CFG_FILE ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$LINUX/$CFG_FILE
elif [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$CFG_FILE ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$CFG_FILE
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_VERSION/$CFG_FILE ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_VERSION/$CFG_FILE
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$LINUX/$CFG_FILE ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$LINUX/$CFG_FILE
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$CFG_FILE ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$CFG_FILE
elif [ -f $PKG_DIR/config/$PKG_VERSION/$CFG_FILE ]; then
KERNEL_CFG_FILE=$PKG_DIR/config/$PKG_VERSION/$CFG_FILE
elif [ -f $PKG_DIR/config/$LINUX/$CFG_FILE ]; then
KERNEL_CFG_FILE=$PKG_DIR/config/$LINUX/$CFG_FILE
else
KERNEL_CFG_FILE=$PKG_DIR/config/$PKG_NAME.$TARGET_ARCH.conf
KERNEL_CFG_FILE=$PKG_DIR/config/$CFG_FILE
fi
sed -i -e "s|^HOSTCC[[:space:]]*=.*$|HOSTCC = $TOOLCHAIN/bin/host-gcc|" \
@ -148,7 +163,7 @@ post_patch() {
}
makeinstall_host() {
make ARCH=$TARGET_KERNEL_ARCH INSTALL_HDR_PATH=dest headers_install
make ARCH=${HEADERS_ARCH:-$TARGET_KERNEL_ARCH} INSTALL_HDR_PATH=dest headers_install
mkdir -p $SYSROOT_PREFIX/usr/include
cp -R dest/include/* $SYSROOT_PREFIX/usr/include
}

View File

@ -20,13 +20,13 @@ PKG_NAME="libamcodec"
PKG_ARCH="arm aarch64"
PKG_LICENSE="other"
PKG_SITE="http://openlinux.amlogic.com"
case $TARGET_ARCH in
case $TARGET_KERNEL_ARCH in
arm)
PKG_VERSION="5e23a81"
PKG_SHA256="412cfafbd9725f5186b884b9599ff6561d2031b44d9873e79d377631a2b5f9b9"
PKG_URL="https://github.com/codesnake/libamcodec/archive/$PKG_VERSION.tar.gz"
;;
aarch64)
arm64)
PKG_VERSION="210755d"
PKG_SHA256="0c688d80bf1147177acf546230c255404e506ba687ca7bfddd4508d29958c279"
PKG_URL="http://amlinux.ru/source/$PKG_NAME-$PKG_VERSION.tar.gz"

View File

@ -21,6 +21,14 @@
TARGET_CPU="cortex-a53"
TARGET_CPU_FLAGS="+crc+fp+simd"
;;
arm)
TARGET_KERNEL_ARCH="arm64"
TARGET_PATCH_ARCH="aarch64"
TARGET_FLOAT=hard
TARGET_CPU="cortex-a53"
TARGET_CPU_FLAGS="+crc"
TARGET_FPU="neon-fp-armv8"
;;
esac
# Bootloader to use (syslinux / u-boot / bcm2835-bootloader)

View File

@ -21,6 +21,14 @@
TARGET_CPU="cortex-a53"
TARGET_CPU_FLAGS="+crc+fp+simd"
;;
arm)
TARGET_KERNEL_ARCH="arm64"
TARGET_PATCH_ARCH="aarch64"
TARGET_FLOAT=hard
TARGET_CPU="cortex-a53"
TARGET_CPU_FLAGS="+crc"
TARGET_FPU="neon-fp-armv8"
;;
esac
# Bootloader to use (syslinux / u-boot / atv-bootloader / bcm2835-bootloader)

View File

@ -21,6 +21,14 @@
TARGET_CPU="cortex-a53"
TARGET_CPU_FLAGS="+crc+fp+simd"
;;
arm)
TARGET_KERNEL_ARCH="arm64"
TARGET_PATCH_ARCH="aarch64"
TARGET_FLOAT=hard
TARGET_CPU="cortex-a53"
TARGET_CPU_FLAGS="+crc"
TARGET_FPU="neon-fp-armv8"
;;
esac
# Bootloader to use (syslinux / u-boot / atv-bootloader / bcm2835-bootloader)

View File

@ -164,6 +164,12 @@ if [ ! -f $STAMP ]; then
# include buildfile
. $PKG_DIR/package.mk
if [ "$PKG_IS_KERNEL_PKG" = "yes" ]; then
if [ "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then
TARGET_PREFIX=$TOOLCHAIN/lib/gcc-linaro-aarch64-elf/bin/aarch64-elf-
fi
fi
if [ "$TARGET" = "target" ]; then
for p in $PKG_DEPENDS_TARGET; do
$SCRIPTS/build $p

View File

@ -222,6 +222,9 @@ find $INSTALL/usr/lib/modules/$MODVER/ -name *.ko | \
$TOOLCHAIN/bin/depmod -b $INSTALL/usr -a -e -F "$BUILD/linux-$(kernel_version)/System.map" $MODVER
# strip kernel modules
if [ "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then
STRIP=$TOOLCHAIN/lib/gcc-linaro-aarch64-elf/bin/aarch64-elf-strip
fi
for MOD in `find $INSTALL/usr/lib/modules/ -type f -name *.ko`; do
$STRIP --strip-debug $MOD
done

View File

@ -113,7 +113,7 @@ if [ -d "$SOURCES/$1" -o -d "$PKG_DIR/sources" ]; then
if [ "$TARGET_ARCH" = "x86_64" ]; then
PATCH_ARCH="x86"
else
PATCH_ARCH="$TARGET_ARCH"
PATCH_ARCH="${TARGET_PATCH_ARCH:-$TARGET_ARCH}"
fi
PATCH_DIRS_PKG=""