Bug 5583

Summary: rpm fixes for non-linux platforms...
Product: [Retired] Red Hat Linux Reporter: Nigel Metheringham <nigel.metheringham>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
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: 1999-12-15 18:09:03 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 Nigel Metheringham 1999-10-05 14:57:28 UTC
[Not really a RH 6.1 issue, but its the version of rpm that
ships in 6.1]

Recent changes to rpm have made a few parts rather dependant
on the glibc libraries.  Specifically misc/err.c is glibc
dependant - it includes features.h which is a glibc-ism and
uses some functions form it as well...

Some of the functions which are glibc specific are
reimplemented in libmisc.a.  However libmisc.a is not linked
into the majority of programs.  The following patch (at end)
to fix this should be OK on all architectures including RH
linux iteself (since then libmisc is created but empty).

Additionally for solaris I faked up a misc/features.h with
the following contents (its a hack, but it works)

--- start features.h---
#define __P(x) x
#define __BEGIN_DECLS
#define __END_DECLS
#define fputs_unlocked(x,y)     fputs(x,y)
#define __set_errno(x)          errno=x
static char * __progname = "rpm";
--- end features.h---

#### Patch data follows ####
diff -c 'BUILD/rpm-3.0.3.orig/Makefile.in'
'BUILD/rpm-3.0.3/Makefile.in'
Index: ./Makefile.in
*** ./Makefile.in	Sun Sep 26 01:44:56 1999
--- ./Makefile.in	Tue Oct  5 12:58:57 1999
***************
*** 183,189 ****
  CVSTAG = r$(subst .,-,$(VERSION))

  rpm2cpio_SOURCES = rpm2cpio.c
! rpm2cpio_LDADD = $(mylibs)

  rpmconvert_SOURCES = convertdb.c oldrpmdb.c
  rpmconvert_LDADD = $(mylibs) @LIBMISC@ -lgdbm
--- 183,189 ----
  CVSTAG = r$(subst .,-,$(VERSION))

  rpm2cpio_SOURCES = rpm2cpio.c
! rpm2cpio_LDADD = $(mylibs) @LIBMISC@

  rpmconvert_SOURCES = convertdb.c oldrpmdb.c
  rpmconvert_LDADD = $(mylibs) @LIBMISC@ -lgdbm
diff -c 'BUILD/rpm-3.0.3.orig/tools/Makefile.in'
'BUILD/rpm-3.0.3/tools/Makefile.in'
Index: ./tools/Makefile.in
*** ./tools/Makefile.in	Sun Sep 26 01:45:10 1999
--- ./tools/Makefile.in	Tue Oct  5 12:57:56 1999
***************
*** 153,159 ****
  mylibs = $(top_builddir)/build/.libs/librpmbuild.a
$(top_builddir)/lib/.libs/librpm.a
$(top_builddir)/popt/.libs/libpopt.a


! LDADD = $(top_builddir)/lib/.libs/librpm.a

  noinst_PROGRAMS =  	dump dumpdb javadeps rpmarchive
rpmheader rpminject rpmlead rpmsignature

--- 153,159 ----
  mylibs = $(top_builddir)/build/.libs/librpmbuild.a
$(top_builddir)/lib/.libs/librpm.a
$(top_builddir)/popt/.libs/libpopt.a


! LDADD = $(top_builddir)/lib/.libs/librpm.a @LIBMISC@

  noinst_PROGRAMS =  	dump dumpdb javadeps rpmarchive
rpmheader rpminject rpmlead rpmsignature

#### End of Patch data ####

Comment 1 Jeff Johnson 1999-10-05 15:34:59 UTC
Thanks for the patch, I will add during the rpm-3.0.4 development
cycle. For rpm-3.0.3, I chickened out and removed all dependencies on
err.h until I had a chance to think through what you have done in your
patch.

Comment 2 Jeff Johnson 1999-12-15 18:09:59 UTC
rpm-3.0.4 does not use/need err.c. In addition, most of the libmisc portability
functions, if needed, are now included in rpmlib (see lib/stubs.c) to avoid
tedious shared library dependency issues when linking against rpmlib.