[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to distinguish armel and armhf at runtime?

On 2017-09-22 21:57 +0200, Uwe Kleine-König wrote:
> Hello,
> for the package sparse I have to distinguish armel and armhf. The reason
> is that sparse parses system headers and so has to know which cpp
> symbols to define. Usually it uses uname -m to distinguish platforms but
> that isn't suitable to tell armel and armhf apart.
> For armhf I need to define __ARM_PCS_VFP but that must be absent on armel.
> For upstreaming a fix it would be great if the test would not be Debian
> specific.
> Any ideas?

It's just an ABI difference, not a difference in the kernel or
hardware, so you have to look at the files run. So asking gcc or the
glibc in use is one correct way to do it.

gcc -dumpmachine will tell you what triplet applies. I assume that
works on non-debian machines too:
armhf: arm-linux-gnueabihf
armel: arm-linux-gnueabi

For building things in a debian context, normally the right thing to
do is just rely on the compiler to DTRT for the arch targetted. (As
opposed to trying to work out yourself both what arch is in use and
what the right corresponding set of runes is). Not least because the
correct set of runes changes over times. gcc will get this right (i.e
set the correct options for the ABI and for debian), for both
compiling and cross-compiling.

Principal hats:  Linaro, Debian, Wookware, ARM

Attachment: signature.asc
Description: Digital signature

Reply to: