[tlbuild] Raspberry fp version (soft/hard float)

simon at getthingsfixed.co.uk simon at getthingsfixed.co.uk
Thu Oct 25 12:26:59 CEST 2012


Boris,

On Thursday 25 October 2012 02:04:53 Boris Veytsman wrote:
> Yesterday I got my raspberry pi in the mail.  I understand that Simon
> now works on the official port of TL for Raspbian, right?  I have a
> question for him - and maybe for other people on the list.
>
> The question is, how can we determine raspbian in platform.sh?  Uname
> gives us
>
>     boris at raspberrypi ~ $ uname -a
>     Linux raspberrypi 3.2.27+ #160 PREEMPT Mon Sep 17 23:18:42 BST 2012
> armv6l GNU/Linux
>
> Now armv6l is the platform.  The problem is, it seems that uname does
> not tell us about the main difference between raspbian and other arm
> os'es: the use of the fpu unit in their libc.
>
> I understand there are devices with armv6l architecture that do not
> use fpu - like raspberry pi with "Soft Wheezy" installed.  I think
> armv7l binaries work for these devices.  Therefore I would suggest
> making platform.sh put armv7l on all arm* devices - but what can we do
> with raspbian?

Yup, I agree, it's a bit of a mess.

I am not the best person to ask cos this is my first forray into ARM-land.

One method is to look in /lib for arm-linux-gnueabi/ or arm-linux-gnueabihf/. 
Either do a directory check or ldd something which you know uses floating 
point. Could use "ldd `which lua`".

How do we know it's a RPi? We could look in /proc/cpuinfo for "BCM2708". Other 
machines might use this chip, but how many would have TeX installed on them?

I am not quite happy with this cos I don't have any otherwise compatible 
distros on which I could test.

Presumably any of the ARMs will present a whole lorry full of worms, but 
luckily most of these aren't used for TeX. For the ARMs with Linux: the only 
ones of which I know are the RPi and a rumour of some ARM7s. The ARM7 guys 
presumably can take care of themselves (I hope). This leaves the RPi guys.

Am I right about the Linux distros in ARM-land onto which somebody might want 
TeX?

So for the moment we check:
* it's Linux
* Chip == BCM2708, so it's a RPi
* got /lib/arm-linux-gnueabihf/, so it's a hf.

The alternative is a native binary that attempts some FP maths. One of the 
things that alerted me that the armel binaries didn't work on armhf was that 
the maths silently failed (no hissy fit thrown exceptions or the like). If 
one runs the armel texlua on hf wheezy it returns silly values. E.g. "local 
r=1.1 io.write(r)" should write "1.1", but it actually writes "0". Could use 
this as a test. This would proof us against somebody having both libs 
in /lib.

Now the installer/tlmgr can offer the operator that conclusion. Any complaints 
and we refine it a bit more.

Sufficient?

Simon
-- 
Get Things Fixed


More information about the tlbuild mailing list