From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 194783858D28; Mon, 15 Jan 2024 13:10:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 194783858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705324221; bh=bH4lDBVMxrJ9Xii6otF377Ubwic1ehoPWd1H+Fa6JUg=; h=From:To:Subject:Date:From; b=oSOwjP2heUDpSy80K0ckJum6Ao6ISZYgUOjmecPst9UWptqnpqZSWuFM/byHAsV6Z tsxkoJOJoSkQilt+Azmykfk3Rx+I2+ep1GZc6Z46tG9v0l+nAIqJuFRr1B5S3FOyrO 5qLjLabbrSoymMVO5cfbmWgnbC/AqWsLy6JQrDbA= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113398] New: no longer usable with -ffreestanding Date: Mon, 15 Jan 2024 13:10:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113398 Bug ID: 113398 Summary: no longer usable with -ffreestanding Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- This used to work with GCC 12 when compiled with -ffreestanding #include // Defined by the user. void* operator new(std::size_t n); void operator delete(void*, std::size_t n); int main() { std::string s =3D "a string that needs to allocate from the heap"; return s.size(); } Since GCC 13 the -ffreestanding option also selects a freestanding libstdc+= +, which doesn't allow std::string to be used. The change was done intentionally, to provide a more clearly defined and documented freestanding library, but it removes functionality that was being used.=