[BUG] newlib-4.4.0 fails to build for m68k-elf

Mikael Pettersson <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Building newlib-4.4.0 for m68k-unknown-elf fails with

m68k-unknown-elf-gcc -B/tmp/objdir/m68k-unknown-elf/newlib/ -isystem /tmp/objdir/m68k-unknown-elf/newlib/targ-include -isystem /tmp/newlib-4.4.0.20231231/newlib/libc/include -B/tmp/objdir/m68k-unknown-elf/libgloss/m68k -L/tmp/objdir/m68k-unknown-elf/libgloss/libnosys -L/tmp/newlib-4.4.0.20231231/libgloss/m68k    -g -O2 -O2 -I. -I/tmp/newlib-4.4.0.20231231/libgloss/m68k/.. -I./.. -idirafter /tmp/newlib-4.4.0.20231231/libgloss/m68k/../../include -c -g -O2 /tmp/newlib-4.4.0.20231231/libgloss/m68k/../read.c
/tmp/newlib-4.4.0.20231231/libgloss/m68k/../read.c:24:1: error: conflicting types for 'read'; have 'int(int,  void *, size_t)' {aka 'int(int,  void *, long unsigned int)'}
   24 | read (int fd,
      | ^~~~
In file included from /tmp/newlib-4.4.0.20231231/newlib/libc/include/unistd.h:4,
                 from /tmp/newlib-4.4.0.20231231/libgloss/m68k/../glue.h:16,
                 from /tmp/newlib-4.4.0.20231231/libgloss/m68k/../read.c:15:
/tmp/newlib-4.4.0.20231231/newlib/libc/include/sys/unistd.h:179:25: note: previous declaration of 'read' with type '_ssize_t(int,  void *, size_t)' {aka 'long int(int,  void *, long unsigned int)'}
  179 | _READ_WRITE_RETURN_TYPE read (int __fd, void *__buf, size_t __nbyte);
      |                         ^~~~
make[4]: *** [Makefile:528: read.o] Error 1
make[4]: Leaving directory '/tmp/objdir/m68k-unknown-elf/libgloss/m68k'
make[3]: *** [Makefile:4954: all-recursive] Error 1
make[3]: Leaving directory '/tmp/objdir/m68k-unknown-elf/libgloss'
make[2]: *** [Makefile:1225: all] Error 2
make[2]: Leaving directory '/tmp/objdir/m68k-unknown-elf/libgloss'
make[1]: *** [Makefile:9528: all-target-libgloss] Error 2
make[1]: Leaving directory '/tmp/objdir'
make: *** [Makefile:879: all] Error 2

Toolchain built from binutils-2.41 and gcc-13.2.0.

newlib-4.3.0 built fine, the issue started with:

# first new commit: [3d10b04f1ed9bf53c282081c88165951e8c32cec] Fix various c99/gcc-14 issues in generic libgloss code
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.