tech-pkg archive

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

Re: archivers/pax build failure on Linux



On Sun, 4 Aug 2024 15:24:56 +0200
Benny Siegert <bsiegert%gmail.com@localhost> wrote:

> Hi!
> 
> I have an exciting new bit of build breakage in archivers/pax. This is 
> on Fedora Asahi Linux with GCC 14.1.1.
> 
> cc -DHAVE_CONFIG_H -DHAVE_NBCOMPAT_H=1 
> -I/home/bsiegert/pkgsrc/archivers/pax/work/libnbcompat -I. -I. -O2 -c 
> getid.c
> getid.c: In function 'setup_getid':
> getid.c:156:13: error: implicit declaration of function 
> 'pwcache_groupdb' [-Wimplicit-function-declaration]
>    156 |         if (pwcache_groupdb(gi_setgroupent, gi_endgrent,
>        |             ^~~~~~~~~~~~~~~
> getid.c:158:16: error: implicit declaration of function 'pwcache_userdb' 
> [-Wimplicit-function-declaration]
>    158 |             || pwcache_userdb(gi_setpassent, gi_endpwent,
>        |                ^~~~~~~~~~~~~~
> *** [getid.o] Error code 1
> 
> The thing is, I don't understand how this is supposed to work. 
> libnbcompat provides implementations for the pwcache functions but no 
> header declaring them, as far as I can see. And pax uses the pwcache 
> functions unconditionally.
> 
> Can someone explain this to me?

This stems from GCC 14 being more strict about missing prototypes.
Fedora 40 has the same issue.
You will find quite a few more packages that are broken due to GCC 14.
(I have 20 or so local patches I need to commit.)

The attached patch should help with the issue mentioned, but it's
wrong so don't commit it with the linux ifdefs.
Index: files/lchflags.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/libnbcompat/files/lchflags.c,v
retrieving revision 1.4
diff -p -u -r1.4 lchflags.c
--- files/lchflags.c	29 Apr 2008 05:46:08 -0000	1.4
+++ files/lchflags.c	4 Aug 2024 15:00:00 -0000
@@ -36,6 +36,10 @@
 #include <nbcompat/stat.h>
 #include <nbcompat/unistd.h>
 
+#if defined(__linux__)
+int chflags(const char *, unsigned long int);
+#endif
+
 int
 lchflags(const char *path, unsigned long flags)
 {
Index: files/nbcompat.h
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/libnbcompat/files/nbcompat.h,v
retrieving revision 1.43
diff -p -u -r1.43 nbcompat.h
--- files/nbcompat.h	13 Apr 2009 11:30:46 -0000	1.43
+++ files/nbcompat.h	4 Aug 2024 15:00:00 -0000
@@ -132,3 +132,16 @@
 # undef HAVE_GETOPT_H
 # include <nbcompat/getopt.h>
 #endif
+
+#if defined(__linux__)
+
+     int
+     pwcache_groupdb(int (*setgroupent)(int), void (*endgrent)(void),
+         struct group * (*getgrnam)(const char *),
+         struct group * (*getgrgid)(gid_t));
+
+     int
+     pwcache_userdb(int (*setpassent)(int), void (*endpwent)(void),
+         struct passwd * (*getpwnam)(const char *),
+         struct passwd * (*getpwuid)(uid_t));
+#endif


Home | Main Index | Thread Index | Old Index