Обсуждение: Error building 32 bit on 64 bit linux system
All,<br /> I am trying to build 8.2.5, forcing to a 32 bit build on a 64 bit system. I have set CFLAGS=-m32, and I run theconfigure and make/make install as follows:<br /><br /> setarch i386 ./configure<br /> setarch i386 make<br /> setarchi386 make install<br /><br /> However, I get the following error (using timezone for example):<br /><br /> $ make<br/> gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing-I../../src/include -D_GNU_SOURCE -c -o localtime.o localtime.c<br /> gcc -m32 -Wall -Wmissing-prototypes-Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -I../../src/include-D_GNU_SOURCE -c -o strftime.o strftime.c<br /> gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith-Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -I../../src/include -D_GNU_SOURCE -c -o pgtz.o pgtz.c<br /> /usr/bin/ld -r -o SUBSYS.o localtime.o strftime.o pgtz.o<br /> /usr/bin/ld: Relocatablelinking with relocations from format elf32-i386 (localtime.o) to format elf64-x86-64 (SUBSYS.o) is not supported<br/> make: *** [SUBSYS.o] Error 1<br /><br /> Funny thing is, there is no SUBSYS.o in my current directory. IfI build from the top, I see this same error in each dirctory/makefile where a SUBSYS.o is linked with. If I search my buildtree after a top-down build, I do not see any SUBSYS.O files at all. Where is this SUBSYS.o getting created, and whyisn't it being created as a 32 bit file instead of 64 bit?<br /><br /> Doug Knight<br /> WSI Corp<br /> Andover, MA, USA
I'm not sure, but maybe linker also needs a switch to make 32bit output.
Zdenek
Doug Knight napsal(a):
> All,
> I am trying to build 8.2.5, forcing to a 32 bit build on a 64 bit
> system. I have set CFLAGS=-m32, and I run the configure and make/make
> install as follows:
>
> setarch i386 ./configure
> setarch i386 make
> setarch i386 make install
>
> However, I get the following error (using timezone for example):
>
> $ make
> gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
> -I../../src/include -D_GNU_SOURCE -c -o localtime.o localtime.c
> gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
> -I../../src/include -D_GNU_SOURCE -c -o strftime.o strftime.c
> gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
> -I../../src/include -D_GNU_SOURCE -c -o pgtz.o pgtz.c
> /usr/bin/ld -r -o SUBSYS.o localtime.o strftime.o pgtz.o
> /usr/bin/ld: Relocatable linking with relocations from format elf32-i386
> (localtime.o) to format elf64-x86-64 (SUBSYS.o) is not supported
> make: *** [SUBSYS.o] Error 1
>
> Funny thing is, there is no SUBSYS.o in my current directory. If I build
> from the top, I see this same error in each dirctory/makefile where a
> SUBSYS.o is linked with. If I search my build tree after a top-down
> build, I do not see any SUBSYS.O files at all. Where is this SUBSYS.o
> getting created, and why isn't it being created as a 32 bit file instead
> of 64 bit?
>
> Doug Knight
> WSI Corp
> Andover, MA, USA
Doug Knight wrote: > All, > I am trying to build 8.2.5, forcing to a 32 bit build on a 64 bit > system. I have set CFLAGS=-m32, and I run the configure and make/make > install as follows: > > setarch i386 ./configure > setarch i386 make > setarch i386 make install > > However, I get the following error (using timezone for example): > > $ make > gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline > -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing > -I../../src/include -D_GNU_SOURCE -c -o localtime.o localtime.c > gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline > -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing > -I../../src/include -D_GNU_SOURCE -c -o strftime.o strftime.c > gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline > -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing > -I../../src/include -D_GNU_SOURCE -c -o pgtz.o pgtz.c > /usr/bin/ld -r -o SUBSYS.o localtime.o strftime.o pgtz.o > /usr/bin/ld: Relocatable linking with relocations from format > elf32-i386 (localtime.o) to format elf64-x86-64 (SUBSYS.o) is not > supported > make: *** [SUBSYS.o] Error 1 > > Funny thing is, there is no SUBSYS.o in my current directory. If I > build from the top, I see this same error in each dirctory/makefile > where a SUBSYS.o is linked with. If I search my build tree after a > top-down build, I do not see any SUBSYS.O files at all. Where is this > SUBSYS.o getting created, and why isn't it being created as a 32 bit > file instead of 64 bit? > "man ld" IYF. It looks like you need the --oformat option to tell the linker you want 32bit output. Of course you won't find the SUBSYS.o files - it it the creation of those that is failing. cheers andrew
Thanks Andrew, I missed the little -o in front of the SUBSYS.o. I did find that if I did "export LDEMULATION=elf_i386"
Iwas able to link successfully. Now I just need to tell configure that I want to use the 32 bit perl libs, not the 64
bitones it keeps finding by using:<br /><br /> $PERL -MConfig -e 'print $Config{archlibexp}'<br /><br /> Both 32 and 64
bitlibraries are installed on my system, but the return from the above command within configure points to the 64 bit
libs,as the perl executable is a 64 bit file. I think my better option is to build my 32 bit versions on a 32 bit
CentOSVM I have setup.<br /><br /> Doug<br /><br /> On Mon, 2008-02-18 at 09:48 -0500, Andrew Dunstan wrote:
<blockquotetype="CITE"><pre>
<font color="#000000">Doug Knight wrote:</font>
<font color="#000000">> All,</font>
<font color="#000000">> I am trying to build 8.2.5, forcing to a 32 bit build on a 64 bit </font>
<font color="#000000">> system. I have set CFLAGS=-m32, and I run the configure and make/make </font>
<font color="#000000">> install as follows:</font>
<font color="#000000">></font>
<font color="#000000">> setarch i386 ./configure</font>
<font color="#000000">> setarch i386 make</font>
<font color="#000000">> setarch i386 make install</font>
<font color="#000000">></font>
<font color="#000000">> However, I get the following error (using timezone for example):</font>
<font color="#000000">></font>
<font color="#000000">> $ make</font>
<font color="#000000">> gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline </font>
<font color="#000000">> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing </font>
<font color="#000000">> -I../../src/include -D_GNU_SOURCE -c -o localtime.o localtime.c</font>
<font color="#000000">> gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline </font>
<font color="#000000">> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing </font>
<font color="#000000">> -I../../src/include -D_GNU_SOURCE -c -o strftime.o strftime.c</font>
<font color="#000000">> gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline </font>
<font color="#000000">> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing </font>
<font color="#000000">> -I../../src/include -D_GNU_SOURCE -c -o pgtz.o pgtz.c</font>
<font color="#000000">> /usr/bin/ld -r -o SUBSYS.o localtime.o strftime.o pgtz.o</font>
<font color="#000000">> /usr/bin/ld: Relocatable linking with relocations from format </font>
<font color="#000000">> elf32-i386 (localtime.o) to format elf64-x86-64 (SUBSYS.o) is not </font>
<font color="#000000">> supported</font>
<font color="#000000">> make: *** [SUBSYS.o] Error 1</font>
<font color="#000000">></font>
<font color="#000000">> Funny thing is, there is no SUBSYS.o in my current directory. If I </font>
<font color="#000000">> build from the top, I see this same error in each dirctory/makefile </font>
<font color="#000000">> where a SUBSYS.o is linked with. If I search my build tree after a </font>
<font color="#000000">> top-down build, I do not see any SUBSYS.O files at all. Where is this </font>
<font color="#000000">> SUBSYS.o getting created, and why isn't it being created as a 32 bit </font>
<font color="#000000">> file instead of 64 bit?</font>
<font color="#000000">></font>
<font color="#000000">"man ld" IYF.</font>
<font color="#000000">It looks like you need the --oformat option to tell the linker you want </font>
<font color="#000000">32bit output.</font>
<font color="#000000">Of course you won't find the SUBSYS.o files - it it the creation of </font>
<font color="#000000">those that is failing.</font>
<font color="#000000">cheers</font>
<font color="#000000">andrew</font>
</pre></blockquote>
Doug Knight <dknight@wsi.com> writes:
> I am trying to build 8.2.5, forcing to a 32 bit build on a 64 bit
> system. I have set CFLAGS=-m32,
setarch might help ...
regards, tom lane
Doug Knight írta: > All, > I am trying to build 8.2.5, forcing to a 32 bit build on a 64 bit > system. I have set CFLAGS=-m32, and I run the configure and make/make > install as follows: > > setarch i386 ./configure > setarch i386 make > setarch i386 make install > > However, I get the following error (using timezone for example): > > $ make > gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline > -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing > -I../../src/include -D_GNU_SOURCE -c -o localtime.o localtime.c > gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline > -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing > -I../../src/include -D_GNU_SOURCE -c -o strftime.o strftime.c > gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline > -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing > -I../../src/include -D_GNU_SOURCE -c -o pgtz.o pgtz.c > /usr/bin/ld -r -o SUBSYS.o localtime.o strftime.o pgtz.o > /usr/bin/ld: Relocatable linking with relocations from format > elf32-i386 (localtime.o) to format elf64-x86-64 (SUBSYS.o) is not > supported > make: *** [SUBSYS.o] Error 1 > > Funny thing is, there is no SUBSYS.o in my current directory. If I > build from the top, I see this same error in each dirctory/makefile > where a SUBSYS.o is linked with. If I search my build tree after a > top-down build, I do not see any SUBSYS.O files at all. Where is this > SUBSYS.o getting created, and why isn't it being created as a 32 bit > file instead of 64 bit? This problem is solved by using export CC="gcc -m32" export LD="ld -melf_i386" before doing setarch i386 (./configure ... ; make) Best regards, Zoltán Böszörményi -- ---------------------------------- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH http://www.postgresql.at/