public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: Keith Packard <keithp@keithp.com>, gcc-patches@gcc.gnu.org
Cc: Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: [PATCH 3/3] Add '--oslib=' option when default C library is picolibc
Date: Mon, 21 Nov 2022 08:11:06 +0100	[thread overview]
Message-ID: <1ca4a591-2d0f-48fa-dce0-613808904c09@embedded-brains.de> (raw)
In-Reply-To: <20220903060707.1622470-4-keithp@keithp.com>

On 03/09/2022 08:07, Keith Packard via Gcc-patches wrote:
> diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
> index 3d111433ede..dc5b9374814 100644
> --- a/gcc/config/arm/elf.h
> +++ b/gcc/config/arm/elf.h
> @@ -150,3 +150,8 @@
>   #undef L_floatundisf
>   #endif
>   
> +#if DEFAULT_LIBC == LIBC_PICOLIBC
> +#undef  LIB_SPEC
> +#define LIB_SPEC "--start-group %(libgcc)  -lc %{-oslib=*:-l%*} --end-group"
> +#endif
> +

Can't you add a gcc/config/picolibc.h (similar to gcc/config/rtems.h) 
which is placed in gcc/config.gcc with something like this:

picolibc)
     default_libc=LIBC_PICOLIBC
     tm_file="${tm_file} picolibc.h"
     ;;

In this header place:

#undef  LIB_SPEC
#define LIB_SPEC "--start-group %(libgcc)  -lc %{-oslib=*:-l%*} --end-group"
#endif

This avoids having to modify all the ELF-specific files.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

  reply	other threads:[~2022-11-21  7:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 18:04 [PATCH 0/3] picolibc: Add picolibc linking help 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
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 [this message]
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=1ca4a591-2d0f-48fa-dce0-613808904c09@embedded-brains.de \
    --to=sebastian.huber@embedded-brains.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=keithp@keithp.com \
    --cc=richard.sandiford@arm.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).