Bug 29526 - rpm 4.0.2 build problem on alpha-dec-osf and elsewhere
Summary: rpm 4.0.2 build problem on alpha-dec-osf and elsewhere
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-02-26 07:17 UTC by Red Hat Bugzilla
Modified: 2008-03-13 19:18 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-02-26 22:59:59 UTC
Embargoed:


Attachments (Terms of Use)

Description Red Hat Bugzilla 2001-02-26 07:17:58 UTC
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 13:55:17 UTC
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 22:59:54 UTC
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.