fakechroot icon indicating copy to clipboard operation
fakechroot copied to clipboard

glibc 2.37 FTBFS on armhf with error: conflicting types for ‘fts64_open’; have ‘FTS64...

Open josch opened this issue 2 months ago • 1 comments

On Debian unstable armhf and glibc 2.37 I get this build failure:

/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -MT fts64.lo -MD -MP -MF .deps/fts64.Tpo -c -o fts64.lo fts64.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -MT fts64.lo -MD -MP -MF .deps/fts64.Tpo -c fts64.c  -fPIC -DPIC -o .libs/fts64.o
fts64.c:20:18: error: conflicting types for ‘fts64_open’; have ‘FTS64 *(char * const*, int,  int (*)(const FTSENT64 **, const FTSENT64 **))’ {aka ‘FTS64 *(char * const*, int,  int (*)(const struct _ftsent64 **, const struct _ftsent64 **))’}
   20 | #define FTS_OPEN fts64_open
      |                  ^~~~~~~~~~
fts.c:129:1: note: in expansion of macro ‘FTS_OPEN’
  129 | FTS_OPEN(char * const *argv, int options,
      | ^~~~~~~~
In file included from /usr/include/features.h:490,
                 from /usr/include/arm-linux-gnueabihf/sys/types.h:25,
                 from /usr/include/arm-linux-gnueabihf/sys/param.h:25,
                 from fts.c:42,
                 from fts64.c:33:
/usr/include/fts.h:231:10: note: previous declaration of ‘fts64_open’ with type ‘FTS *(char * const*, int,  int (*)(const FTSENT64 **, const FTSENT64 **))’ {aka ‘FTS *(char * const*, int,  int (*)(const struct _ftsent64 **, const struct _ftsent64 **))’}
  231 | FTS     *__REDIRECT (fts64_open, (char * const *, int,
      |          ^~~~~~~~~~
fts64.c:22:18: error: conflicting types for ‘fts64_read’; have ‘FTSENT64 *(FTS64 *)’ {aka ‘struct _ftsent64 *(FTS64 *)’}
   22 | #define FTS_READ fts64_read
      |                  ^~~~~~~~~~
fts.c:317:1: note: in expansion of macro ‘FTS_READ’
  317 | FTS_READ(FTSOBJ *sp)
      | ^~~~~~~~
/usr/include/fts.h:234:10: note: previous declaration of ‘fts64_read’ with type ‘FTSENT *(FTS64 *)’ {aka ‘struct _ftsent *(FTS64 *)’}
  234 | FTSENT  *__REDIRECT (fts64_read, (FTS64 *), __fts64_read_time64);
      |          ^~~~~~~~~~
fts64.c:24:22: error: conflicting types for ‘fts64_children’; have ‘FTSENT64 *(FTS64 *, int)’ {aka ‘struct _ftsent64 *(FTS64 *, int)’}
   24 | #define FTS_CHILDREN fts64_children
      |                      ^~~~~~~~~~~~~~
fts.c:527:1: note: in expansion of macro ‘FTS_CHILDREN’
  527 | FTS_CHILDREN(FTSOBJ *sp, int instr)
      | ^~~~~~~~~~~~
/usr/include/fts.h:229:10: note: previous declaration of ‘fts64_children’ with type ‘FTSENT *(FTS64 *, int)’ {aka ‘struct _ftsent *(FTS64 *, int)’}
  229 | FTSENT  *__REDIRECT (fts64_children, (FTS64 *, int), __fts64_children_time64);
      |          ^~~~~~~~~~

This does not affect arm64, for example.

josch avatar Apr 13 '24 10:04 josch

You can fix this by building fakechroot with _TIME_BITS and _FILE_OFFSET_BITS unset in CPPFLAGS which are both set by default in gcc from Debian.

josch avatar Apr 14 '24 16:04 josch