Re: Bootstraping i686-linux gcc on x86_64-linux fails during libgcc stage1 on trunk

2010-03-03 Thread Laurent GUERBY
On Tue, 2010-03-02 at 16:34 -0800, H.J. Lu wrote:
 On Tue, Mar 2, 2010 at 4:18 PM, Laurent GUERBY laur...@guerby.net wrote:
  Hi,
 
  I'm trying to build a fully 32 bits GCC on a x86_64-linux 64 bits debian
  system which has all the 32 bits libraries installed (this is for the
  GCC compile farm testers).
 
  I've played with various things including --with-ld= and putting a fake
  ld script in PATH but something is hardcoding /usr/bin/ld and at the
  end of stage1 it always fails to link libgcc, after having successfully
  built a 32 bits cc1  friends.
 
  crti.o  friends in 32 bits are in /usr/lib32 on this system.
 
  What am I doing wrong? Is there a way to tell libgcc build to
  use ld the right way?
 
 
 I don't know about Debian. I can bootstap ia32 gcc trunk on Fedora/x86-64
 with
 
 # CC=gcc -m32 CXX=g++ -m32 ../src-trunk/configure \
   --enable-clocale=gnu --with-system-zlib --enable-shared --with-d
 emangler-in-ld --with-fpmath=sse i686-linux
 
 CC=gcc -m32 CXX=g++ -m32 is the key.

After investigation Fedora x86_64 has 32bits libs in /lib and 64bits
in /lib64 whereas Debian has 32 bits libs in /lib32 and 64bits in /lib
that explains the difference we see.

Laurent




Re: Bootstraping i686-linux gcc on x86_64-linux fails during libgcc stage1 on trunk

2010-03-03 Thread Laurent GUERBY
On Wed, 2010-03-03 at 00:33 +, Joseph S. Myers wrote:
 On Wed, 3 Mar 2010, Laurent GUERBY wrote:
 
  $ ../trunk/configure --prefix=/n/100/guerby/install-trunk
  --enable-languages=c --enable-__cxa_atexit --disable-nls
  --enable-threads=posix --with-mpfr=/opt/cfarm/mpfr-2.4.2-32
  --with-gmp=/opt/cfarm/gmp-4.2.4-32 --with-mpc=/opt/cfarm/mpc-0.8-32
  --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
  --disable-multilib
 
 The logic to use lib32 on Debian/Ubuntu is only in t-linux64, so you need 
 to build --enable-targets=all for this to work.  (I don't know whether 
 --enable-targets=all --disable-multilib works; it doesn't really make 
 logical sense, but might in fact cause the MULTILIB_OSDIRNAMES 
 configuration to take effect with none of the rest of the multilib 
 configuration.)

Thanks! --enable-targets=all --disable-multilib did the trick on debian:

http://gcc.gnu.org/ml/gcc-testresults/2010-03/msg00241.html

And the installed compiler works as expected, now trying
with more languages. I checked the generated multilib.h
and it has all the definitions plus DISABLE_MULTILIB
defined, see below.

I don't know if configure could do better here.

Sincerely,

Laurent

gue...@debian:~/build1$ cat ./gcc/multilib.h
static const char *const multilib_raw[] = {
. !m64 !m32;,
.:../lib64 m64 !m32;,
.:../lib32 !m64 m32;,
NULL
};

static const char *const multilib_matches_raw[] = {
m64 m64;,
m32 m32;,
NULL
};

static const char *multilib_extra = ;

static const char *const multilib_exclusions_raw[] = {
NULL
};

static const char *multilib_options = m64/m32;

#define DISABLE_MULTILIB  1





Bootstraping i686-linux gcc on x86_64-linux fails during libgcc stage1 on trunk

2010-03-02 Thread Laurent GUERBY
Hi,

I'm trying to build a fully 32 bits GCC on a x86_64-linux 64 bits debian
system which has all the 32 bits libraries installed (this is for the
GCC compile farm testers).

I've played with various things including --with-ld= and putting a fake
ld script in PATH but something is hardcoding /usr/bin/ld and at the
end of stage1 it always fails to link libgcc, after having successfully
built a 32 bits cc1  friends.

crti.o  friends in 32 bits are in /usr/lib32 on this system.

What am I doing wrong? Is there a way to tell libgcc build to
use ld the right way?

Thanks in advance,

Laurent

$ CC=gcc -m32
$ export CC
$ ../trunk/configure --prefix=/n/100/guerby/install-trunk
--enable-languages=c --enable-__cxa_atexit --disable-nls
--enable-threads=posix --with-mpfr=/opt/cfarm/mpfr-2.4.2-32
--with-gmp=/opt/cfarm/gmp-4.2.4-32 --with-mpc=/opt/cfarm/mpc-0.8-32
--build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
--disable-multilib
$ make
...
/home/guerby/build/./gcc/xgcc -B/home/guerby/build/./gcc/
-B/n/100/guerby/install-trunk/i686-linux-gnu/bin/
-B/n/100/guerby/install-trunk/i686-linux-gnu/lib/
-isystem /n/100/guerby/install-trunk/i686-linux-gnu/include
-isystem /n/100/guerby/install-trunk/i686-linux-gnu/sys-include-O2
-g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED  -shared -nodefaultlibs
-Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map
-o ./libgcc_s.so.1.tmp -g -O2 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o
_ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o
_enable_execute_stack_s.o _trampoline_s.o __main_s.o _absvsi2_s.o
_absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o
_mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o
_ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o
_ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o
_paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o
_powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o
_divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o
_fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o
_fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o
_fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o
_floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o
_moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o
addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o
negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o
floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o
floatunditf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o
trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o tf-signs_s.o unwind-dw2_s.o
unwind-dw2-fde-glibc_s.o unwind-sjlj_s.o gthr-gnat_s.o unwind-c_s.o
emutls_s.o -lc  rm -f ./libgcc_s.so  if [ -f ./libgcc_s.so.1 ]; then
mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi 
mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1  ln -s
libgcc_s.so.1 ./libgcc_s.so
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libc.so when
searching for -lc
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libc.a when searching
for -lc
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/crti.o' is
incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/crtn.o' is
incompatible with i386 output
collect2: ld returned 1 exit status
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/home/guerby/build/i686-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/home/guerby/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/guerby/build'
make: *** [bootstrap] Error 2
$ file gcc/cc1
build/gcc/cc1: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped





Re: Bootstraping i686-linux gcc on x86_64-linux fails during libgcc stage1 on trunk

2010-03-02 Thread Joseph S. Myers
On Wed, 3 Mar 2010, Laurent GUERBY wrote:

 $ ../trunk/configure --prefix=/n/100/guerby/install-trunk
 --enable-languages=c --enable-__cxa_atexit --disable-nls
 --enable-threads=posix --with-mpfr=/opt/cfarm/mpfr-2.4.2-32
 --with-gmp=/opt/cfarm/gmp-4.2.4-32 --with-mpc=/opt/cfarm/mpc-0.8-32
 --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
 --disable-multilib

The logic to use lib32 on Debian/Ubuntu is only in t-linux64, so you need 
to build --enable-targets=all for this to work.  (I don't know whether 
--enable-targets=all --disable-multilib works; it doesn't really make 
logical sense, but might in fact cause the MULTILIB_OSDIRNAMES 
configuration to take effect with none of the rest of the multilib 
configuration.)

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: Bootstraping i686-linux gcc on x86_64-linux fails during libgcc stage1 on trunk

2010-03-02 Thread H.J. Lu
On Tue, Mar 2, 2010 at 4:18 PM, Laurent GUERBY laur...@guerby.net wrote:
 Hi,

 I'm trying to build a fully 32 bits GCC on a x86_64-linux 64 bits debian
 system which has all the 32 bits libraries installed (this is for the
 GCC compile farm testers).

 I've played with various things including --with-ld= and putting a fake
 ld script in PATH but something is hardcoding /usr/bin/ld and at the
 end of stage1 it always fails to link libgcc, after having successfully
 built a 32 bits cc1  friends.

 crti.o  friends in 32 bits are in /usr/lib32 on this system.

 What am I doing wrong? Is there a way to tell libgcc build to
 use ld the right way?


I don't know about Debian. I can bootstap ia32 gcc trunk on Fedora/x86-64
with

# CC=gcc -m32 CXX=g++ -m32 ../src-trunk/configure \
--enable-clocale=gnu --with-system-zlib --enable-shared --with-d
emangler-in-ld --with-fpmath=sse i686-linux

CC=gcc -m32 CXX=g++ -m32 is the key.

-- 
H.J.