pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/40766: sysutls/mtree fails to build on Linux (with patch?)



>Number:         40766
>Category:       pkg
>Synopsis:       sysutls/mtree fails to build on Linux (with patch?)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 27 10:10:00 +0000 2009
>Originator:     Steven Drake
>Release:        pkgsrc-2008Q4
>Organization:
>Environment:
Linux localhost 2.6.28.3 #1 PREEMPT Wed Feb 4 21:54:53 NZDT 2009 i686 pentium4 
i386 GNU/Linux
GNU C Library stable release version 2.5, by Roland McGrath et al.

>Description:
mtree-20081105 fails to complie with gcc error's about undeclared variables in 
compare.c,create.c,stat_flags.c & verify.c
>How-To-Repeat:
[from inside work/mtree-20081105 after build failer]
make -i 
[output truncated]
gcc -DHAVE_CONFIG_H -DHAVE_NBCOMPAT_H=1 -I../libnbcompat -I. -I. -O2 -c 
compare.c
compare.c: In function 'compare':
compare.c:204: error: 'SF_IMMUTABLE' undeclared (first use in this function)
compare.c:204: error: (Each undeclared identifier is reported only once
compare.c:204: error: for each function it appears in.)
compare.c:204: error: 'SF_APPEND' undeclared (first use in this function)
compare.c:204: error: 'struct stat' has no member named 'st_flags'
compare.c:204: error: 'struct stat' has no member named 'st_flags'
compare.c:204: error: 'struct stat' has no member named 'st_flags'
compare.c:209: error: 'UF_NODUMP' undeclared (first use in this function)
compare.c:209: error: 'UF_IMMUTABLE' undeclared (first use in this function)
compare.c:209: error: 'UF_APPEND' undeclared (first use in this function)
compare.c:209: error: 'UF_OPAQUE' undeclared (first use in this function)
compare.c:209: error: 'UF_SETTABLE' undeclared (first use in this function)
compare.c:209: error: 'SF_ARCHIVED' undeclared (first use in this function)
compare.c:209: error: 'SF_SETTABLE' undeclared (first use in this function)
compare.c:209: error: 'struct stat' has no member named 'st_flags'
compare.c:209: error: 'struct stat' has no member named 'st_flags'
compare.c:209: error: 'struct stat' has no member named 'st_flags'
compare.c:364: error: 'struct stat' has no member named 'st_flags'
compare.c:366: error: 'struct stat' has no member named 'st_flags'
compare.c:371: error: 'struct stat' has no member named 'st_flags'
compare.c:375: error: 'struct stat' has no member named 'st_flags'
compare.c:375: error: 'struct stat' has no member named 'st_flags'
compare.c:377: error: 'struct stat' has no member named 'st_flags'
compare.c:377: error: 'struct stat' has no member named 'st_flags'
compare.c:379: error: 'struct stat' has no member named 'st_flags'
compare.c:379: error: 'struct stat' has no member named 'st_flags'
make: [compare.o] Error 1 (ignored)
gcc -DHAVE_CONFIG_H -DHAVE_NBCOMPAT_H=1 -I../libnbcompat -I. -I. -O2 -c create.c
create.c: In function 'statf':
create.c:247: warning: comparison between pointer and integer
create.c:254: warning: comparison between pointer and integer
create.c:261: warning: comparison between pointer and integer
create.c:268: warning: comparison between pointer and integer
create.c:273: warning: comparison between pointer and integer
create.c:278: warning: comparison between pointer and integer
create.c:287: error: 'struct stat' has no member named 'st_flags'
create.c:289: error: 'struct stat' has no member named 'st_flags'
create.c: In function 'statd':
create.c:326: error: 'UF_NODUMP' undeclared (first use in this function)
create.c:326: error: (Each undeclared identifier is reported only once
create.c:326: error: for each function it appears in.)
create.c:326: error: 'UF_IMMUTABLE' undeclared (first use in this function)
create.c:326: error: 'UF_APPEND' undeclared (first use in this function)
create.c:326: error: 'UF_OPAQUE' undeclared (first use in this function)
create.c:326: error: 'UF_SETTABLE' undeclared (first use in this function)
create.c:326: error: 'SF_ARCHIVED' undeclared (first use in this function)
create.c:326: error: 'SF_IMMUTABLE' undeclared (first use in this function)
create.c:326: error: 'SF_APPEND' undeclared (first use in this function)
create.c:326: error: 'SF_SETTABLE' undeclared (first use in this function)
create.c:363: error: 'struct stat' has no member named 'st_flags'
create.c:363: error: 'struct stat' has no member named 'st_flags'
create.c:365: error: 'struct stat' has no member named 'st_flags'
make: [create.o] Error 1 (ignored)
gcc -DHAVE_CONFIG_H -DHAVE_NBCOMPAT_H=1 -I../libnbcompat -I. -I. -O2 -c verify.c
verify.c: In function 'miss':
verify.c:308: error: 'SF_IMMUTABLE' undeclared (first use in this function)
verify.c:308: error: (Each undeclared identifier is reported only once
verify.c:308: error: for each function it appears in.)
verify.c:308: error: 'SF_APPEND' undeclared (first use in this function)
make: [verify.o] Error 1 (ignored)
gcc -DHAVE_CONFIG_H -DHAVE_NBCOMPAT_H=1 -I../libnbcompat -I. -I. -O2 -c stat_fla
gs.c
stat_flags.c: In function 'flags_to_string':
stat_flags.c:92: error: 'UF_APPEND' undeclared (first use in this function)
stat_flags.c:92: error: (Each undeclared identifier is reported only once
stat_flags.c:92: error: for each function it appears in.)
stat_flags.c:94: error: 'UF_IMMUTABLE' undeclared (first use in this function)
stat_flags.c:96: error: 'UF_NODUMP' undeclared (first use in this function)
stat_flags.c:98: error: 'UF_OPAQUE' undeclared (first use in this function)
stat_flags.c:100: error: 'SF_APPEND' undeclared (first use in this function)
stat_flags.c:102: error: 'SF_ARCHIVED' undeclared (first use in this function)
stat_flags.c:104: error: 'SF_IMMUTABLE' undeclared (first use in this 
function)stat_flags.c: In function 'string_to_flags':
stat_flags.c:163: error: 'SF_ARCHIVED' undeclared (first use in this function)
stat_flags.c:168: error: 'UF_NODUMP' undeclared (first use in this function)
stat_flags.c:178: error: 'UF_OPAQUE' undeclared (first use in this function)
stat_flags.c:181: error: 'SF_APPEND' undeclared (first use in this function)
stat_flags.c:183: error: 'SF_IMMUTABLE' undeclared (first use in this function)
stat_flags.c:188: error: 'UF_APPEND' undeclared (first use in this function)
stat_flags.c:190: error: 'UF_IMMUTABLE' undeclared (first use in this function)
make: [stat_flags.o] Error 1 (ignored)



>Fix:
It seams between mtree-20070710 (know to compile on this system) and 
mtree-20081105 some cpp if's where changed from HAVE_FILE_FLAGS to 
HAVE_STRUCT_STAT_ST_FLAGS (HAVE_STRUCT_STAT_ST_FLAGS is defined in extern.h). 
A fix would be to change them back.
The patches below fix this problem.

$NetBSD$

--- compare.c.orig      2009-02-27 19:10:38.000000000 +1300
+++ compare.c
@@ -198,7 +198,7 @@ typeerr:            LABEL;
        }
        if (mtree_Wflag)
                goto afterpermwhack;
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
        if (iflag && !uflag) {
                if (s->flags & F_FLAGS)
                    SETFLAGS(p->fts_statp->st_flags, SP_FLGS);
@@ -354,7 +354,7 @@ typeerr:            LABEL;
                        tab = "\t";
                }
        }
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
        /*
         * XXX
         * since lchflags(2) will reset file times, the utimes() above
$NetBSD$

--- create.c.orig       2009-02-27 19:10:38.000000000 +1300
+++ create.c
@@ -283,7 +283,7 @@ statf(FTSENT *p)
        if (keys & F_SLINK &&
            (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE))
                output(&indent, "link=%s", vispath(rlink(p->fts_accpath)));
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
        if (keys & F_FLAGS && p->fts_statp->st_flags != flags)
                output(&indent, "flags=%s",
                    flags_to_string(p->fts_statp->st_flags, "none"));
@@ -300,7 +300,7 @@ statf(FTSENT *p)
 #define        MTREE_MAXGID    5000
 #define        MTREE_MAXUID    5000
 #define        MTREE_MAXMODE   (MBITS + 1)
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
 #define        MTREE_MAXFLAGS  (FLAGS2INDEX(CH_MASK) + 1)   /* 1808 */
 #else
 #define MTREE_MAXFLAGS 1
@@ -359,7 +359,7 @@ statd(FTS *t, FTSENT *parent, uid_t *pui
                        maxuid = u[suid];
                }
 
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
                sflags = FLAGS2INDEX(p->fts_statp->st_flags);
                if (sflags < MTREE_MAXFLAGS && ++f[sflags] > maxflags) {
                        saveflags = p->fts_statp->st_flags;
$NetBSD$

--- stat_flags.c.orig   2009-02-27 19:10:38.000000000 +1300
+++ stat_flags.c
@@ -88,7 +88,7 @@ flags_to_string(u_long flags, const char
 
        string[0] = '\0';
        prefix = NULL;
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
        if (flags & UF_APPEND)
                SAPPEND("uappnd");
        if (flags & UF_IMMUTABLE)
@@ -147,7 +147,7 @@ string_to_flags(char **stringp, u_long *
        if (clrp)
                *clrp = 0;
 
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
        string = *stringp;
        while ((p = strsep(&string, "\t ,")) != NULL) {
                clear = 0;
$NetBSD$

--- verify.c.orig       2009-02-27 19:10:38.000000000 +1300
+++ verify.c
@@ -300,7 +300,7 @@ miss(NODE *p, char *tail)
                                printf("%s: permissions not set: %s\n",
                                    path, strerror(errno));
                }
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
                if ((p->flags & F_FLAGS) && p->st_flags) {
                        if (iflag)
                                flags = p->st_flags;



Home | Main Index | Thread Index | Old Index