Buildroot Archive mirror
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Subject: [Buildroot] [git commit] package/newlib-bare-metal: add patch for gcc 14.1.0
Date: Mon, 13 May 2024 21:50:07 +0200	[thread overview]
Message-ID: <20240513195730.D5D0887131@busybox.osuosl.org> (raw)

commit: https://git.buildroot.net/buildroot/commit/?id=b55d22f822d179ba25b630b50e98e6eeaffbdcfe
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

This patch is needed for building newlib with gcc 14.1.0.  Without this patch,
the following build error will occur:

../../.././libgloss/microblaze/linux-outbyte.c: In function 'outbyte':
../../.././libgloss/microblaze/linux-outbyte.c:3:9: error: implicit declaration of function '_write' [-Wimplicit-function-declaration]
    3 |         _write(1, &c, 1);

This patch has been submitted upstream:
https://patchwork.sourceware.org/project/newlib/patch/20240513062419.2042278-1-neal.frager@amd.com/

Signed-off-by: Neal Frager <neal.frager@amd.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 ...-microblaze-fix-read-and-_write-declarati.patch | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/package/newlib-bare-metal/0001-libgloss-microblaze-fix-read-and-_write-declarati.patch b/package/newlib-bare-metal/0001-libgloss-microblaze-fix-read-and-_write-declarati.patch
new file mode 100644
index 0000000000..5eacfd3270
--- /dev/null
+++ b/package/newlib-bare-metal/0001-libgloss-microblaze-fix-read-and-_write-declarati.patch
@@ -0,0 +1,40 @@
+From 1ebecb83607e9c0cc44ad1e518169ae03c0f2d26 Mon Sep 17 00:00:00 2001
+From: Neal Frager <neal.frager@amd.com>
+Date: Mon, 13 May 2024 07:22:47 +0100
+Subject: [PATCH] libgloss: microblaze: fix read and _write declarations
+
+This patch resolves the following build error which occurs with gcc 14.1.0:
+../../.././libgloss/microblaze/linux-outbyte.c: In function 'outbyte':
+../../.././libgloss/microblaze/linux-outbyte.c:3:9: error: implicit declaration of function '_write' [-Wimplicit-function-declaration]
+    3 |         _write(1, &c, 1);
+
+Signed-off-by: Neal Frager <neal.frager@amd.com>
+Upstream: https://patchwork.sourceware.org/project/newlib/patch/20240513062419.2042278-1-neal.frager@amd.com/
+---
+ libgloss/microblaze/linux-inbyte.c  | 2 ++
+ libgloss/microblaze/linux-outbyte.c | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/libgloss/microblaze/linux-inbyte.c b/libgloss/microblaze/linux-inbyte.c
+index 58fdf1957..2f8d33871 100644
+--- a/libgloss/microblaze/linux-inbyte.c
++++ b/libgloss/microblaze/linux-inbyte.c
+@@ -1,3 +1,5 @@
++extern int read (int, char *, int);
++
+ int inbyte(void)
+ {
+ 	char ch = 0;
+diff --git a/libgloss/microblaze/linux-outbyte.c b/libgloss/microblaze/linux-outbyte.c
+index 9d7bc4890..46de511f6 100644
+--- a/libgloss/microblaze/linux-outbyte.c
++++ b/libgloss/microblaze/linux-outbyte.c
+@@ -1,3 +1,5 @@
++extern int _write (int, char *, int);
++
+ void outbyte (unsigned char c)
+ {
+ 	_write(1, &c, 1);
+-- 
+2.25.1
+
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

                 reply	other threads:[~2024-05-13 19:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240513195730.D5D0887131@busybox.osuosl.org \
    --to=buildroot@buildroot.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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).