PATCH: Configure x86_64 in sysdeps/x86_64/preconfigure
H.J. Lu
hjl.tools@gmail.com
Wed Mar 21 20:13:00 GMT 2012
On Wed, Mar 21, 2012 at 11:50 AM, Roland McGrath <roland@hack.frob.com> wrote:
>> Here is a patcn to implement #1. Tested on Linux/x86-64. OK to install?
>
> That is #0 and #1.
>
>> 2012-03-21 H.J. Lu <hongjiu.lu@intel.com>
>>
>> * sysdeps/unix/sysv/linux/configure.in: Check x86_64* instead
>> of x86_64 when setting libc_cv_slibdir, libdir and
>> libc_cv_localedir.
>> * sysdeps/unix/sysv/linux/configure: Regenerated.
>
> This part is OK. Commit it alone.
>
>> --- /dev/null
>> +++ b/sysdeps/x86_64/preconfigure
>> @@ -0,0 +1,12 @@
>> +test "$machine" != "x86_64" ||
>> +if echo __LP64__ | ${CC-cc} $CFLAGS $CPPFLAGS -E - | grep __LP64__ > /dev/null; then
>> + machine=x86_64/x32
>> +else
>> + machine=x86_64/64
>> +fi
>> +
>> +test -n "$base_machine" || case "$machine" in
>> +x86_64*)
>> + base_machine=x86_64
>> + ;;
>> +esac
>
> I would put the x32 test inside the case statement after setting base_machine.
>
> I think that any compilation test should be done using autoconf macros
> rather than manual sh code like this. i.e., write a preconfigure.in
> instead. I don't think grepping -E output is a good idea. Instead, you
> can write a compile test that does something like:
>
> #ifndef __LP64__
> # error not lp64
> #endif
>
> and use its success/failure to decide.
>
Here is the patch to add sysdeps/x86_64/preconfigure. Tested on
Linux/x86-64. OK to install?
Thanks.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libc-x86_64-2b.patch
Type: text/x-patch
Size: 4173 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120321/68725b10/attachment.bin>
More information about the Libc-alpha
mailing list