PATCH: Check __ILP32__ instead of __LP64__

Andreas Jaeger aj@suse.com
Sat Apr 14 17:59:00 GMT 2012


On 04/14/2012 05:36 PM, H.J. Lu wrote:
> On Sat, Apr 14, 2012 at 3:40 AM, Andreas Jaeger<aj@suse.com>  wrote:
>> On 04/14/2012 12:27 AM, H.J. Lu wrote:
>>>
>>> Hi,
>>>
>>> Here are 3 patches to check  __ILP32__ instead of __LP64__.  They
>>> are tested on Linux/x32 and Linux/x86-64.  OK to install?
>>>
>>> Thanks.
>>>
>>>
>>> H.J.
>>> ---
>>>   From e1049703b6757f9c33175a98e0759836117292b8 Mon Sep 17 00:00:00 2001
>>> From: "H.J. Lu"<hjl.tools@gmail.com>
>>> Date: Fri, 13 Apr 2012 14:57:13 -0700
>>> Subject: Check __ILP32__ instead of __LP64__
>>>
>>>         * elf/tst-auditmod1.c: Check __ILP32__ instead of __LP64__.
>>>         * elf/tst-auditmod3b.c: Likewise.
>>>         * elf/tst-auditmod4b.c: Likewise.
>>>         * elf/tst-auditmod5b.c: Likewise.
>>>         * elf/tst-auditmod6b.c: Likewise.
>>>         * elf/tst-auditmod6c.c: Likewise.
>>>         * elf/tst-auditmod7b.c: Likewise.
>>> diff --git a/elf/tst-auditmod1.c b/elf/tst-auditmod1.c
>>> index 67fc758..108d6de 100644
>>> --- a/elf/tst-auditmod1.c
>>> +++ b/elf/tst-auditmod1.c
>>> @@ -109,7 +109,7 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx,
>>> uintptr_t *refcook,
>>>   # define La_retval La_i86_retval
>>>   # define int_retval lrv_eax
>>>   #elif defined __x86_64__
>>> -# ifdef __LP64__
>>> +# ifndef __ILP32__
>>
>>
>> I don't get why this will help. This is x86-64 specific code, so either LP64
>> or ILP32. Therefore the above patch should not make any difference.
>>
>> The same for all the others...
>>
>> What am I missing - or is still really not needed?
>>
>
> They make no difference when glibc is compiled with GCC>= 3.3.
> Since __LP64__ isn't specified by x86-64 psABI, when glibc is
> compiled by another compiler, it may not work correctly.

We require that glibc is compiled by GCC, so what other compiler do you 
have in mind that is capable of compiling glibc and does not define 
__LP64__ ?

Btw. we can also add __LP64__ to the psABI of x86-64,
Andreas
-- 
  Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
   SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
     GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126



More information about the Libc-alpha mailing list