PDA

View Full Version : building i386 rpm on x86_64



grujakg
26th December 2006, 01:07 AM
I'm now clueless, so please help.
I'm trying to build freetype i386 rpm package for bci enabled, 'couse my i386 apps font rendering so sucks (firefox, thunderbird, nvu etc) that I nearly can't read it.
So my problem is what ever I do I'm getting ELF64 library which is broken.

I had installed all necessary libraries, and issued following command:

sudo rpmbuild -bb /usr/src/redhat/SPECS/freetype.spec --target=i386

everything after that looks promising:

Building target platforms: i386
Building for target i386
[...]
+ export 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing'
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing'
+ export 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing'
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing'
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables'
+ export FFLAGS
[...]
`/usr/lib/rpm/redhat/config.sub' -> `./builds/unix/config.sub'
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --disable-static
[...]
cd builds/unix; ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --disable-static
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking target system type... i386-redhat-linux-gnu

intermediate obj building fine (ELF32) but then when gcc trying to make libfreetype.so.x.y I getting this warnings:

/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftsystem.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftdebug.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftinit.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftbase.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftbbox.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftbdf.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftbitmap.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftglyph.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftgxval.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftmm.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `/usr/src/redhat/BUILD/freetype-2.2.1/objs/.libs/ftotval.o' is incompatible with i386:x86-64 output
[...]

gcc trying to build 64bit library.

I had try to install rpm-build.i386 with the exact same result.
Am I missing something?
If any one have any sugestion or idea please help me.

Thanks in advance

Jman
26th December 2006, 11:30 PM
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --disable-static


Still 64 bit.


If you install mock and enable a i386 target, that will install everything in the chroot as i386. I've built for i386 this way.

grujakg
27th December 2006, 11:26 AM
Thanks...
I thought that that would be the only right way to do the job, but I tried the easy and wrong one I guess

Jman
28th December 2006, 03:46 AM
It is merely the only way I know of, though it is the cleanest, as it rebuilds the environment every time.

grujakg
29th December 2006, 02:09 PM
I just did it with mock, great tool and literally if I didn't stood in front of xterm I'd feel like point and click win user ;)
Thanks again for tip.