public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Joel Sherrill <joel@rtems.org>
To: Mikael Pettersson <mikpelinux@gmail.com>
Cc: newlib@sourceware.org
Subject: Re: [BUG] newlib-4.4.0 fails to build for m68k-elf
Date: Sun, 14 Jan 2024 09:59:57 -0600	[thread overview]
Message-ID: <CAF9ehCXsRX29f7UbYmw51quCLgO9Ht_MTcjukjv=NrnObZeZDQ@mail.gmail.com> (raw)
In-Reply-To: <20240114154727.2980243-1-mikpelinux@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2413 bytes --]

On Sun, Jan 14, 2024 at 9:47 AM Mikael Pettersson <mikpelinux@gmail.com>
wrote:

> 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);
>       |                         ^~~~
>

Per https://pubs.opengroup.org/onlinepubs/009604599/functions/read.html,
read() returns ssize_t. It looks like READ_WRITE_RETURN_TYPE should be
ssize_t.

--joel


> 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
>

      reply	other threads:[~2024-01-14 16:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-14 15:47 Mikael Pettersson
2024-01-14 15:59 ` Joel Sherrill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAF9ehCXsRX29f7UbYmw51quCLgO9Ht_MTcjukjv=NrnObZeZDQ@mail.gmail.com' \
    --to=joel@rtems.org \
    --cc=mikpelinux@gmail.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).