This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use -mx32 for _{POSIX_V7|_POSIX_V6|XBS5}_ILP32_OFFBIG


On Mon, Jun 4, 2012 at 6:03 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Jun 4, 2012 at 1:59 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Mon, Jun 4, 2012 at 12:48 PM, Roland McGrath <roland@hack.frob.com> wrote:
>>> This is a regression for an -m32 build, where ILP32_OFFBIG will no
>>> longer be offered.  That is unacceptable.  This whole area is subtle
>>> and nonobvious, because it's a header in one build environment talking
>>> about what other build environments are available.
>>>
>>> If a user program is using confstr itself, and that program is built
>>> with -mx32, then it recommending -mx32 makes some sense.  But having
>>> which environment the installed getconf binary was built for affect
>>> what it reports to scripts is much more questionable.
>>>
>>> I think we need to leave this alone for now, file a bug to track the
>>> issue, and consider it further after 2.16.
>>>
>>
>> I opened:
>>
>> http://sourceware.org/bugzilla/show_bug.cgi?id=14200
>>
>> One possible solution:
>>
>> 1. -mx32 build provides POSIX_V6_ILP32_OFFBIG,
>> POSIX_V7_ILP32_OFFBIG and XBS5_ILP32_OFFBIG.
>> 2. -m32 build provides POSIX_V6_ILP32_OFF32,
>> POSIX_V7_ILP32_OFF32, XBS5_ILP32_OFF32,
>> POSIX_V6_ILP32_OFFBIG, POSIX_V7_ILP32_OFFBIG
>> and XBS5_ILP32_OFFBIG.
>>
>> If x32 glibc is installed, ia32 glibc won't install
>> the ia32 version of POSIX_V6_ILP32_OFFBIG,
>> POSIX_V7_ILP32_OFFBIG and XBS5_ILP32_OFFBIG.
>>
>>
>
> Here is the patch to implement it.  There is no difference
> in -m32 build and -mx32 build gets -mx32 for
> _{POSIX_V7|_POSIX_V6|XBS5}_ILP32_OFFBIG/
>
> OK for trunk after 2.16 is branched?
>
> Thanks.
>
> --
> H.J.
> ----
>         [BZ #14200]
>         * sysdeps/unix/sysv/linux/x86/bits/environments.h
>         (_POSIX_V7_ILP32_OFF32): Defined as 1 only if __x86_64__ isn't
>         defined.
>         (_POSIX_V6_ILP32_OFF32): Likewise.
>         (_XBS5_ILP32_OFF32): Likewise.
>         (__ILP32_OFFBIG_CFLAGS): Defined as "-mx32" for x32.
>         (__ILP32_OFFBIG_LDFLAGS): Likewise.
>
> diff --git a/sysdeps/unix/sysv/linux/x86/bits/environments.h b/sysdeps/unix/sysv
> /linux/x86/bits/environments.h
> index 793a04f..8ebc837 100644
> --- a/sysdeps/unix/sysv/linux/x86/bits/environments.h
> +++ b/sysdeps/unix/sysv/linux/x86/bits/environments.h
> @@ -64,15 +64,19 @@
>
>  #else /* __WORDSIZE == 32 */
>
> -/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
> -   and all platforms support LFS.  */
> -# define _POSIX_V7_ILP32_OFF32 1
> +/* We have 32-bit wide `int', `long int' and pointers and all platforms
> +   support LFS.  -mx32 has 64-bit wide `off_t'.  */
>  # define _POSIX_V7_ILP32_OFFBIG        1
> -# define _POSIX_V6_ILP32_OFF32 1
> -# define _POSIX_V6_ILP32_OFFBIG        1
> -# define _XBS5_ILP32_OFF32     1
> +# define _POSIX_V6_ILP32_OFFBIG 1
>  # define _XBS5_ILP32_OFFBIG    1
>
> +# ifndef __x86_64__
> +/* -m32 has 32-bit wide `off_t'.  */
> +#  define _POSIX_V7_ILP32_OFF32        1
> +#  define _POSIX_V6_ILP32_OFF32        1
> +#  define _XBS5_ILP32_OFF32    1
> +# endif
> +
>  /* We optionally provide an environment with the above size but an 64-bit
>     side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
>
> @@ -89,8 +93,13 @@
>  #endif /* __WORDSIZE == 32 */
>
>  #define __ILP32_OFF32_CFLAGS   "-m32"
> -#define __ILP32_OFFBIG_CFLAGS  "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> "
>  #define __ILP32_OFF32_LDFLAGS  "-m32"
> -#define __ILP32_OFFBIG_LDFLAGS "-m32"
> +#if defined __x86_64__ && defined __ILP32__
> +# define __ILP32_OFFBIG_CFLAGS "-mx32"
> +# define __ILP32_OFFBIG_LDFLAGS        "-mx32"
> +#else
> +# define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> "
> +# define __ILP32_OFFBIG_LDFLAGS        "-m32"
> +#endif
>  #define __LP64_OFF64_CFLAGS    "-m64"
>  #define __LP64_OFF64_LDFLAGS   "-m64"
> --
> 1.7.6.5

Ping.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]