Bug 32437

Summary: rpm 4.0.2 odd build problems in tools directory
Product: [Retired] Red Hat Linux Reporter: Red Hat Bugzilla <bugzilla>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: sparc   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-03-21 13:57:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Red Hat Bugzilla 2001-03-20 21:44:44 UTC
When building rpm 4.0.2 on our sparc-sun-solaris2.8 build machine, when
it gets to the tools directory, and the `dump' executable, I see the
following:

/bin/sh ../libtool --mode=link cc  -g  -o dump  dump.o
../build/librpmbuild.la ../lib/librpm.la         ../rpmio/librpmio.la   
../popt/libpopt.la       -L/usr/ucblib -R/usr/ucblib  -lnsl -lsocket -lz
-lbz2
cc -g -o dump dump.o ../build/.libs/librpmbuild.a ../lib/.libs/librpm.a
-ldb -lpthread ../rpmio/.libs/librpmio.a -L/usr/ucblib -lnsl -lsocket -lz
-lbz2 ../popt/.libs/libpopt.a -L/local/BerkeleyDB/lib -L/local/lib
-L/usr/ucblib -lnsl -lsocket -lz -lbz2 -R/usr/ucblib -R/usr/ucblib
ild: (argument error) can't find library argument :: -ldb
make: *** [dump] Error 8


The problem is that the LDFLAGS, which contains `-L/local/BerkeleyDB/lib',
doesn't precede the `-ldb -lpthread' on the line.

That should in theory be easy to fix, but after looking at tools/Makefile
for a while, I'm really puzzled.  Nowhere in the Makefile is
'-L/local/BerkeleyDB/lib'
even mentioned.

Also, I see a section like this:

libdb1 = 
libdb2 = 
libdb3 = -ldb -lpthread

But `libdb3' and `-ldb' aren't mentioned anywhere else in the Makefile, so
I don't see how that's making it onto the link line shown above.

I also notice that `LIBS' is being substituted into all the other Makefiles
in every subdirectory, but it's not being substituted into tools/Makefile.

At this point, I'm at a loss to explain how the tools/Makefile is working
at
all.

Comment 1 Red Hat Bugzilla 2001-03-20 22:01:04 UTC
After looking some more, I see the the

	-L/local/BerkeleyDB/lib

is coming because of what's recorded in libpopt.la, which is being linked in.

the problem is that it's too far down the link line to do any good for the
problem at hand.

Is there a reason why both LDFLAGS and LIBS are purposely not substituted into
tools/Makefile?

Comment 2 Red Hat Bugzilla 2001-03-20 22:48:53 UTC
this is not a wolverine / Red Hat Linux problem.


Comment 3 Red Hat Bugzilla 2001-07-25 21:07:18 UTC
AFAIK, using an internal version of Berkeley DB should "fix" this problem.
Otherwise, please reopen this bug.