I think I see what is going on here.
The glibc when built under mips has it's abi hard coded to default to n32.
There is some code down in ports/sysdeps/mips which tries to adjust the abi
based on the way the compiler is invoked. In our case it ends up always
defaulting to n32 abi.
If we set CPPFLAGS before we run configure, the abi will be set to the
64-bit abi.
The following changes give me the correct libries in lib64
Index: glibc.conf
===================================================================
--- glibc.conf (revision 35524)
+++ glibc.conf (working copy)
@@ -41,6 +41,18 @@
# Tweaking libc_cv_gnu89_inline in config.cache did not help,
[ $arch = mips64 ] && var_insert GCC_WRAPPER_INSERT ' ' '-fgnu89-inline'
+# glibc on mips64 is very tricky,
+# it tries to pick it's abi from the CPPFLAGS,
+# otherwise it will default to ELF-32/n32
+# we want 64 bit libs in lib64 configure needs this set
+# (it will get removed from the tool chain gcc at line 23 above)
+# also have to addd mabi=64 to gcc wrapper, or build will fail
+if ( [ $arch = mips64 ] && [ $pkg == glibc ] ) ; then
+ export CPPFLAGS=-mabi=64
+ var_insert GCC_WRAPPER_INSERT ' ' '-mabi=64'
+fi
+
+
# does currently not inline all necessary with -Os
# glibc-2.7/objdir/libc_pic.os: In function `faccessat': (.text+0x7bfaf):
undefined reference to `fstatat64'
GCC_WRAPPER_INSERT="${GCC_WRAPPER_INSERT//-Os/-O2}"
Jan
> -----Original Message-----
> From: Jan Rovins [mailto:[email protected]]
> Sent: Monday, February 08, 2010 6:54 PM
> To: T2 developers mailing list
> Subject: [t2] Mips64 Multilib build is not defaulting to 64-bit libraries
>
>
> Hi Rene & List,
>
> I have fixed most of the minor issues in Mips64 that are causing compile
> errors up to building of gcc at the cross stage. However, gcc (at the
> cross stage) is now bombing out with linker errors about incompatible
> ABI's.
>
> Upon further investigation, it looks like nothing is being built as 64
> bit:
>
> When the toolchain glibc builds, the .o files are of this format:
> ELF 32-bit MSB relocatable, MIPS, N32 MIPS64 rel2 version 1 (SYSV), not
> stripped
> These are the things that end up as .so files in lib64 in the format:
> ELF 32-bit MSB shared object, MIPS, N32 MIPS64 rel2 version 1 (SYSV),
> for GNU/Linux 2.6.16, dynamically linked (uses shared libs), stripped
> I would expect it to be ELF 64-bit MSB XXXXXXX
>
> When the glibc32 package builds, it is the same as above
> .o files are: ELF 32-bit MSB relocatable, MIPS, N32 MIPS64 rel2 version
> 1 (SYSV), not stripped
> /lib is: ELF 32-bit MSB shared object, MIPS, N32 MIPS64 rel2 version 1
> (SYSV), for GNU/Linux 2.6.16, dynamically linked (uses shared libs),
> stripped
>
> When gcc is build in the "cross" stage, it's objects are of type:
> ELF 32-bit MSB relocatable, MIPS, MIPS64 rel2 version 1 (SYSV), not
> stripped
> and then there are the ABI mismatch errors on link.
>
> When I compare the ELF format to an older gcc from the chip vendors tool
> chain:
> /lib64 has:
> ELF 64-bit MSB shared object, MIPS, MIPS64 rel2 version 1 (SYSV),
> dynamically linked, stripped
> /lib has:
> ELF 32-bit MSB shared object, MIPS, N32 MIPS64 rel2 version 1 (SYSV),
> for GNU/Linux 2.6.10, dynamically linked (uses shared libs), not stripped
> which is the format that i would be expecting.
>
> I am building Mips64 multilib on an Ubuntu 8.10 x86 32-bit buildhost, I
> wonder if the fact that my build host is 32 bit is causing toolchain-gcc
> to default to 32-bit libs in /lib64
>
> Any ideas or clues on how to solve this one would be greatly appreciated.
> ErrorLog for gcc (stage cross) is attached.
>
>
> Jan
>
>
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [email protected] with a subject of: unsubscribe t2
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[email protected] with a subject of: unsubscribe t2