public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Keith Packard <keithp@keithp.com>
To: Andrew Pinski <pinskia@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 0/3] picolibc: Add picolibc linking help
Date: Wed, 24 Aug 2022 12:32:20 -0700	[thread overview]
Message-ID: <87a67ta14r.fsf@keithp.com> (raw)
In-Reply-To: <CA+=Sn1na1cxxzhD_zjAnYN97j2hMhChNPi8b8BUTtLXKMNGRhw@mail.gmail.com>

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

Andrew Pinski <pinskia@gmail.com> writes:

(removing gcc@ as not appropriate for patch discussions)

Thanks for reviewing my patches; I appreciate the time you have taken to
think about this.

> Why do you need to change the specs to support picolibc? Why not have
> the library supply the specs file instead, like what is done for
> newlib and libgloss?

Several architectures do include support for newlib's libgloss in their
gcc configuration today (i386, m32r, microblaze, nds32, pru, riscv and
sh), so I wondered if it made sense to add support for picolibc's
target-specific libraries as well.

Picolibc does deliver a spec file fragment which implements this
functionality, but that requires the addition of --specs=picolibc.specs
to the gcc command line instead of being built-in to gcc itself. When
creating an integrated toolchain using picolibc, it seems a bit odd to
require an option for the toolchain to work.

> What OS libraries are not included in libc? I trying to figure out why
> this needs to be special cased here.

As a general-purpose embedded C library, picolibc doesn't include any
OS-specific code. Instead, it defines a limited subset of POSIX
interfaces which are to be supplied by the target platform.

Picolibc itself supplies sample implementations of these ABIs that can
run on top of bare metal systems with semihosting support which are used
while testing picolibc itself.

This is similar to newlib's libgloss: the C library is built atop
another library which needs to follow it in the linker command line for
symbol resolution to work correctly. Making this work requires a change
in the *lib spec file fragment.

Adjusting the *lib fragment can either be done in an externally provided
specs file, or built-in to gcc. Both of these mechanisms are present in
the gcc ecosystem today, leading me to wonder whether the gcc community
would be interested in having an integrated option available.

-- 
-keith

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

  reply	other threads:[~2022-08-24 19:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 18:04 Keith Packard
2022-08-24 18:04 ` [PATCH 1/3] picolibc: Allow default libc to be specified to configure Keith Packard
2022-08-24 18:04   ` [PATCH 2/3] picolibc: Add newlib and picolibc as default C library choices Keith Packard
2022-08-24 18:04     ` [PATCH 3/3] picolibc: Add '--oslib=' option when default C library is picolibc Keith Packard
2022-08-24 18:24 ` [PATCH 0/3] picolibc: Add picolibc linking help Andrew Pinski
2022-08-24 19:32   ` Keith Packard [this message]
2022-08-25  7:16     ` Kito Cheng
2022-08-25 17:38       ` Keith Packard
2022-09-02 12:36 ` Richard Sandiford
2022-09-03  6:02   ` Keith Packard
2022-09-03  6:07 ` Keith Packard
2022-09-03  6:07   ` [PATCH 1/3] Allow default libc to be specified to configure Keith Packard
2022-09-03  6:07   ` [PATCH 2/3] Add newlib and picolibc as default C library choices Keith Packard
2022-09-03  6:07   ` [PATCH 3/3] Add '--oslib=' option when default C library is picolibc Keith Packard
2022-11-21  7:11     ` Sebastian Huber
2023-02-05  7:10   ` [PATCH 0/3] picolibc: Add picolibc linking help (v3) Keith Packard
2023-02-05  7:10     ` [PATCH 1/3] Allow default libc to be specified to configure Keith Packard
2023-02-05  7:10     ` [PATCH 2/3] Add newlib and picolibc as default C library choices Keith Packard
2023-02-05  7:10     ` [PATCH 3/3] Add '--oslib=' option when default C library is picolibc Keith Packard

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=87a67ta14r.fsf@keithp.com \
    --to=keithp@keithp.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pinskia@gmail.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).