Jonathan Wakely <jwak...@redhat.com> writes:

> On Thu, 20 Oct 2022 at 16:53, Arsen Arsenović via Libstdc++
> <libstd...@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: signature.asc
Description: PGP signature

Reply via email to