This is the mail archive of the 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]

report and queries on building 64bit + 32bit bi-arch amd64/i686 multilib glibc-2.8.90+ with gcc-4.2.4 on x86_64 AMD-TL64 linux-2.6.26+ GNU Linux

Report and questions on building from glibc-2.8-20080602+ on x86_64 GNU/Linux 2.6.26+ (Gentoo/My_Own_distro...):

----------  Forwarded Message  ----------

Subject: git 200806020+ crypt addon deprecated but required + 64/32-bit multilib woes ?
Date: Sunday 01 June 2008
From: Jason Vas Dias <>

When I attempt to build the HEAD branch after
   cvs co libc
for an Linux x86_64 machine, under kernel 2.6.26-rc3, glibc-2.8 
(built OK from release tarball) with gcc-4.2.4 , binutils, 
at first any valid configure invocation fails when ${SRCDIR}/crypt exists:

$ (setarch i686; export ASFLAGS='-Wa,--32,-march=i686' CFLAGS=${ASFLAGS}' -march=i686 -mtune=generic -O -g -pipe -m96bit-long-double' 
  GCC='/usr/libexec/gcc/i686-pc-linux-gnu/4.2.4/gcc -m32' CC=${GCC}
  CPPFLAGS=-I/usr/include/32; LDFLAGS='-melf_i386'; 
 ../configure --prefix=/usr --libdir=/usr/lib32 --bindir=/usr/bin/32 --includedir=/usr/include/32 --sysconfdir=/etc/32 --datadir=/usr/share/32 --enable-shared \
               --enable-threads=posix --enable-tls --with-binutils='/usr/bin/32' \
               --enable-targets='i686-pc-linux-gnu' --host='i686-pc-linux-gnu' --host='i686-pc-linux-gnu' --target='i686-pc-linux-gnu' --with-cpu='i686')
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
configure: error:
*** It seems that you're using an old `crypt' add-on.  crypt is now
*** part of glibc and using the old add-on will not work with this
*** release.  Start again with fresh sources and without the old
*** `crypt' add-on.

The same happens for the 64-bit build, which was intended to have been an dual-arch build :

$ GCC='/usr/libexec/gcc/x86_64-pc-linux-gnu/4.2.4/gcc -m64' CC=${GCC} ASFLAGS='-Wa,--64' LDFLAGS='-Wl,-melf_x86_64' CFLAGS='-march=native -mtune=native -O -g -pipe'
  ../configure --prefix=/usr --libdir=/usr/lib64 --enable-shared --enable-threads=posix --enable-tls --with-binutils=/usr/bin  \
                --enable-targets='x86_64-pc-linux-gnu i686-pc-linux-gnu' --enable-multilib --host='x86_64-pc-linux-gnu'

Both /lib32/ and lib64/ were valid sym-links to glibc-2.8+ objects, with /lib being a link to /lib64,
and I wanted the locale shared objects to be installed under /usr/share/32 - had not yet been installed there during configure - they are correctly
built during the build.

So I do

$ mv ../crypt ../not-crypt

and then configure and build, until it fails because ../crypt does not exist;
then restoring ../crypt allows the build to succeed. 

Then using gcc-4.2.4, for the 32-bit build, ONLY during the i686 glibc build, glibc's translation of
the GCC atomic built-ins :
     __sync_fetch_and_add               to __sync_fetch_and_add_4   and
     __sync_fetch_val_compare_and_swap  to __sync_fetch_val_compare_and_swap_acq
     __sync_fetch_bool_compare_and_swap to __sync_fetch_bool_compare_and_swap_acq
are NOT FOUND during the link phase, but ARE found during a  build of this 
program under gcc-4.2.4 -m32 and -m64:
$ echo ' unsigned u_dec(unsigned u) { int u2=u; __sync_fetch_and_add_4(&u,-1); __sync_fetch_val_compare_and_swap(&u2,&u,0); return u; } 
         int main(){ unsigned u; return (int)u_dec(u); }
       ' |
  gcc {both -m32 and -m64 work here!} - -o t;
So I added '-L/usr/lib/gcc/${i686/x86_64}-pc-linux-gnu' to LDFLAGS in the Makefile for and it linked OK -
but this cannot be modified globally .

These were then the ONLY errors in the build, and then "make install" succeeded.

/usr/lib{/gcc,exec/%{m32:i686}%{!m32:x86_64}-pc-linux-gnu/gcc-4.3.0} do exist, but ONLY the gcc-4.2.4 directories were in my $PATH -
No /usr/lib{32,64}/libgcc* libraries exist, and they can ONLY be found in the /usr/lib/gcc/*/[43].[3-8].[0-9]{,/32} directories.
I am trying to put together a multi-arch build environment for (gcc-3.3+.x - 4.3.x) / glibc-2.[5-8].x x86/x86_64 -
(glibc libraries 2.5, 2.6.1, 2.7, 2.8 also existed in /lib{32,64} ).

Anyone seen this / got any fixes / workarounds ? 

Otherwise I'll raise a bug and maybe develop a fix.
It seems that better handling of auto-guessing the required add-ons and the correct gcc library path
is required during configure for the non-distro GNU build - this really ought to be quite easy to fix -
perhaps with true support for '--enable-multilib' configure option ?

Yes, the above bugs can be worked around, but are a pain ! Should I raise bugzillas about them ? Has anyone else done so ?

After * build after workarounds applied and 'make install' runs, everything works OK, except for this message from programs or
libraries that had linked to previous * objects, eg.:

$ perl -v
perl: /lib64/ no version information available (required by /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/CORE/
perl: /lib64/ no version information available (required by /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/CORE/

The configure had been unable to guess that the ${GCC} compiler had enabled versioning only for libcrypt, not for the other subdirs - rebuilding
libcrypt with --enable-versioning fixes ?

(BTW, the actual configure I used for the x86_64 /usr/lib64 install was:

$ ../configure --prefix=/usr --libdir=/usr/lib64 --enable-shared --enable-threads=posix --enable-tls --with-binutils=/usr/bin  \
               --enable-targets='x86_64-pc-linux-gnu i686-pc-linux-gnu' --enable-multilib --host=x86_64-pc-linux-gnu x86_64-pc-linux-gnu

The 'enable-multilib' and 'enable-targets' settings come from those I used for the target binutils and gcc ,
but actually appear to have no effect for glibc ? ie. it does not also build the i686 arch.

../configure --help provides no clues whatsoever about how to successfully achieve a dual-architecture i686 and x86_64 build and installation , and
there seems to be little online help on this subject.

In conclusion,

#1 on my glibc wish-list would be support for a configure argument such as:
 o --enable-biarch='32 64' or just '--enable-multilib' 
    which would build and install 64-bit objects into the first library under ${DESTDIR}/${PREFIX} listed in /etc/ (without destdir)
    that contains a 64-bit glibc installation, and 32-bit object into the first 32-bit glibc installation listed in /etc/ on the
    target or as specified with:
 o --libdir32=/usr/lib32 --libdir64=/usr/lib64 ...

Is anything like the above on the cards for the GNU / non-distro release ?

Worthwhile my developing fixes for the above issues and submitting to libc-alpha ?

Thanks in advance for any help / suggestions offered,

Jason Vas Dias<> /

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