This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
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
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
7.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
:
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2001-02-26 17:59:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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
with
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
system
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:

FNM_CASEFOLD
FNM_FILE_NAME
FNM_LEADING_DIR
GLOB_BRACE
GLOB_NOMAGIC
GLOB_TILDE
GLOB_TILDE_CHECK
GLOB_ALTDIRFUNC
GLOB_ONLYDIR
GLOB_MAGCHAR
GLOB_NOMAGIC

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

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

In glob.h, remove the similar guard that protects the GLOB_ symbols
mentioned
above.
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
gotten
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.