Hi,

when setting up Context for my phone, I noticed the ARM binaries
that come with the Standalone don’t work because the system is
armv7l soft-float:

    $ gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabi/4.6/lto-wrapper
    Target: arm-linux-gnueabi
    Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14' 
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr 
--program-suffix=-4.6 --enable-shared --enable-linker-build-id 
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext 
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object 
--enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv4t 
--with-float=soft --enable-checking=release --build=arm-linux-gnueabi 
--host=arm-linux-gnueabi --target=arm-linux-gnueabi
    Thread model: posix
    gcc version 4.6.3 (Debian 4.6.3-14)

Since I’m supplying my own Luatex binary that’s no problem per
se, I just had to modify setuptex a bit.

Could we add a couple lines like the attached patch to the
script? I’m under the impression that “armel” is a Debian
specific term so feel free to change it. Though it might be
better in general to use the “arm-linux-gnueabi” and
“arm-linux-gnueabihf” triplets to separate the platforms.

Best,
Philipp

--- tex/setuptex.orig	2016-08-22 23:51:21.000000000 +0200
+++ tex/setuptex	2016-08-23 07:44:31.000000000 +0200
@@ -33,7 +33,26 @@
 			# we need more hacks to fix the situation, this is just a temporary solution
 			mips|mips64|mipsel|mips64el) platform="linux-mipsel" ;;
 			# TODO: probably both wrong and incomplete
-			armv7l) platform="linux-armhf" ;;
+			armv7l)
+				platform="linux-armhf"
+					# machine id output by uname(1) is
+					# insufficent to determine whether this
+					# is a soft or hard float system so we
+					# check ourselves.
+					# a) binutils, this should work almost
+					#    everywhere
+					if $(which readelf >/dev/null 2>&1); then
+					    readelf -A /proc/self/exe | grep -q '^ \+Tag_ABI_VFP_args'
+					    if [ ! $? ]; then
+					        platform="linux-armel"
+					    fi
+					# b) debian-specific fallback
+					elif $(which dpkg >/dev/null 2>&1); then
+					    if [ "$(dpkg --print-architecture)" = armel ]; then
+					        platform="linux-armel"
+					    fi
+					fi # else go with hard fp
+					;;
 			*) platform="unknown" ;;
 		esac ;;
 	# Mac OS X

Attachment: pgpnCoG4cEQM2.pgp
Description: PGP signature

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to