[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Building i386 RPMs on x86_64

On Thu, 2005-09-15 at 07:42 +0100, Paul Howarth wrote:
> On Wed, 2005-09-14 at 19:13 +0100, Dave Atkinson wrote:
> > Sorry if this issue's been addresses before (is there an effective way
> > to search fedora mailing lists?).
> > 
> > I've been trying to build some i386 RPMs on my x86_64 machine using
> > 
> > $ rpmbuild -ba --target i386 <spec file>
> > 
> > and it seems that this gives me library directories for 64-bit
> > libraries.  Specifically the %configure macro sets _libdir to
> > %{prefix}/lib64, but it should be %{prefix}/lib for i[3456]86 etc.
> > 
> > Am I missing something?
> Try "man setarch"

Aha! Well, I certainly missed that! However 

$ setarch i386 rpmbuild -ba --target i386 <spec file>

builds <package>.rpm, but I still get

$ rpm -qlp <package>.rpm

Looking at /usr/lib/rpm/macros, from line 865 (rpm-4.4.1-22.x86_64) I
see the following:
# ---- per-platform macros.
#       Macros that are specific to an individual platform. The values
#       will be used if the per-platform macro file does not exist..
%_arch                  x86_64
%_build_arch            x86_64
%_vendor                redhat
%_os                    linux
%_gnu                   -gnu
%_target_platform       %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}

and sure enough, there are no platform-specific macros for archs other
than x86_64 and noarch on the FC4 x86_64 install.  

$ rpm -ql rpm | grep '/usr/lib/rpm/.*-linux'

It just so happens I have the FC4 i386 install on another disk (this
whole exercise is about trying to get rid of it ;).  Looking at the
files installed on that:

$ rpm --dbpath /oldsys/var/lib/rpm -qil rpm|grep '/usr/lib/rpm/.*-linux'

I tried copying the ones that didn't exist in x86_64 and re-running

$ setarch i386 rpmbuild -ba --target i386 rpms/SPECS/<package>.spec
$ rpm -qlp rpms/RPMS/i386/<package>.i386.rpm

but the libs _still_ get installed in /usr/lib64!

Anyone else think I should file a bug for this?  I think it would also
be nice if rpmbuild --showrc would respect --target.  At present, I get

$ rpmbuild --showrc --target i386 | egrep '(_lib[[:space:]])|
optflags              : %{__global_cflags} -m64 -mtune=nocona
-14: _lib       lib64

which doesn't seem right to me.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]