Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[unix] workaround for split-aarch64-kernel-with-32bit-amrhf-userland #662

Draft
wants to merge 5 commits into
base: Cog
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
103 changes: 81 additions & 22 deletions platforms/unix/config/configure
Expand Up @@ -650,6 +650,7 @@ PKG_CONFIG
ARM_ARCH
BITBLT_FLAGS
BITBLT_OBJS
DPKG_ARCHITECTURE
HAVE_LANGINFO_CODESET
VM_DISPX11_BITBLT_FLAGS
VM_DISPX11_OBJS
Expand Down Expand Up @@ -1494,7 +1495,8 @@ Optional Features:
--enable-fast-bitblt enable fast BitBlt optimizations (default=no)
--disable-iconv disable iconv support (default=enabled)

--enable-fast-bitblt enable fast BitBlt optimizations (default=no)
--enable-fast-bitblt enable ARM-specif fast BitBlt optimizations
(default=disabled)
--enable-mpg-mmx enable MMX support in Mpeg3Plugin default=no
--enable-mpg-pthreads enable pthread support in Mpeg3Plugin default=no
--disable-dynamicopenssl
Expand Down Expand Up @@ -18559,38 +18561,95 @@ fi
plugin="BitBltPlugin"
plibs=""
rm -f BitBltPlugin.sub BitBltPlugin.lib
# -*- sh -*-

bitblt_objs="BitBltPlugin.o"
bitblt_flags=""
arm_arch=""

case $host_cpu in
arm*)
case $host_cpu in
armv6*) arm_arch="6" ;;
armv7*) arm_arch="7-A" ;;
esac
# Check whether --enable-fast-bitblt was given.
if test "${enable_fast_bitblt+set}" = set; then :
enableval=$enable_fast_bitblt; if test "x$enableval" = "xyes" ; then
bitblt_objs="BitBltPlugin.o BitBltArm.o BitBltArmLinux.o BitBltArmSimd.o BitBltDispatch.o BitBltGeneric.o BitBltArmSimdAlphaBlend.o BitBltArmSimdBitLogical.o BitBltArmSimdCompare.o BitBltArmSimdPixPaint.o BitBltArmSimdSourceWord.o"
bitblt_flags="-DENABLE_FAST_BLT"
fi

# Detour cpu check on debian-like to account for diverging bit-ness of kernel
# and userland, as seen on certain Raspberry Pis
# see https://forums.raspberrypi.com/viewtopic.php?t=349653&sid=01c84510219f6ac2740035f8f58efa9b
# Also note, autoconf's $host_cpu does not help in this case, because OF COURSE it doesnt
for ac_prog in dpkg-architecture
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_DPKG_ARCHITECTURE+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$DPKG_ARCHITECTURE"; then
ac_cv_prog_DPKG_ARCHITECTURE="$DPKG_ARCHITECTURE" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DPKG_ARCHITECTURE="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

fi
fi
DPKG_ARCHITECTURE=$ac_cv_prog_DPKG_ARCHITECTURE
if test -n "$DPKG_ARCHITECTURE"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DPKG_ARCHITECTURE" >&5
$as_echo "$DPKG_ARCHITECTURE" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

;;
aarch64)
# Check whether --enable-fast-bitblt was given.
if test "${enable_fast_bitblt+set}" = set; then :
enableval=$enable_fast_bitblt; if test "x$enableval" = "xyes" ; then
bitblt_objs="BitBltPlugin.o BitBltArm64.o BitBltDispatch.o BitBltGeneric.o"
bitblt_flags="-DENABLE_FAST_BLT"
fi

test -n "$DPKG_ARCHITECTURE" && break
done
test -n "$DPKG_ARCHITECTURE" || DPKG_ARCHITECTURE="no"

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking running ISA" >&5
$as_echo_n "checking running ISA... " >&6; }
if test "x$DPKG_ARCHITECTURE" != "xno"; then :
target_isa=`$DPKG_ARCHITECTURE --query DEB_TARGET_ARCH`
else
target_isa=$host_cpu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $target_isa" >&5
$as_echo "$target_isa" >&6; }

;;
case $target_isa in
armhf*|armv6*|armv7*)
case $target_isa in
armv6*) arm_arch="6" ;;
armhf*|armv7*) arm_arch="7-A" ;;
esac
# Check whether --enable-fast-bitblt was given.
if test "${enable_fast_bitblt+set}" = set; then :
enableval=$enable_fast_bitblt; if test "x$enableval" = "xyes"; then :
bitblt_objs="BitBltPlugin.o BitBltArm.o BitBltArmLinux.o BitBltArmSimd.o BitBltDispatch.o BitBltGeneric.o BitBltArmSimdAlphaBlend.o BitBltArmSimdBitLogical.o BitBltArmSimdCompare.o BitBltArmSimdPixPaint.o BitBltArmSimdSourceWord.o"
bitblt_flags="-DENABLE_FAST_BLT"
fi
fi

;;
aarch64|arm64)
# Check whether --enable-fast-bitblt was given.
if test "${enable_fast_bitblt+set}" = set; then :
enableval=$enable_fast_bitblt; if test "x$enableval" = "xyes"; then :
bitblt_objs="BitBltPlugin.o BitBltArm64.o BitBltDispatch.o BitBltGeneric.o"
bitblt_flags="-DENABLE_FAST_BLT"
fi
fi

;;
esac

BITBLT_OBJS=$bitblt_objs
Expand Down
59 changes: 34 additions & 25 deletions platforms/unix/plugins/BitBltPlugin/acinclude.m4
@@ -1,33 +1,42 @@
# -*- sh -*-

bitblt_objs="BitBltPlugin.o"
bitblt_flags=""
arm_arch=""

case $host_cpu in
arm*)
case $host_cpu in
armv6*) arm_arch="6" ;;
armv7*) arm_arch="7-A" ;;
esac
AC_ARG_ENABLE(fast-bitblt,
[ --enable-fast-bitblt enable fast BitBlt optimizations (default=no)],
[ if test "x$enableval" = "xyes" ; then
bitblt_objs="BitBltPlugin.o BitBltArm.o BitBltArmLinux.o BitBltArmSimd.o BitBltDispatch.o BitBltGeneric.o BitBltArmSimdAlphaBlend.o BitBltArmSimdBitLogical.o BitBltArmSimdCompare.o BitBltArmSimdPixPaint.o BitBltArmSimdSourceWord.o"
bitblt_flags="-DENABLE_FAST_BLT"
fi
],
[])
;;
aarch64)
AC_ARG_ENABLE(fast-bitblt,
[ --enable-fast-bitblt enable fast BitBlt optimizations (default=no)],
[ if test "x$enableval" = "xyes" ; then
bitblt_objs="BitBltPlugin.o BitBltArm64.o BitBltDispatch.o BitBltGeneric.o"
bitblt_flags="-DENABLE_FAST_BLT"
fi
],
[])
;;

# Detour cpu check on debian-like to account for diverging bit-ness of kernel
# and userland, as seen on certain Raspberry Pis
# see https://forums.raspberrypi.com/viewtopic.php?t=349653&sid=01c84510219f6ac2740035f8f58efa9b
# Also note, autoconf's $host_cpu does not help in this case, because OF COURSE it doesnt
AC_CHECK_PROGS([DPKG_ARCHITECTURE], [dpkg-architecture], [no])
AC_MSG_CHECKING([running ISA])
AS_IF([test "x$DPKG_ARCHITECTURE" != "xno"],
[target_isa=`$DPKG_ARCHITECTURE --query DEB_TARGET_ARCH`],
[target_isa=$host_cpu])
AC_MSG_RESULT([$target_isa])

case $target_isa in
armhf*|armv6*|armv7*)
case $target_isa in
armv6*) arm_arch="6" ;;
armhf*|armv7*) arm_arch="7-A" ;;
esac
AC_ARG_ENABLE(fast-bitblt,
AS_HELP_STRING([--enable-fast-bitblt], [enable ARM-specif fast BitBlt optimizations (default=disabled)]),
AS_IF([test "x$enableval" = "xyes"],
[bitblt_objs="BitBltPlugin.o BitBltArm.o BitBltArmLinux.o BitBltArmSimd.o BitBltDispatch.o BitBltGeneric.o BitBltArmSimdAlphaBlend.o BitBltArmSimdBitLogical.o BitBltArmSimdCompare.o BitBltArmSimdPixPaint.o BitBltArmSimdSourceWord.o"
bitblt_flags="-DENABLE_FAST_BLT"]),
[])
;;
aarch64|arm64)
AC_ARG_ENABLE(fast-bitblt,
AS_HELP_STRING([--enable-fast-bitblt], [enable ARM-specif fast BitBlt optimizations (default=disabled)]),
AS_IF([test "x$enableval" = "xyes"],
[bitblt_objs="BitBltPlugin.o BitBltArm64.o BitBltDispatch.o BitBltGeneric.o"
bitblt_flags="-DENABLE_FAST_BLT"]),
[])
;;
esac

AC_SUBST(BITBLT_OBJS, $bitblt_objs)
Expand Down