Re: [PATCH] [RFC] determine specifics using gcc -dumpmachine instead of uname -m

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

 



On Fri, Feb 15, 2019 at 11:14:27AM +0100, Uwe Kleine-König wrote:
> uname -m is unreliable as the host architecture might not match the
> target architecture. This can happen when cross compiling or (more
> common) if you are running a 32 bit userspace on a 64 bit kernel. The
> latter makes sparse fail to build on some machines of the Debian build
> farm as for example some armhf builder run on arm64 kernels.
> 
> This patch is only lightly tested and also misses details for mips* and
> so marked as RFC.

Hi,

Thanks you for trying this.

I think it would be better to discard everything after the first '-'.
For example, one of the machine I use have 'gcc -dumpmachine'
returning 'ppc64le-redhat-linux' and none of the pattern you've
used will match any BSD. The uname-backoff will catch them but
it's easy to avoid it.

Please note that (as far as I can think) if you're on a platform A
and cross-compile sparse for platform B and then use sparse (with o
without cgcc) on this platform B, then everything should be OK.
OTOH, I'm not sure I understand exactly what is done in this
reproducibility test here. I suppose it's something like:
on platform A, sparse is compiled natively then, still on platform A,
sparse is used (with cgcc) with a cross-compiler for platform B.
In this sort of situation, even if cgcc is made somehow 
'cross-platform aware', I'm pretty sure there will be many others
problems.


Best regards,
-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux