On Mon, Dec 13, 1999 at 09:34:22AM -0500, Michael J. McGillick wrote:
> I've been playing around with rebuilding RPMS for the past 2 weeks.
> Some have gone smoothly, with absolutely no warnings, errors, etc.
> I'm trying to optimize these and compile them as i686 instead of
> i386 binaries.  The steps I've done so far are this:
> 
>    1) Gone into the file /usr/lib/rpm/rpmrc and modified the line:
> 
>          optflags: i386 -O2 -m486 -fno-strength-reduce
> 
>       with:
> 
>          optflags: -O3 -mpentiumpro -DCPU=i686 -fno-strength-reduce
>         -fexpensive-optimizations -ffast-math -funroll-loops
>         -fomit-frame-pointer
> 
>       This is all on one line, btw.  Just broken up here for clarity.
> 
>    2) Downloaded the srpms for all of the packages in the 6.1
>       distribution.
> 
>    3) Doing one at a time, I install the source by doing:
> 
>       rpm -i filename-version.src.rpm
> 
>    4) Then, in the /usr/src/redhat/SPECS directory I type:
> 
>       rpm -ba --target i686 filename.spec
> 
> Now, like I said, some of these build just fine.  I see all of the
> messages scroll past, and that it's compiling this file or that, and then
> at the end, I will usually see something like this (this happened to be
> on a rebuild of dhcp I was doing):
> 
>    Finding  Provides: (using /usr/lib/rpm/find-provides)...
>    Finding  Requires: (using /usr/lib/rpm/find-requires)...
>    PreReq: /bin/sh
>    Requires: ld-linux.so.2 libc.so.6 /bin/sh
>    libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1)
>    Obsoletes: dhcpd
>    Wrote: /usr/src/redhat/SRPMS/dhcp-2.0-3.src.rpm
>    Wrote: /usr/src/redhat/RPMS/i686/dhcp-2.0-3.i686.rpm
>    Executing: %clean
>    + umask 022
>    + cd /usr/src/redhat/BUILD
>    + cd dhcp-2.0
>    + rm -rf /var/tmp/dhcp-root
>    + exit 0
> 
> Sure enough, if I go into /usr/src/redhat/RPMS/i686, the new binary is
> there.  If I get to this point, can I assume that the binary rebuilt
> properly, or is there something else that I need to check.  Secondly, is
> this package really optimized, or do I need to do something to the .tar.gz
> source code to really optimize it, IE. use pmake or egcs?

Yes, you should have a good RPM at this point. Any errors along the
way, and it will bail out. As it is building, you should see the gcc
output and any flags that are passed to gcc. If you see your optflags
scrolling by, you are OK. This depends on how well the SPEC file is
written, and how the developer has his build setup. In my experience,
what you are doing *almost* always works. Occaionally, I find one that
does not accept the optflags. In this case, I go into the /BUILD
subdir, edit the apropriate file, and just do a 'make'. I then install
the already built RPM, and then copy the executable(s) to wherever
they go. Maybe there is a better way, dunno. I ran into this the other
day with w3m, where the actuall makefile was something like
XXMakefile, and nothing I could do with the SPEC file worked.  

> In other instances, I have gotten a message that says something similare
> to this when I try to rebuild:
> 
>    # rpm -ba --target i686 filename.spec
>    Building target platforms: i686
>    Building for target i686
>    Architecture is not included: i686
>    #
> 
> What I've done in this case is go into the spec file, and change the line
> that says:
> 
>    ExclusiveArch: i386 sparc sparc64
> 
> to:
> 
>    ExclusiveArch: i386 i486 i586 i686 sparc sparc64
> 
> In most cases, this allows it to rebuild fine.
> 
> However, I've run into about 15 RPMS so far that I haven't been able to
> rebuild.  Take anonftp for one.  Here is what the whole output from
> the rebuild process shows:
> 
>    /usr/src/redhat/SPECS: rpm -ba --target i686 anonftp.spec
>    Building target platforms: i686
>    Building for target i686
>    Executing: %prep
>    + umask 022
>    + cd /usr/src/redhat/BUILD
>    + rm -rf /var/tmp/anonftp-root
>    + exit 0
>    Executing: %install
>    + umask 022
>    + cd /usr/src/redhat/BUILD
>    + rm -rf /var/tmp/anonftp-root
>    + mkdir -p /var/tmp/anonftp-root/home/ftp
>    + mkdir -p /var/tmp/anonftp-root/home/ftp/pub
>    + mkdir -p /var/tmp/anonftp-root/home/ftp/etc
>    + mkdir -p /var/tmp/anonftp-root/home/ftp/bin
>    + mkdir -p /var/tmp/anonftp-root/home/ftp/lib
>    + cat
>    + cat
>    + cp -fd /etc/ld.so.cache /var/tmp/anonftp-root/home/ftp/etc
>    + cp -fd /lib/libc.so.6.1 /lib/libc-2.1.1.so
>    /var/tmp/anonftp-root/home/ftp/lib
>    cp: /lib/libc.so.6.1: No such file or directory
>    cp: /lib/libc-2.1.1.so: No such file or directory
>    Bad exit status from /var/tmp/rpm-tmp.77624 (%install)

Just guessing, but would say the SPEC file is amiss. I have
essentially these files, but are newer versions.

[hal@feenix hal]$ ll /lib/libc.so.6*
 lrwxrwxrwx   1 root     root    13 Oct 24 12:23 /lib/libc.so.6 -> libc-2.1.2.so*

[hal@feenix hal]$ ll /lib/libc-2.1.*
 -rwxr-xr-x   1 root     root    4118299 Sep 20 05:12 /lib/libc-2.1.2.so*


I would try editing the SPEC file.

[...]

-- 
Hal B
[EMAIL PROTECTED]
--
            Linux helps those who help themselves


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to