Re: [RFC/PATCH 1/2] sparse: Fix including glibc headers on x86-64

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


On Sun, Oct 23, 2011 at 5:36 AM,  <penberg@xxxxxxxxxxxxxx> wrote:
> From: Pekka Enberg <penberg@xxxxxxxxxx>
>
> Sparse treats code as 32-bit which causes problems for userspace projects on
> x86-64 Fedora if you don't have the 32-bit glibc compat package installed
> ("glib-devel.i686"):

A blast from the past. Thanks Frederic for reminding me this one.

> +
> +#ifdef __x86_64
> +       add_pre_buffer("#weak_define x86_64 1\n");
> +       add_pre_buffer("#weak_define __x86_64 1\n");
> +       add_pre_buffer("#weak_define __x86_64__ 1\n");
> +#endif
>  }

I just realized that this patch has the unwanted side effect that,
even if you try to define 32 bit compile in 64 bit Linux, the __x86_64__ will
still be there. The weak define only avoid the conflict of defining
the __x86_64__
the second time. It does not solve the case where __x86_64__ shouldn't
be there.

The better way seems to be parsing -m32 and -m64 then set the
__x86_64__ accordingly.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Newbies FAQ]     [Kernel List]     [Site Home]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [DDR & Rambus]     [Trinity Fuzzer Tool]

Powered by Linux