ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Simon Dales <simon@getthingsfixed.co.uk>,
	Boris Veytsman <borisv@lk.net>, Karl Berry <karl@freefriends.org>
Subject: Re: standalone / setuptex on ARM
Date: Tue, 23 Aug 2016 11:15:15 +0200	[thread overview]
Message-ID: <CALBOmsYzE_g55NLpgZLjYFOOcbMfFEuumhPRVEKOKHTPyhz-PQ@mail.gmail.com> (raw)
In-Reply-To: <ce02409a-c29f-6563-6610-b75b1f8dab00@wxs.nl>

Hi,

(I'm adding a few people to CC in case they are interested in the
topic. Feel free to ignore if you aren't :)

On 23 August 2016 at 10:44, Hans Hagen wrote:
> On 8/23/2016 7:46 AM, Philipp Gesang wrote:
>>
>> 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.

I don't want to use significantly different names from what TeX Live
uses, so I would prefer to stick with "armel" and "armhf", but the
main point is to be able to differentiate between the two platforms
and so far I wasn't able to without the use of config.guess (which
triggers the compiler etc) or without users manually setting their
platform.

Thanks a lof for the patch.

Just for the reference, here is the code (I put "armhf" to the "else" part):

armv7l)
  # 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
  # else go with hard fp
  else
    platform="linux-armhf"
  fi
  ;;

The Raspberry PI returns:

$ readelf -A /proc/self/exe
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6"
  Tag_CPU_arch: v6
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv2
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_rounding: Needed
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: SP and DP
  Tag_ABI_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6

and both tests fail (like they are supposed to). That's great, I'll
patch the scripts, thank you very much. I was a bit frustrated by the
inability to support both platforms properly.

I'm now waiting for the code for the 64-bit arm binaries :)
I have one in my drawer that I still need to set up.

> i'll let mojca decide that ... (i just ship what she patches in setuptex)

I'll apply the patch. Now, setuptex is not problematic, the same patch
goes there. But mtxrun doing its own guesswork on top of this might
be. Let's see.

And then there's the next question: what hardware/software do we need
if we want to add an additional unit to our (new) build farm? At the
moment Boris is kindly providing the binaries, but it would be nice to
add some small piece of hardware into the cellar that just waits and
starts building automatically whenever there's a need to do so.

Taco, Philipp just volunteered for a presentation (with workshop) at
the ConTeXt Meeting.
Title: Running ConTeXt (and compiling binaries) on my phone.

Mojca

PS: Now looking for the next volunteer to answer a similar problem for
mips (ok, we no longer ship the binaries in ConTeXt, so it's not
really an issue until the next user passes by):
    http://stackoverflow.com/questions/7101038/how-to-distinguish-between-mips-cpu-types-on-linux-when-dpkg-architecture-is-abs
___________________________________________________________________________________
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	other threads:[~2016-08-23  9:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23  5:46 Philipp Gesang
2016-08-23  8:44 ` Hans Hagen
2016-08-23  9:15   ` Mojca Miklavec [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALBOmsYzE_g55NLpgZLjYFOOcbMfFEuumhPRVEKOKHTPyhz-PQ@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --cc=borisv@lk.net \
    --cc=karl@freefriends.org \
    --cc=ntg-context@ntg.nl \
    --cc=simon@getthingsfixed.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).