Author Jason.Vas.Dias
Recipients Alex.Leach, Jason.Vas.Dias, georg.brandl, r.david.murray
Date 2011-05-30.18:00:42
SpamBayes Score 1.1424e-05
Marked as misclassified No
Message-id <1306778443.42.0.0928986334988.issue11946@psf.upfronthosting.co.za>
In-reply-to
Content
RE: msg137311 : Alex - you wrote :
> I'm recompiling this 32 bit python with the following commands:-
> $ export CFLAGS="-O2 -fPIC"
> $ export CXXFLAGS=$CFLAGS
> $ OPT=-m32 LDFLAGS=-m32 ./configure --prefix=$HOME/32
> Does that seem sensible to you??

Well, it depends on the output of these commands on your system :
$ gcc -print-search-dirs | grep '^libraries'
libraries: =/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/:/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../x86_64-pc-linux-gnu/lib/x86_64-pc-linux-gnu/4.6.0/:/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../x86_64-pc-linux-gnu/lib/../lib64/:/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../x86_64-pc-linux-gnu/4.6.0/:/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib64/:/lib/x86_64-pc-linux-gnu/4.6.0/:/lib/../lib64/:/usr/lib/x86_64-pc-linux-gnu/4.6.0/:/usr/lib/../lib64/:/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../:/lib/:/usr/lib/

$ gcc -print-multi-os-directory
../lib64

Your C compiler should be appending an option such as :
  '--dynamic-linker=/lib32/ld-linux.so.2 -rpath /usr/lib32:/lib32' 
to it's ld(1) command line - if you have C compilation problems, look
at the output of adding '--verbose' to the $CFLAGS you
gave and looking at what options are used by gcc's 'collect' phase:
$ gcc -o /tmp/t ~jason/t.c --verbose 2>&1 | tail -n 2
COLLECT_GCC_OPTIONS='-o' '/tmp/t' '-v' '-mtune=k8' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.0/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /tmp/t /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/crtbegin.o -L/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0 -L/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../.. /tmp/ccoSip93.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/crtend.o /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib64/crtn.o

$ gcc -m32 -o /tmp/t ~jason/t.c --verbose 2>&1 | tail -n 2
COLLECT_GCC_OPTIONS='-m32' '-o' '/tmp/t' '-v' '-mtune=i686' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.0/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib32/ld-linux.so.2 -o /tmp/t /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/crt1.o /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/crti.o /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/32/crtbegin.o -L/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/32 -L/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32 -L/lib/../lib32 -L/usr/lib/../lib32 -L/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0 -L/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../.. /tmp/ccZzwAuw.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/32/crtend.o /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/crtn.o

'~jason/t.c' is just :
$ echo -e '#include <stdio.h>\nint main(){ printf("hello world!\n");}' > ~jason/t.c




If you are on a RedHat derived system, where /lib/ld-linux.so.2 is
32-bit ,  you should be OK;  if, however, you are on a Gentoo
derived or "my style" system, your
History
Date User Action Args
2011-05-30 18:00:43Jason.Vas.Diassetrecipients: + Jason.Vas.Dias, georg.brandl, r.david.murray, Alex.Leach
2011-05-30 18:00:43Jason.Vas.Diassetmessageid: <1306778443.42.0.0928986334988.issue11946@psf.upfronthosting.co.za>
2011-05-30 18:00:42Jason.Vas.Diaslinkissue11946 messages
2011-05-30 18:00:42Jason.Vas.Diascreate