config-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Detect 32-bit userland on sparc64 linux kernel as sparc-unkn


From: Jan Engelhardt
Subject: Re: [PATCH] Detect 32-bit userland on sparc64 linux kernel as sparc-unknown-linux.
Date: Wed, 3 Jun 2015 02:39:51 +0200 (CEST)
User-agent: Alpine 2.20 (LSU 67 2015-01-07)

On Wednesday 2015-06-03 01:36, James Y Knight wrote:
>On Jun 2, 2015, at 7:03 PM, Jan Engelhardt <address@hidden> wrote:
>> If you run a x86_64 or sparc64 kernel, it means your CPU is capable
>> of running instructions like MOV(QWORD) or LDX, respectively. These
>> instructions can be issued **no matter whether your C compiler is in
>> ILP32 or LP64 mode**.
>
>Ok, I was thrown off by the existence of logic just like that in
>other places in the file [...]
>
>and I thought it was intended that it return the target ABI not the
>hardware capabilities.

The triplet consists of cpu, vendor, and OS. cpu is a rather
organized field, and "OS" is the wild thing.

There are different kinds of ABIs in a machine. For example, inner
working of the CPU: does the stack grow up or downards? Then, process
ABI: do we want to push/pop arguments on a stack, or pass it all in
registers? Then, toolchain ABI: things like C++ name mangling and C
type sizes.

Some characteristics may be derivable from the triplet, and
others not.

>(It seems a bit odd that the architecture name is inconsistent
>between solaris and linux, though -- on solaris you get e.g.
>"sparc-sun-solaris2.11", and linux you get
>sparc64-unknown-linux-gnu. Both environments are running 64bit
>kernels and default to 32bit userland. Oh well.)

This might be the result of just going with what uname(1) outputs,
and that value was mostly at the whim of the then-developers.

There is also a deeper reason that "sparc" is used on all sparc-sun
platforms, and that there are {sparc,sparc64} or even
{ppc,ppc64,ppc64le} on Linux. Will post that later when I ordered
those thoughts.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]