Thanks for mentioning that. Sorry, I was a bit too clever with fchmodat etc. I reproduced the problem on Fedora 17 when building with CFLAGS=-g, and fixed it as follows.
--- ChangeLog | 15 +++++++++++++++ lib/chmodat.c | 3 +++ lib/chownat.c | 3 +++ lib/fchmodat.c | 2 -- lib/fchownat.c | 2 -- lib/fstatat.c | 2 -- lib/statat.c | 3 +++ modules/fchmodat | 2 ++ modules/fchownat | 2 ++ modules/fstatat | 2 ++ 10 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 lib/chmodat.c create mode 100644 lib/chownat.c create mode 100644 lib/statat.c diff --git a/ChangeLog b/ChangeLog index ac74fdb..fca0234 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2012-10-15 Paul Eggert <egg...@cs.ucla.edu> + + fchmodat, fchownat, fstatat: port to non-inlining compilers + Problem reported for FreeBSD 9 by Jim Meyering in + <http://lists.gnu.org/archive/html/bug-gnulib/2012-10/msg00070.html>. + * lib/chmodat.c, lib/chownat.c, lib/statat.c: + New files, which define FCHMODAT_INLINE etc. + * lib/fchmodat.c (FCHMODAT_INLINE): + * lib/fchownat.c (FCHOWNAT_INLINE): + * lib/fstatat.c (FSTATAT_INLINE): + Remove, as chmodat.c etc. now do this. + * modules/fchmodat (Files): Add lib/chmodat.c. + * modules/fchownat (Files): Add lib/chownat.c. + * modules/fstatat (Files): Add lib/statat.c. + 2012-10-15 Jim Meyering <j...@meyering.net> fchmodat.c, fchownat.c: compile-impeding typos diff --git a/lib/chmodat.c b/lib/chmodat.c new file mode 100644 index 0000000..3c69689 --- /dev/null +++ b/lib/chmodat.c @@ -0,0 +1,3 @@ +#include <config.h> +#define FCHMODAT_INLINE _GL_EXTERN_INLINE +#include "openat.h" diff --git a/lib/chownat.c b/lib/chownat.c new file mode 100644 index 0000000..3937f9c --- /dev/null +++ b/lib/chownat.c @@ -0,0 +1,3 @@ +#include <config.h> +#define FCHOWNAT_INLINE _GL_EXTERN_INLINE +#include "openat.h" diff --git a/lib/fchmodat.c b/lib/fchmodat.c index 8612cd4..ce848fd 100644 --- a/lib/fchmodat.c +++ b/lib/fchmodat.c @@ -18,8 +18,6 @@ #include <config.h> -#define FCHMODAT_INLINE _GL_EXTERN_INLINE - #include <sys/stat.h> #include <errno.h> diff --git a/lib/fchownat.c b/lib/fchownat.c index 72bad1b..4f6a44d 100644 --- a/lib/fchownat.c +++ b/lib/fchownat.c @@ -23,8 +23,6 @@ #include <config.h> -#define FCHOWNAT_INLINE _GL_EXTERN_INLINE - #include <unistd.h> #include <errno.h> diff --git a/lib/fstatat.c b/lib/fstatat.c index 71b04d5..5b097fc 100644 --- a/lib/fstatat.c +++ b/lib/fstatat.c @@ -23,8 +23,6 @@ #define __need_system_sys_stat_h #include <config.h> -#define FSTATAT_INLINE _GL_EXTERN_INLINE - /* Get the original definition of fstatat. It might be defined as a macro. */ #include <sys/types.h> #include <sys/stat.h> diff --git a/lib/statat.c b/lib/statat.c new file mode 100644 index 0000000..28e21fe --- /dev/null +++ b/lib/statat.c @@ -0,0 +1,3 @@ +#include <config.h> +#define FSTATAT_INLINE _GL_EXTERN_INLINE +#include "openat.h" diff --git a/modules/fchmodat b/modules/fchmodat index 44cc919..7a5e1a6 100644 --- a/modules/fchmodat +++ b/modules/fchmodat @@ -3,6 +3,7 @@ fchmodat() function: Change access permissions of a file at a directory. Files: lib/fchmodat.c +lib/chmodat.c lib/at-func.c m4/fchmodat.m4 @@ -28,6 +29,7 @@ gl_MODULE_INDICATOR([fchmodat]) dnl for lib/openat.h gl_SYS_STAT_MODULE_INDICATOR([fchmodat]) Makefile.am: +lib_SOURCES += chmodat.c Include: <sys/stat.h> diff --git a/modules/fchownat b/modules/fchownat index 0b16be8..385f38d 100644 --- a/modules/fchownat +++ b/modules/fchownat @@ -3,6 +3,7 @@ fchownat() function: Change the owner of a file at a directory. Files: lib/fchownat.c +lib/chownat.c lib/at-func.c m4/fchownat.m4 @@ -30,6 +31,7 @@ gl_MODULE_INDICATOR([fchownat]) dnl for lib/openat.h gl_UNISTD_MODULE_INDICATOR([fchownat]) Makefile.am: +lib_SOURCES += chownat.c Include: <unistd.h> diff --git a/modules/fstatat b/modules/fstatat index 9b260d4..7aa99b8 100644 --- a/modules/fstatat +++ b/modules/fstatat @@ -3,6 +3,7 @@ fstatat() function: Return information about a file at a directory. Files: lib/fstatat.c +lib/statat.c lib/at-func.c m4/fstatat.m4 m4/lstat.m4 @@ -30,6 +31,7 @@ gl_MODULE_INDICATOR([fstatat]) dnl for lib/openat.h gl_SYS_STAT_MODULE_INDICATOR([fstatat]) Makefile.am: +lib_SOURCES += statat.c Include: <sys/stat.h> -- 1.7.11.7