From patchwork Wed Aug 24 18:04:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 1669938 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=q/sRXVRO; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MCYxd36wTz1ygV for ; Thu, 25 Aug 2022 04:08:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 72294388DD3C for ; Wed, 24 Aug 2022 18:08:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72294388DD3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661364515; bh=sN/KCA0G5RPexeO2U1QspdZEofiD0Z6MwQSzJzGSsRs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=q/sRXVRO5h9fmipGKjRL0+Ys1rDbsYXGkPxqK2RVYq1JwLXEzEo+0j2oS1YzWdHZk 7zWJT6wXFufXjl/bMZFKlZa9zOecaw73ioxpvGsWh++JRLrwki9dS6G2ggSHgdeAYZ p6mYFEVHuvd3pjQMQjsW1CLhv8v0ua9a14z97HOo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id 9D3D53838004; Wed, 24 Aug 2022 18:05:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9D3D53838004 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 9625C3F2FE55; Wed, 24 Aug 2022 11:05:31 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1sZb9GBPRgyz; Wed, 24 Aug 2022 11:05:26 -0700 (PDT) Received: from keithp.com (koto.keithp.com [192.168.11.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 74E673F2FE8B; Wed, 24 Aug 2022 11:05:26 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id 0C67D1E601CB; Wed, 24 Aug 2022 11:05:26 -0700 (PDT) To: gcc@gcc.gnu.org Subject: [PATCH 0/3] picolibc: Add picolibc linking help Date: Wed, 24 Aug 2022 11:04:23 -0700 Message-Id: <20220824180426.820576-1-keithp@keithp.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Keith Packard via Gcc-patches From: Keith Packard Reply-To: Keith Packard Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Picolibc is a C library for embedded systems based on code from newlib and avr libc. To connect some system-dependent picolibc functions (like stdio) to an underlying platform, the platform may provide an OS library. This OS library must follow the C library in the link command line. In current picolibc, that is done by providing an alternate .specs file which can rewrite the *lib spec to insert the OS library in the right spot. This patch series adds the ability to specify the OS library on the gcc command line when GCC is configured to us picolibc as the default C library, and then hooks that up for arm, nds32, riscv and sh targets. Keith Packard (3): Allow default libc to be specified to configure Add newlib and picolibc as default C library choices Add '--oslib=' option when default C library is picolibc gcc/config.gcc | 56 ++++++++++++++++++++++++++++++++------- gcc/config/arm/elf.h | 5 ++++ gcc/config/nds32/elf.h | 4 +++ gcc/config/picolibc.opt | 26 ++++++++++++++++++ gcc/config/riscv/elf.h | 4 +++ gcc/config/sh/embed-elf.h | 5 ++++ gcc/configure.ac | 4 +++ 7 files changed, 95 insertions(+), 9 deletions(-) create mode 100644 gcc/config/picolibc.opt