aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2025-04-24 20:17:56 +1200
committerChris Packham <judge.packham@gmail.com>2025-04-26 15:07:33 +1200
commitf8e9c0adbcd55f6123ed5d0f1ecd0dccc951fc58 (patch)
tree9f2d27770cdd5e40b758579bc415bf95f709a21c
parentd08005a12937057b09808d2591ed20af99a60428 (diff)
downloadcrosstool-ng-f8e9c0adbcd55f6123ed5d0f1ecd0dccc951fc58.tar.gz
crosstool-ng-f8e9c0adbcd55f6123ed5d0f1ecd0dccc951fc58.tar.bz2
crosstool-ng-f8e9c0adbcd55f6123ed5d0f1ecd0dccc951fc58.zip
newlib: Add patch for powerpc errors
Add a patch to resolve some errors for powerpc-unknown-elf configurations. Submitted upstream as https://sourceware.org/pipermail/newlib/2025/021708.html Signed-off-by: Chris Packham <judge.packham@gmail.com>
-rw-r--r--packages/newlib/4.5.0.20241231/0000-libgloss-rs6000-Add-missing-function-prototypes.patch109
1 files changed, 109 insertions, 0 deletions
diff --git a/packages/newlib/4.5.0.20241231/0000-libgloss-rs6000-Add-missing-function-prototypes.patch b/packages/newlib/4.5.0.20241231/0000-libgloss-rs6000-Add-missing-function-prototypes.patch
new file mode 100644
index 00000000..45332ba7
--- /dev/null
+++ b/packages/newlib/4.5.0.20241231/0000-libgloss-rs6000-Add-missing-function-prototypes.patch
@@ -0,0 +1,109 @@
+From a4a94cf963d74970ec053dc7ecaddc9f2dc24f6d Mon Sep 17 00:00:00 2001
+From: Chris Packham <judge.packham@gmail.com>
+Date: Thu, 24 Apr 2025 17:31:36 +1200
+Subject: [PATCH] libgloss: rs6000: Add missing function prototypes
+
+With recent GCC changes that have elevated some warnings to error by
+default the rs6000 sim code errors out with:
+
+ libgloss/rs6000/sim-inbyte.c:22:7: error: implicit declaration of function 'read' [-Wimplicit-function-declaration]
+ libgloss/rs6000/sim-sbrk.c:26:7: error: implicit declaration of function 'brk'; did you mean 'sbrk'? [-Wimplicit-function-declaration]
+ libgloss/rs6000/sim-abort.c:19:3: error: implicit declaration of function 'write' [-Wimplicit-function-declaration]
+ libgloss/rs6000/sim-abort.c:20:3: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
+ libgloss/rs6000/sim-print.c:29:3: error: implicit declaration of function 'write' [-Wimplicit-function-declaration]
+ libgloss/rs6000/mvme-print.c:34:11: error: implicit declaration of function '__pcrlf' [-Wimplicit-function-declaration]
+ libgloss/rs6000/mvme-print.c:44:19: error: implicit declaration of function '__outln' [-Wimplicit-function-declaration]
+ libgloss/rs6000/mvme-print.c:53:15: error: implicit declaration of function '__outstr' [-Wimplicit-function-declaration]
+ libgloss/rs6000/mbx-print.c:29:3: error: implicit declaration of function 'write' [-Wimplicit-function-declaration]
+
+Add extern declarations to avoid the errors.
+---
+ libgloss/rs6000/mbx-print.c | 2 ++
+ libgloss/rs6000/mvme-print.c | 3 +++
+ libgloss/rs6000/sim-abort.c | 3 +++
+ libgloss/rs6000/sim-inbyte.c | 1 +
+ libgloss/rs6000/sim-print.c | 2 ++
+ libgloss/rs6000/sim-sbrk.c | 1 +
+ 6 files changed, 12 insertions(+)
+
+diff --git a/libgloss/rs6000/mbx-print.c b/libgloss/rs6000/mbx-print.c
+index 64472ee68..591ca2d3e 100644
+--- a/libgloss/rs6000/mbx-print.c
++++ b/libgloss/rs6000/mbx-print.c
+@@ -13,6 +13,8 @@
+ * they apply.
+ */
+
++extern int write(int fd, const void *buf, unsigned int count);
++
+ /*
+ * print -- do a raw print of a string
+ */
+diff --git a/libgloss/rs6000/mvme-print.c b/libgloss/rs6000/mvme-print.c
+index 8d195424e..d8f4c50d8 100644
+--- a/libgloss/rs6000/mvme-print.c
++++ b/libgloss/rs6000/mvme-print.c
+@@ -12,6 +12,9 @@
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
++extern void __pcrlf(void);
++extern void __outln(char *, char *);
++extern void __outstr(char *, char *);
+
+ /*
+ * write -- write some bytes to the output device.
+diff --git a/libgloss/rs6000/sim-abort.c b/libgloss/rs6000/sim-abort.c
+index e1b59cf19..931f886ed 100644
+--- a/libgloss/rs6000/sim-abort.c
++++ b/libgloss/rs6000/sim-abort.c
+@@ -14,6 +14,9 @@
+ * they apply.
+ */
+
++extern int write(int fd, const void *buf, unsigned int count);
++extern void exit(int status);
++
+ void abort(void)
+ {
+ write (2, "Abort called.\n", sizeof("Abort called.\n")-1);
+diff --git a/libgloss/rs6000/sim-inbyte.c b/libgloss/rs6000/sim-inbyte.c
+index 787b68976..fe1ac2a8b 100644
+--- a/libgloss/rs6000/sim-inbyte.c
++++ b/libgloss/rs6000/sim-inbyte.c
+@@ -13,6 +13,7 @@
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
++extern int read(int fd, void *buf, unsigned int count);
+
+ int
+ inbyte ()
+diff --git a/libgloss/rs6000/sim-print.c b/libgloss/rs6000/sim-print.c
+index c0b9adced..49596aff6 100644
+--- a/libgloss/rs6000/sim-print.c
++++ b/libgloss/rs6000/sim-print.c
+@@ -13,6 +13,8 @@
+ * they apply.
+ */
+
++extern int write(int fd, const void *buf, unsigned int count);
++
+ /*
+ * print -- do a raw print of a string
+ */
+diff --git a/libgloss/rs6000/sim-sbrk.c b/libgloss/rs6000/sim-sbrk.c
+index 5c8bd6522..0bbfe334b 100644
+--- a/libgloss/rs6000/sim-sbrk.c
++++ b/libgloss/rs6000/sim-sbrk.c
+@@ -13,6 +13,7 @@
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
++extern int brk(void *addr);
+
+ extern char _end[];
+ static char *curbrk = _end;
+--
+2.49.0
+