Bug 29526 - rpm 4.0.2 build problem on alpha-dec-osf and elsewhere
rpm 4.0.2 build problem on alpha-dec-osf and elsewhere
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-02-26 02:17 EST by Red Hat Bugzilla
Modified: 2008-03-13 15:18 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-02-26 17:59:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Red Hat Bugzilla 2001-02-26 02:17:58 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.72 [en] (X11; U; OSF1 V5.0 alpha)

rpm 4.0.2 fails to build on alpha-dec-osf, and I'm guessing the same will
be true
on at least HP-UX and IRIX, possibly elsewhere.

The problem is that configure correctly determines that the included
glob/fnmatch is
needed, but the glob.h and fnmatch.h protect some of the needed constants
tests against _POSIX_C_SOURCE and other symbols.  There's no way to satisfy
the protections in those two header files and still get functions, defines,
etc. that
are needed by the rest of RPM.

It's really the "guards" that are at fault, and this problem is seen on
these platforms
for every package that uses GNU fnmatch (i.e. a lot of packages).

My recommendation would be that since configure has already determined that
the misc/fnmatch.c and misc/glob.c are going to be used instead of the
fnmatch/glob routines, there's no good reason to protect the various
symbols in
fnmatch.h and glob.h -- we need them, and we've decided we want the GNU
extended routines, not POSIX conformant fnmatch()/glob().

Reproducible: Always
Steps to Reproduce:
./configure; make

on alpha-dec-osf (and I'm betting elsewhere)

Actual Results:  Errors because of undeclared symbols:


In fnmatch.h, I would just remove the guard:

#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE

In glob.h, remove the similar guard that protects the GLOB_ symbols
Comment 1 Red Hat Bugzilla 2001-02-26 08:55:17 EST
Hi Tim!

What happens if you add -D_GNU_SOURCE to the compile? That is, in fact , the
intent of the guards, and the internalization of GNU glob, etc. and so should be
added to your CFLAGS.
Comment 2 Red Hat Bugzilla 2001-02-26 17:59:54 EST
That does indeed work, and doesn't appear to cause problems elsewhere (I haven't
through the entire source yet because of another problem I'll be reporting in a
bit with db3
header finding).

Adding -D_GNU_SOURCE is a little unintuitive to me, but it's a reasonable
workaround for the
problem.  I'll continue to test 4.0.2 and try testing on HP-UX and IRIX too.  I
may submit a patch
for the README, so that others don't stumble in the same place I did.

Note You need to log in before you can comment on or make changes to this bug.