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: Configure x86_64 in sysdeps/x86_64/preconfigure


On Wed, Mar 21, 2012 at 10:46 AM, Roland McGrath <roland@hack.frob.com> wrote:
>> I need to set machine, libc_cv_slibdir and libc_cv_localedir properly
>> for both x86-64 and x32. ?For x86-64, machine should be x86_64/64
>> and for x32, machine should be x86_64/x32 so that proper sysdeps
>> directories will be used. ?That leaves libc_cv_slibdir and libc_cv_localedir.
>> Should they be set in sysdeps/x86_64/preconfigure or
>> sysdeps/unix/sysv/linux/configure?
>
> machine belongs in preconfigure. ?Nothing else does.
> Send an independent change just for that.
>
> The existing code for setting slibdir and localedir is in
> sysdeps/unix/sysv/linux/configure. ?There it has common cases that apply to
> several 64-bit machines. ?For localedir, that common case still applies to
> x32. ?So I think the right things to do are:
>
> 1. Separate the logic in sysdeps/unix/sysv/linux/configure so that
> ? it still handles localedir even if slibdir is already set.
> 2. Make that match x86_64* rather than just x86_64.
> 3. Add sysdeps/unix/sysv/linux/x86_64/x32/configure with similar logic
> ? for setting slibdir/libdir to the x32 names.
>
> #1 can be its own patch.
> #2 and #3 can go together in one patch, or be two separate patches.
>
>

Here is a patcn to implement #1.  Tested on Linux/x86-64.  OK to install?

Thanks.

-- 
H.J.
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.
	* sysdeps/x86_64/preconfigure: New file.

diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index 33821c0..3103161 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -393,7 +393,7 @@ case "$prefix" in
   # and libc_cv_localedir.
   test -n "$libc_cv_slibdir" || \
   case $machine in
-  sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
+  sparc/sparc64 | x86_64* | powerpc/powerpc64 | s390/s390-64)
     libc_cv_slibdir="/lib64"
     if test "$libdir" = '${exec_prefix}/lib'; then
       libdir='${exec_prefix}/lib64';
diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in
index 59a1311..556ca84 100644
--- a/sysdeps/unix/sysv/linux/configure.in
+++ b/sysdeps/unix/sysv/linux/configure.in
@@ -132,7 +132,7 @@ case "$prefix" in
   # and libc_cv_localedir.
   test -n "$libc_cv_slibdir" || \
   case $machine in
-  sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
+  sparc/sparc64 | x86_64* | powerpc/powerpc64 | s390/s390-64)
     libc_cv_slibdir="/lib64"
     if test "$libdir" = '${exec_prefix}/lib'; then
       libdir='${exec_prefix}/lib64';
diff --git a/sysdeps/x86_64/preconfigure b/sysdeps/x86_64/preconfigure
new file mode 100644
index 0000000..b9f4d2b
--- /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

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