public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: Enable building libstdc++.{a,so} when !HOSTED
Date: Tue, 15 Nov 2022 19:03:06 +0100	[thread overview]
Message-ID: <864jv0ul7v.fsf@aarsen.me> (raw)
In-Reply-To: <CACb0b4n1HEu40E1Y_xYiy+1+tcdpQpTHfR-6m56cbL07_u9giQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]


Jonathan Wakely <jwakely@redhat.com> writes:

> On Thu, 20 Oct 2022 at 16:53, Arsen Arsenović via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
>>
>> This enables us to provide symbols for placeholders and numeric limits,
>
>
> I'm not convinced this is worth doing.
>
> The placeholders and the numeric_limits members are all inline
> variables for C++17 and later, and C++17 is the compiler's default
> mode. The placeholders aren't even required to exist for freestanding
> prior to C++23. For the numeric_limits definitions, I suppose it is a
> problem that users can't take their address in freestanding today
> unless they compile as C++17.
>
>> and allows users to mess about with linker flags less.
>
> i.e. they don't have to use -nostdlib and/or link with gcc -lsupc++,
> but can just use g++?
>
> That seems more compelling than providing definitions of the
> placeholders and limits members.

Indeed, with just a few more changes that I didn't get the chance to
polish up before S3 (setting the MATH_LIBRARY target macro to "" and
disabling linking crt0 when building --without-headers
--without-newlib), and the other patches I did submit, I could get a
freestanding test program building with just -nolibc:

  i686-elf-g++ -ffreestanding -ggdb3 -O2 -fno-omit-frame-pointer \
    -std=gnu++20 -T ../linkscript.ld -nolibc \
    -Wl,-z,max-page-size=0x1000 -o frello frello-main.o frello-abort.o \
    -frello-support.o frello-memory.o frello-logging.o frello-assert.o \
    frello-entry.o

Most of these flags serve unrelated purposes, and the linker script is
the default one for this configuration, with some sections shifted
about.

Have a great evening!
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

  reply	other threads:[~2022-11-15 18:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 15:49 Arsen Arsenović
2022-11-14 18:34 ` Ping: " Arsen Arsenović
2022-11-15 15:58 ` Jonathan Wakely
2022-11-15 18:03   ` Arsen Arsenović [this message]
2023-02-06 14:24 ` Jonathan Wakely

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=864jv0ul7v.fsf@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /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).