public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: "Torbjörn SVENSSON" <torbjorn.svensson@foss.st.com>
To: <newlib@sourceware.org>
Cc: Richard.Earnshaw@arm.com,
	"Torbjörn SVENSSON" <torbjorn.svensson@foss.st.com>,
	"Yvan ROUX" <yvan.roux@foss.st.com>
Subject: [PATCH] libc/stdio: Remove wchar_t functions from NEWLIB_NANO_FORMATTED_IO
Date: Fri, 23 Feb 2024 16:31:12 +0100	[thread overview]
Message-ID: <20240223153111.3265858-1-torbjorn.svensson@foss.st.com> (raw)
In-Reply-To: <bfb6dc60-4b68-4ef1-872c-803b60d19bb5@arm.com>


When I regtested this, I used the official Ubuntu 20.04 package of
automake 1.15. When generating the Makefile.in, I do see a few entries
that I did not expect, so therfore I would like someone with the right
versions to generate the Makefile.in and submit this for me.

The alternative approach to this patch is to figure out what functions
(in addition to __ssputws_r) that is also needed in nano formatted io.

--

Regression tested in basepoints/gcc-14-9032-g945cb8490cb with arm-none-eabi.

Example failure without this change:
$ arm-none-eabi-g++ .../pr100611.C -std=c++20 --specs=nosys.specs -o /dev/null --specs=nano.specs
.../ld: .../libc_nano.a(libc_a-svfwprintf.o): in function `_svfwprintf_r':
(.text._svfwprintf_r+0xd8): undefined reference to `__ssputws_r'
.../ld: (.text._svfwprintf_r+0x834): undefined reference to `__ssputws_r'
.../ld: (.text._svfwprintf_r+0x85c): undefined reference to `__ssputws_r'
.../ld: (.text._svfwprintf_r+0x8a8): undefined reference to `__ssputws_r'
.../ld: (.text._svfwprintf_r+0x8dc): undefined reference to `__ssputws_r'
.../ld: .../libc_nano.a(libc_a-svfwprintf.o):(.text._svfwprintf_r+0x900): more undefined references to `__ssputws_r' follow
collect2: error: ld returned 1 exit status

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Co-authored-by: Yvan ROUX <yvan.roux@foss.st.com>
---
 newlib/libc/stdio/Makefile.inc | 52 +++++++++++++++++-----------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/newlib/libc/stdio/Makefile.inc b/newlib/libc/stdio/Makefile.inc
index e25680212..ce298e5cb 100644
--- a/newlib/libc/stdio/Makefile.inc
+++ b/newlib/libc/stdio/Makefile.inc
@@ -41,7 +41,14 @@ libc_a_SOURCES += \
 	%D%/ssputs_r.c \
 	%D%/ssputws_r.c \
 	%D%/ssprint_r.c \
-	%D%/sswprint_r.c
+	%D%/sswprint_r.c \
+	%D%/svfiwprintf.c \
+	%D%/svfiwscanf.c \
+	%D%/svfwprintf.c \
+	%D%/svfwscanf.c \
+	%D%/vfiwprintf.c \
+	%D%/vfiwscanf.c \
+	%D%/vfwscanf.c
 endif
 
 libc_a_SOURCES += \
@@ -100,17 +107,10 @@ libc_a_SOURCES += \
 	%D%/sprintf.c \
 	%D%/sscanf.c \
 	%D%/stdio.c \
-	%D%/svfiwprintf.c \
-	%D%/svfiwscanf.c \
-	%D%/svfwprintf.c \
-	%D%/svfwscanf.c \
 	%D%/tmpfile.c \
 	%D%/tmpnam.c \
 	%D%/ungetc.c \
 	%D%/vdprintf.c \
-	%D%/vfiwprintf.c \
-	%D%/vfiwscanf.c \
-	%D%/vfwscanf.c \
 	%D%/vprintf.c \
 	%D%/vscanf.c \
 	%D%/vsnprintf.c \
@@ -127,13 +127,13 @@ if !ELIX_LEVEL_1
 	%D%/fcloseall.c \
 	%D%/fseeko.c \
 	%D%/ftello.c \
-	%D%/getw.c \
 	%D%/mktemp.c \
-	%D%/putw.c \
 	%D%/vasprintf.c
 if !NEWLIB_NANO_FORMATTED_IO
 %C%_ELIX_2_SOURCES += \
 	%D%/asiprintf.c \
+	%D%/getw.c \
+	%D%/putw.c \
 	%D%/vasiprintf.c
 endif !NEWLIB_NANO_FORMATTED_IO
 endif !ELIX_LEVEL_1
@@ -157,52 +157,52 @@ else
 	%D%/fflush_u.c \
 	%D%/fgetc_u.c \
 	%D%/fgets_u.c \
-	%D%/fgetwc.c \
-	%D%/fgetwc_u.c \
-	%D%/fgetws.c \
-	%D%/fgetws_u.c \
 	%D%/fileno_u.c \
 	%D%/fmemopen.c \
 	%D%/fopencookie.c \
 	%D%/fpurge.c \
 	%D%/fputc_u.c \
 	%D%/fputs_u.c \
+	%D%/fread_u.c \
+	%D%/fsetlocking.c \
+	%D%/funopen.c \
+	%D%/fwrite_u.c \
+	%D%/open_memstream.c \
+	%D%/stdio_ext.c \
+	%D%/vasnprintf.c
+if !NEWLIB_NANO_FORMATTED_IO
+%C%_ELIX_4_SOURCES += \
+	%D%/asniprintf.c \
+	%D%/diprintf.c \
+	%D%/fgetwc.c \
+	%D%/fgetwc_u.c \
+	%D%/fgetws.c \
+	%D%/fgetws_u.c \
 	%D%/fputwc.c \
 	%D%/fputwc_u.c \
 	%D%/fputws.c \
 	%D%/fputws_u.c \
-	%D%/fread_u.c \
-	%D%/fsetlocking.c \
-	%D%/funopen.c \
 	%D%/fwide.c \
 	%D%/fwprintf.c \
-	%D%/fwrite_u.c \
 	%D%/fwscanf.c \
 	%D%/getwc.c \
 	%D%/getwc_u.c \
 	%D%/getwchar.c \
 	%D%/getwchar_u.c \
-	%D%/open_memstream.c \
 	%D%/putwc.c \
 	%D%/putwc_u.c \
 	%D%/putwchar.c \
 	%D%/putwchar_u.c \
-	%D%/stdio_ext.c \
 	%D%/swprintf.c \
 	%D%/swscanf.c \
 	%D%/ungetwc.c \
-	%D%/vasnprintf.c \
+	%D%/vasniprintf.c \
 	%D%/vswprintf.c \
 	%D%/vswscanf.c \
 	%D%/vwprintf.c \
 	%D%/vwscanf.c \
 	%D%/wprintf.c \
 	%D%/wscanf.c
-if !NEWLIB_NANO_FORMATTED_IO
-%C%_ELIX_4_SOURCES += \
-	%D%/asniprintf.c \
-	%D%/diprintf.c \
-	%D%/vasniprintf.c
 endif !NEWLIB_NANO_FORMATTED_IO
 endif !ELIX_LEVEL_3
 endif !ELIX_LEVEL_2
-- 
2.25.1


  reply	other threads:[~2024-02-23 15:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 17:40 undefined reference to __ssputws_r with --specs=nano.specs Torbjorn SVENSSON
2024-02-15 15:19 ` Torbjorn SVENSSON
2024-02-19 16:20   ` Richard Earnshaw (lists)
2024-02-23 15:31     ` Torbjörn SVENSSON [this message]
2024-02-23 16:05       ` [PATCH] libc/stdio: Remove wchar_t functions from NEWLIB_NANO_FORMATTED_IO R. Diez
2024-03-09  8:15       ` [PATCH v2] " Torbjörn SVENSSON
2024-03-11 10:30         ` Corinna Vinschen

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=20240223153111.3265858-1-torbjorn.svensson@foss.st.com \
    --to=torbjorn.svensson@foss.st.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=newlib@sourceware.org \
    --cc=yvan.roux@foss.st.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).