Message ID | 20240708040157.3770926-1-hau.hsu@sifive.com |
---|---|
Headers |
Return-Path: <newlib-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3B33C386181B for <patchwork@sourceware.org>; Mon, 8 Jul 2024 04:02:32 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 87EB7385E027 for <newlib@sourceware.org>; Mon, 8 Jul 2024 04:02:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87EB7385E027 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 87EB7385E027 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720411335; cv=none; b=B1Ivvano5Ccimw0tprduddsCXA8f+mC9Tw38BrSte4T8EEM6+/HyOljxTSz/UvvIOs9+rwPgT33vZrtKOlZkbb9NJybbHyRbubTGHFZl3LTLvDwupFUq6sDius3ed01Xovt39FBlQ01vwRVfrMFXCtdayLqgxgtV3y+HcKh9jMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720411335; c=relaxed/simple; bh=Yo1VnN2LPTPZ3Y/4OjWjpeA60e34pfpgtaOq3M/+FXo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=bJwwHRJPzQfFqS2vQ0nA3jZHxubas3Wibn4eQ6R7xipcOfJAXYMZIub9+zHifCPgsxTsQQOrDVBoVbS8WCLSSpnmP6CnH54vSiXnhSRlvvyduSX6O+i40ZHsS7Td8z/5EktlveXvSUwtDxgSz+IGFG4cyoj2Xezo9yo3NK7JVTM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-7036815bde7so510540a34.3 for <newlib@sourceware.org>; Sun, 07 Jul 2024 21:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1720411332; x=1721016132; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=T9WWVV2oAd2Y70GngSrtGG84DgBJBIwjwzj667l6GGs=; b=H/83fqKhM6vsOHltBUB0l7ehPT0qR6yTJcJZKIDkuztV0m1+ff4+F0OhkSaejO+gNn t6JRkIbF/C0ye5PMh74x0hKKVAzBO/ZJsaumkcNNq97z2pKXbOEgqOwN1/+JUhKBO8H2 G0oJnzc30ldaxtSqW9Pe5UzMBTYb+gittihaT5uxYzfFjxjyN3WIbs5YgHmxndPvM62H Vw0lo7lePIa6mlkrFFRuQoTActoHt5YmyITPb9dGE7hnwOt4JZ/Z7tmHwUN30IwyUN7f v62eZTL76bgNjbPJvX/3gI7EsImrjWygo+L+jJ8NjTLxV8qrMQ5zpSQbVvy4BlT42KDX pMKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720411332; x=1721016132; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=T9WWVV2oAd2Y70GngSrtGG84DgBJBIwjwzj667l6GGs=; b=nDwA5HsoygR+h86YAYtWJspF9sReQN+08H7fU6veM2EeDW/JzTxFfw/NNHUYMd0s5v kAy5bH0GfIkcGOFZalB3Gd/UDqXB2bbdNasVkAdM+IjKkbU6+nPVEMbd4zij3BUQSUXk Erl7w7yvStYpXo9BZS4YwSQTUXLL18TmJDGwIS4laahIarf15jQtP/ZW+o9hBhvytVDN FuCt1ogU8Kd9Y6wI+nW5Mu8iZjlGkmQ8eft74RA56j3JGyxIMPDimHQZmuAliWH4z7Gl uuUjnMr6OBjTFVivWHdoe91k6+ASGV5BVmhgE1yMDNkpo931TJODNdBakD6SzgypXR/3 piVQ== X-Gm-Message-State: AOJu0YwvnBy2+f6lWhPYxEomB/Q0kBA9L6kR/hKskLKehHWMQIiPGypf OzbQ+Wwo67M/ocTBYEjFBO+earW21jcnLvaQOEUAf05BnI0ivTh8NFoZegs8GbKoa5Hd6v9nbQC UHdqLL/AhqpKHIUe2nBY+g6/IJso2QRyQvifIgdF939QdJknCdHtP5JN3l0nvJrvITE5qOgMzTU Yvh63RO/nIXMdy35MlGpcTbaILs/mphlS5Og== X-Google-Smtp-Source: AGHT+IEGhhzlJh/SgvaHbAGZIpawl8uyl5Ml1YbBX6YSDX8wYeKan/vmZ0Mvtprfk+ch484lU1yfpQ== X-Received: by 2002:a05:6830:108b:b0:703:5ddb:c416 with SMTP id 46e09a7af769-7035ddbc7b0mr7423622a34.38.1720411331886; Sun, 07 Jul 2024 21:02:11 -0700 (PDT) Received: from sw05.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b3413ad37sm890550b3a.148.2024.07.07.21.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jul 2024 21:02:11 -0700 (PDT) From: Hau Hsu <hau.hsu@sifive.com> To: newlib@sourceware.org, kito.cheng@gmail.com, hau.hsu@sifive.com Subject: [PATCH 0/2] fix undefined reference to `__ssputws_r' Date: Mon, 8 Jul 2024 12:01:55 +0800 Message-Id: <20240708040157.3770926-1-hau.hsu@sifive.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list <newlib.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/newlib>, <mailto:newlib-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/newlib/> List-Post: <mailto:newlib@sourceware.org> List-Help: <mailto:newlib-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/newlib>, <mailto:newlib-request@sourceware.org?subject=subscribe> Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org |
Series |
fix undefined reference to `__ssputws_r'
|
|
Message
Hau Hsu
July 8, 2024, 4:01 a.m. UTC
*Issue* When compile a simple C++ hello world, we got undefined reference to `__ssputws_r' error with NEWLIB_NANO_FORMATTED_IO after upgrading to newlib-4.4 in risc-v toolchain: svfwprintf.c:(.text._svfwprintf_r+0x8e): undefined reference to `__ssputws_r' *Cause* This is because commit "v{fs}printf/v{fs}wprintf: create external output helpers" <https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d> introduces a new file ssputws_r.c for a wide-char-oriented helper function. But this file will not be built when newlib_nano_formated_io is enabled. The problem is that the function __ssputws_r() is used by svfwprintf(), which is compiled no matter whether newlib_nano_formated_io is enabled. *Fix* This patch fix the issue by building ssputws_r.c regardless of whether newlib_nano_formated_io is enabled. *Problem of the previous fix* Note that we also reverts a previouls patch that tries to fix the same link error: <https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=3b97a5ec67a5a52c130158bb143949cd842de305> Because we got other errors after applying this patch: undefined reference to `putwc' ... undefined reference to `getwc' ... undefined reference to `swprintf' The previous patch removes wchar_t functions from NEWLIB_NANO_FORMATTED_IO, but in the newlib/README says: > --enable-newlib-nano-formatted-io > This option does not affect wide-char formatted I/O functions Thus I think we shouldn't remove wchar_t functions from newlib_nano_formated_io. Similar bug report: * https://inbox.sourceware.org/newlib/ed0b48da6c6c4beaacd9fad63efaddc0@syntacore.com/t/ Hau Hsu (2): Revert "libc/stdio: Remove wchar_t functions from NEWLIB_NANO_FORMATTED_IO" libc/stdio: fix undefined reference to `__ssputws_r' newlib/Makefile.in | 1004 ++++++++++++++++---------------- newlib/libc/stdio/Makefile.inc | 54 +- 2 files changed, 528 insertions(+), 530 deletions(-)
Comments
@Torbjörn, would you mind to take a look? Any input on this? FWIW< this looks right to me. Thanks, Corinna On Jul 8 12:01, Hau Hsu wrote: > *Issue* > When compile a simple C++ hello world, we got undefined reference to > `__ssputws_r' error with NEWLIB_NANO_FORMATTED_IO after upgrading to > newlib-4.4 in risc-v toolchain: > > svfwprintf.c:(.text._svfwprintf_r+0x8e): undefined reference to > `__ssputws_r' > > *Cause* > This is because commit > "v{fs}printf/v{fs}wprintf: create external output helpers" > <https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d> > introduces a new file ssputws_r.c for a wide-char-oriented helper function. > But this file will not be built when newlib_nano_formated_io is enabled. > > The problem is that the function __ssputws_r() is used by svfwprintf(), > which is compiled no matter whether newlib_nano_formated_io is enabled. > > *Fix* > This patch fix the issue by building ssputws_r.c regardless of whether > newlib_nano_formated_io is enabled. > > *Problem of the previous fix* > Note that we also reverts a previouls patch that tries to fix the same > link error: > <https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=3b97a5ec67a5a52c130158bb143949cd842de305> > Because we got other errors after applying this patch: > > undefined reference to `putwc' > ... > undefined reference to `getwc' > ... > undefined reference to `swprintf' > > The previous patch removes wchar_t functions from > NEWLIB_NANO_FORMATTED_IO, but in the newlib/README says: > > > --enable-newlib-nano-formatted-io > > This option does not affect wide-char formatted I/O functions > > Thus I think we shouldn't remove wchar_t functions from > newlib_nano_formated_io. > > Similar bug report: > * https://inbox.sourceware.org/newlib/ed0b48da6c6c4beaacd9fad63efaddc0@syntacore.com/t/ > > > > Hau Hsu (2): > Revert "libc/stdio: Remove wchar_t functions from > NEWLIB_NANO_FORMATTED_IO" > libc/stdio: fix undefined reference to `__ssputws_r' > > newlib/Makefile.in | 1004 ++++++++++++++++---------------- > newlib/libc/stdio/Makefile.inc | 54 +- > 2 files changed, 528 insertions(+), 530 deletions(-) > > -- > 2.31.1
Hi, I've looked at the patch and I think it's fine. I am currently building a toolchain with the patch series applied and will run the tests on it. I'll get back with the result early next week. The reason why I didn't go this route before was that I was afraid that there would be more functions that would be missing. Hopefully, the tests will show that this is not the case. Kind regards, Torbjörn On 2024-07-09 12:48, Corinna Vinschen wrote: > @Torbjörn, > > would you mind to take a look? Any input on this? > > FWIW< this looks right to me. > > > Thanks, > Corinna > > > On Jul 8 12:01, Hau Hsu wrote: >> *Issue* >> When compile a simple C++ hello world, we got undefined reference to >> `__ssputws_r' error with NEWLIB_NANO_FORMATTED_IO after upgrading to >> newlib-4.4 in risc-v toolchain: >> >> svfwprintf.c:(.text._svfwprintf_r+0x8e): undefined reference to >> `__ssputws_r' >> >> *Cause* >> This is because commit >> "v{fs}printf/v{fs}wprintf: create external output helpers" >> <https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d> >> introduces a new file ssputws_r.c for a wide-char-oriented helper function. >> But this file will not be built when newlib_nano_formated_io is enabled. >> >> The problem is that the function __ssputws_r() is used by svfwprintf(), >> which is compiled no matter whether newlib_nano_formated_io is enabled. >> >> *Fix* >> This patch fix the issue by building ssputws_r.c regardless of whether >> newlib_nano_formated_io is enabled. >> >> *Problem of the previous fix* >> Note that we also reverts a previouls patch that tries to fix the same >> link error: >> <https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=3b97a5ec67a5a52c130158bb143949cd842de305> >> Because we got other errors after applying this patch: >> >> undefined reference to `putwc' >> ... >> undefined reference to `getwc' >> ... >> undefined reference to `swprintf' >> >> The previous patch removes wchar_t functions from >> NEWLIB_NANO_FORMATTED_IO, but in the newlib/README says: >> >>> --enable-newlib-nano-formatted-io >>> This option does not affect wide-char formatted I/O functions >> >> Thus I think we shouldn't remove wchar_t functions from >> newlib_nano_formated_io. >> >> Similar bug report: >> * https://inbox.sourceware.org/newlib/ed0b48da6c6c4beaacd9fad63efaddc0@syntacore.com/t/ >> >> >> >> Hau Hsu (2): >> Revert "libc/stdio: Remove wchar_t functions from >> NEWLIB_NANO_FORMATTED_IO" >> libc/stdio: fix undefined reference to `__ssputws_r' >> >> newlib/Makefile.in | 1004 ++++++++++++++++---------------- >> newlib/libc/stdio/Makefile.inc | 54 +- >> 2 files changed, 528 insertions(+), 530 deletions(-) >> >> -- >> 2.31.1 >
Hi again, I do not have time to dig into this right now, but these are the test cases that start to fail after applying the 2 patches suggested by Hau Hsu: FAIL: 27_io/objects/wchar_t/12048-1.cc -std=gnu++17 execution test FAIL: 27_io/objects/wchar_t/12048-2.cc -std=gnu++17 execution test FAIL: 27_io/objects/wchar_t/12048-3.cc -std=gnu++17 execution test FAIL: 27_io/objects/wchar_t/12048-4.cc -std=gnu++17 execution test FAIL: 27_io/objects/wchar_t/2.cc -std=gnu++17 output pattern test FAIL: 27_io/objects/wchar_t/9662.cc -std=gnu++17 execution test FAIL: ext/stdio_sync_filebuf/wchar_t/1.cc -std=gnu++17 execution test FAIL: ext/stdio_sync_filebuf/wchar_t/12948-1.cc -std=gnu++17 execution test FAIL: ext/stdio_sync_filebuf/wchar_t/12948-2.cc -std=gnu++17 execution test FAIL: ext/stdio_sync_filebuf/wchar_t/12948-3.cc -std=gnu++17 execution test FAIL: ext/stdio_sync_filebuf/wchar_t/12948-4.cc -std=gnu++17 execution test This was checked with basepoints/gcc-15-1852-g320c2ed4d2b and newlib 1339af44679aee0895fe311cfad89d38cfc2b919 built for arm-none-eabi. Kind regards, Torbjörn On 2024-07-12 10:07, Torbjorn SVENSSON wrote: > Hi, > > I've looked at the patch and I think it's fine. > I am currently building a toolchain with the patch series applied and > will run the tests on it. I'll get back with the result early next week. > > The reason why I didn't go this route before was that I was afraid that > there would be more functions that would be missing. Hopefully, the > tests will show that this is not the case. > > Kind regards, > Torbjörn > > On 2024-07-09 12:48, Corinna Vinschen wrote: >> @Torbjörn, >> >> would you mind to take a look? Any input on this? >> >> FWIW< this looks right to me. >> >> >> Thanks, >> Corinna >> >> >> On Jul 8 12:01, Hau Hsu wrote: >>> *Issue* >>> When compile a simple C++ hello world, we got undefined reference to >>> `__ssputws_r' error with NEWLIB_NANO_FORMATTED_IO after upgrading to >>> newlib-4.4 in risc-v toolchain: >>> >>> svfwprintf.c:(.text._svfwprintf_r+0x8e): undefined reference to >>> `__ssputws_r' >>> >>> *Cause* >>> This is because commit >>> "v{fs}printf/v{fs}wprintf: create external output helpers" >>> <https://cygwin.com/git/?p=newlib- >>> cygwin.git;a=commit;h=61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d> >>> introduces a new file ssputws_r.c for a wide-char-oriented helper >>> function. >>> But this file will not be built when newlib_nano_formated_io is enabled. >>> >>> The problem is that the function __ssputws_r() is used by svfwprintf(), >>> which is compiled no matter whether newlib_nano_formated_io is enabled. >>> >>> *Fix* >>> This patch fix the issue by building ssputws_r.c regardless of whether >>> newlib_nano_formated_io is enabled. >>> >>> *Problem of the previous fix* >>> Note that we also reverts a previouls patch that tries to fix the same >>> link error: >>> <https://cygwin.com/git/?p=newlib- >>> cygwin.git;a=commitdiff;h=3b97a5ec67a5a52c130158bb143949cd842de305> >>> Because we got other errors after applying this patch: >>> >>> undefined reference to `putwc' >>> ... >>> undefined reference to `getwc' >>> ... >>> undefined reference to `swprintf' >>> >>> The previous patch removes wchar_t functions from >>> NEWLIB_NANO_FORMATTED_IO, but in the newlib/README says: >>> >>>> --enable-newlib-nano-formatted-io >>>> This option does not affect wide-char formatted I/O functions >>> >>> Thus I think we shouldn't remove wchar_t functions from >>> newlib_nano_formated_io. >>> >>> Similar bug report: >>> * https://inbox.sourceware.org/newlib/ >>> ed0b48da6c6c4beaacd9fad63efaddc0@syntacore.com/t/ >>> >>> >>> >>> Hau Hsu (2): >>> Revert "libc/stdio: Remove wchar_t functions from >>> NEWLIB_NANO_FORMATTED_IO" >>> libc/stdio: fix undefined reference to `__ssputws_r' >>> >>> newlib/Makefile.in | 1004 ++++++++++++++++---------------- >>> newlib/libc/stdio/Makefile.inc | 54 +- >>> 2 files changed, 528 insertions(+), 530 deletions(-) >>> >>> -- >>> 2.31.1 >>
Hi Hau Hsu, are you looking into this? Thanks, Corinna On Jul 15 10:53, Torbjorn SVENSSON wrote: > Hi again, > > I do not have time to dig into this right now, but these are the test cases > that start to fail after applying the 2 patches suggested by Hau Hsu: > > FAIL: 27_io/objects/wchar_t/12048-1.cc -std=gnu++17 execution test > FAIL: 27_io/objects/wchar_t/12048-2.cc -std=gnu++17 execution test > FAIL: 27_io/objects/wchar_t/12048-3.cc -std=gnu++17 execution test > FAIL: 27_io/objects/wchar_t/12048-4.cc -std=gnu++17 execution test > FAIL: 27_io/objects/wchar_t/2.cc -std=gnu++17 output pattern test > FAIL: 27_io/objects/wchar_t/9662.cc -std=gnu++17 execution test > FAIL: ext/stdio_sync_filebuf/wchar_t/1.cc -std=gnu++17 execution test > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-1.cc -std=gnu++17 execution test > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-2.cc -std=gnu++17 execution test > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-3.cc -std=gnu++17 execution test > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-4.cc -std=gnu++17 execution test > > This was checked with basepoints/gcc-15-1852-g320c2ed4d2b and newlib > 1339af44679aee0895fe311cfad89d38cfc2b919 built for arm-none-eabi. > > Kind regards, > Torbjörn > > > On 2024-07-12 10:07, Torbjorn SVENSSON wrote: > > Hi, > > > > I've looked at the patch and I think it's fine. > > I am currently building a toolchain with the patch series applied and > > will run the tests on it. I'll get back with the result early next week. > > > > The reason why I didn't go this route before was that I was afraid that > > there would be more functions that would be missing. Hopefully, the > > tests will show that this is not the case. > > > > Kind regards, > > Torbjörn > > > > On 2024-07-09 12:48, Corinna Vinschen wrote: > > > @Torbjörn, > > > > > > would you mind to take a look? Any input on this? > > > > > > FWIW< this looks right to me. > > > > > > > > > Thanks, > > > Corinna > > > > > > > > > On Jul 8 12:01, Hau Hsu wrote: > > > > *Issue* > > > > When compile a simple C++ hello world, we got undefined reference to > > > > `__ssputws_r' error with NEWLIB_NANO_FORMATTED_IO after upgrading to > > > > newlib-4.4 in risc-v toolchain: > > > > > > > > svfwprintf.c:(.text._svfwprintf_r+0x8e): undefined reference to > > > > `__ssputws_r' > > > > > > > > *Cause* > > > > This is because commit > > > > "v{fs}printf/v{fs}wprintf: create external output helpers" > > > > <https://cygwin.com/git/?p=newlib- > > > > cygwin.git;a=commit;h=61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d> > > > > introduces a new file ssputws_r.c for a wide-char-oriented > > > > helper function. > > > > But this file will not be built when newlib_nano_formated_io is enabled. > > > > > > > > The problem is that the function __ssputws_r() is used by svfwprintf(), > > > > which is compiled no matter whether newlib_nano_formated_io is enabled. > > > > > > > > *Fix* > > > > This patch fix the issue by building ssputws_r.c regardless of whether > > > > newlib_nano_formated_io is enabled. > > > > > > > > *Problem of the previous fix* > > > > Note that we also reverts a previouls patch that tries to fix the same > > > > link error: > > > > <https://cygwin.com/git/?p=newlib- > > > > cygwin.git;a=commitdiff;h=3b97a5ec67a5a52c130158bb143949cd842de305> > > > > Because we got other errors after applying this patch: > > > > > > > > undefined reference to `putwc' > > > > ... > > > > undefined reference to `getwc' > > > > ... > > > > undefined reference to `swprintf' > > > > > > > > The previous patch removes wchar_t functions from > > > > NEWLIB_NANO_FORMATTED_IO, but in the newlib/README says: > > > > > > > > > --enable-newlib-nano-formatted-io > > > > > This option does not affect wide-char formatted I/O functions > > > > > > > > Thus I think we shouldn't remove wchar_t functions from > > > > newlib_nano_formated_io. > > > > > > > > Similar bug report: > > > > * https://inbox.sourceware.org/newlib/ > > > > ed0b48da6c6c4beaacd9fad63efaddc0@syntacore.com/t/ > > > > > > > > > > > > > > > > Hau Hsu (2): > > > > Revert "libc/stdio: Remove wchar_t functions from > > > > NEWLIB_NANO_FORMATTED_IO" > > > > libc/stdio: fix undefined reference to `__ssputws_r' > > > > > > > > newlib/Makefile.in | 1004 ++++++++++++++++---------------- > > > > newlib/libc/stdio/Makefile.inc | 54 +- > > > > 2 files changed, 528 insertions(+), 530 deletions(-) > > > > > > > > -- > > > > 2.31.1 > > >
Oh I didn't receive the mail that reports the failures. I'll check whether we have the same issues in our RISC-V toolchain. Thanks, Hau Hsu > On Jul 16, 2024, at 17:34, Corinna Vinschen <vinschen@redhat.com> wrote: > > Hi Hau Hsu, > > are you looking into this? > > > Thanks, > Corinna > > > On Jul 15 10:53, Torbjorn SVENSSON wrote: >> Hi again, >> >> I do not have time to dig into this right now, but these are the test cases >> that start to fail after applying the 2 patches suggested by Hau Hsu: >> >> FAIL: 27_io/objects/wchar_t/12048-1.cc -std=gnu++17 execution test >> FAIL: 27_io/objects/wchar_t/12048-2.cc -std=gnu++17 execution test >> FAIL: 27_io/objects/wchar_t/12048-3.cc -std=gnu++17 execution test >> FAIL: 27_io/objects/wchar_t/12048-4.cc -std=gnu++17 execution test >> FAIL: 27_io/objects/wchar_t/2.cc -std=gnu++17 output pattern test >> FAIL: 27_io/objects/wchar_t/9662.cc -std=gnu++17 execution test >> FAIL: ext/stdio_sync_filebuf/wchar_t/1.cc -std=gnu++17 execution test >> FAIL: ext/stdio_sync_filebuf/wchar_t/12948-1.cc -std=gnu++17 execution test >> FAIL: ext/stdio_sync_filebuf/wchar_t/12948-2.cc -std=gnu++17 execution test >> FAIL: ext/stdio_sync_filebuf/wchar_t/12948-3.cc -std=gnu++17 execution test >> FAIL: ext/stdio_sync_filebuf/wchar_t/12948-4.cc -std=gnu++17 execution test >> >> This was checked with basepoints/gcc-15-1852-g320c2ed4d2b and newlib >> 1339af44679aee0895fe311cfad89d38cfc2b919 built for arm-none-eabi. >> >> Kind regards, >> Torbjörn >> >> >> On 2024-07-12 10:07, Torbjorn SVENSSON wrote: >>> Hi, >>> >>> I've looked at the patch and I think it's fine. >>> I am currently building a toolchain with the patch series applied and >>> will run the tests on it. I'll get back with the result early next week. >>> >>> The reason why I didn't go this route before was that I was afraid that >>> there would be more functions that would be missing. Hopefully, the >>> tests will show that this is not the case. >>> >>> Kind regards, >>> Torbjörn >>> >>> On 2024-07-09 12:48, Corinna Vinschen wrote: >>>> @Torbjörn, >>>> >>>> would you mind to take a look? Any input on this? >>>> >>>> FWIW< this looks right to me. >>>> >>>> >>>> Thanks, >>>> Corinna >>>> >>>> >>>> On Jul 8 12:01, Hau Hsu wrote: >>>>> *Issue* >>>>> When compile a simple C++ hello world, we got undefined reference to >>>>> `__ssputws_r' error with NEWLIB_NANO_FORMATTED_IO after upgrading to >>>>> newlib-4.4 in risc-v toolchain: >>>>> >>>>> svfwprintf.c:(.text._svfwprintf_r+0x8e): undefined reference to >>>>> `__ssputws_r' >>>>> >>>>> *Cause* >>>>> This is because commit >>>>> "v{fs}printf/v{fs}wprintf: create external output helpers" >>>>> <https://cygwin.com/git/?p=newlib- >>>>> cygwin.git;a=commit;h=61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d> >>>>> introduces a new file ssputws_r.c for a wide-char-oriented >>>>> helper function. >>>>> But this file will not be built when newlib_nano_formated_io is enabled. >>>>> >>>>> The problem is that the function __ssputws_r() is used by svfwprintf(), >>>>> which is compiled no matter whether newlib_nano_formated_io is enabled. >>>>> >>>>> *Fix* >>>>> This patch fix the issue by building ssputws_r.c regardless of whether >>>>> newlib_nano_formated_io is enabled. >>>>> >>>>> *Problem of the previous fix* >>>>> Note that we also reverts a previouls patch that tries to fix the same >>>>> link error: >>>>> <https://cygwin.com/git/?p=newlib- >>>>> cygwin.git;a=commitdiff;h=3b97a5ec67a5a52c130158bb143949cd842de305> >>>>> Because we got other errors after applying this patch: >>>>> >>>>> undefined reference to `putwc' >>>>> ... >>>>> undefined reference to `getwc' >>>>> ... >>>>> undefined reference to `swprintf' >>>>> >>>>> The previous patch removes wchar_t functions from >>>>> NEWLIB_NANO_FORMATTED_IO, but in the newlib/README says: >>>>> >>>>>> --enable-newlib-nano-formatted-io >>>>>> This option does not affect wide-char formatted I/O functions >>>>> >>>>> Thus I think we shouldn't remove wchar_t functions from >>>>> newlib_nano_formated_io. >>>>> >>>>> Similar bug report: >>>>> * https://inbox.sourceware.org/newlib/ >>>>> ed0b48da6c6c4beaacd9fad63efaddc0@syntacore.com/t/ >>>>> >>>>> >>>>> >>>>> Hau Hsu (2): >>>>> Revert "libc/stdio: Remove wchar_t functions from >>>>> NEWLIB_NANO_FORMATTED_IO" >>>>> libc/stdio: fix undefined reference to `__ssputws_r' >>>>> >>>>> newlib/Makefile.in | 1004 ++++++++++++++++---------------- >>>>> newlib/libc/stdio/Makefile.inc | 54 +- >>>>> 2 files changed, 528 insertions(+), 530 deletions(-) >>>>> >>>>> -- >>>>> 2.31.1 >>>> >