ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* standalone / setuptex on ARM
@ 2016-08-23  5:46 Philipp Gesang
  2016-08-23  8:44 ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Philipp Gesang @ 2016-08-23  5:46 UTC (permalink / raw)
  To: ConTeXt ML


[-- Attachment #1.1.1: Type: text/plain, Size: 1574 bytes --]

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


[-- Attachment #1.1.2: 2016-08-23_setuptex-armel.patch --]
[-- Type: text/x-diff, Size: 1104 bytes --]

--- 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 #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-23 17:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-23  5:46 standalone / setuptex on ARM Philipp Gesang
2016-08-23  8:44 ` Hans Hagen
2016-08-23  9:15   ` Mojca Miklavec
2016-08-23  9:27     ` Mojca Miklavec
2016-08-23 10:03     ` Mojca Miklavec
2016-08-23 10:53       ` Mojca Miklavec
2016-08-23 11:30         ` luigi scarso
2016-08-23 17:41     ` Philipp Gesang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).