From patchwork Sun Feb 5 07:10:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 4971 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1668255wrn; Sat, 4 Feb 2023 23:11:43 -0800 (PST) X-Google-Smtp-Source: AK7set9GVRlyfr+z9o9pR98m/xarl8GZDjH3WOAmokm6SilVfuczQCXUcKshxu9ycDPISYDxoEZ2 X-Received: by 2002:a17:907:94cb:b0:88e:e6ee:feab with SMTP id dn11-20020a17090794cb00b0088ee6eefeabmr16654090ejc.62.1675581103380; Sat, 04 Feb 2023 23:11:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675581103; cv=none; d=google.com; s=arc-20160816; b=GrnqmBo9eGtzEmZ5scb0utDP1aVhmkvtASGzPDbeeoBEY3n6j0smKokGAPCt2Pvpv5 FlQRMS/5SiosabQ1SWkgTbjCDAKAGLo+2c/tc6zXztA9+2QpxeergXT1CdUr9I8P11if qQX/V6wWEDZfUK4OInEAXhUcRALVlpo5B1U2IeO4v5GfKKxPcA9KVzobBFRyDuunpXB0 W8G+UuBBSJUl7IGHQzEPULsFdDnyW6EI90jimyhK+9e3wAPpFjKuIuhhYILsUfrPut5t gdaD2ZnrKGBZX38tw+Rm3nM2IqurJRTrPlQmFxv0FSqVnfw7QtYL24nZnjsiZbgkYVJx Dvsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=rJ6gto6SfVY60n4jvDzTi82ui0ot4ChICpo7KJCO1KI=; b=lqTy+nxhB4YYbigtoryCBwGvZZOQh9LyeNhL+idGirVLLkS0aRDxa+uGlT7Dui1hTJ 7srNaWx5AAVuRtBONOteTwxLPTyIB+ji8HHToC04w4K3Q4l00P5Jubl4rRtOw1sNhTd9 ahH79MfSrcGy6MY50tjdBGySsOi7SwvWkdmL1O+SfG1yk/QqVQ1KrbAft6lwIYMYt1hq KxsRFrGCmbr/NM3M/AgGA3SYlXQIO6TdsW+VbTVIzRkfHj+qVCQGZHF3q8WGxETvuuxs ZjeBMPAqREMocogd7SQUhQInY7wrsoxUmPEckhoYVKwGC7ahPfuX2O0d993atYXwUmGo 9TYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vdenedgb; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id jr24-20020a170906515800b008718874c66asi8176510ejc.626.2023.02.04.23.11.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 23:11:43 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vdenedgb; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 813563858023 for ; Sun, 5 Feb 2023 07:11:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 813563858023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675581091; bh=rJ6gto6SfVY60n4jvDzTi82ui0ot4ChICpo7KJCO1KI=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=vdenedgbYY9E1MSuo3QDtZ2gdMSWsGuZNs/IQLRq8a+LSSBsTwj4E8lXKFdsYCtIU 9cbKfl2fAfYe4gaugn9mR7ROXFlOiksqwT60PP3kB8CDeI4T2fegsOLUMqloZ7ZHxo wuXbCdfTyg/ap7fNA8T7lfadRuM0diUV2f6deCv4= 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 B5DD13858C52 for ; Sun, 5 Feb 2023 07:10:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B5DD13858C52 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id D5D6C3F33F0B; Sat, 4 Feb 2023 23:10:45 -0800 (PST) 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 tdVETu6ruiTZ; Sat, 4 Feb 2023 23:10:43 -0800 (PST) Received: from keithp.com (koto.keithp.com [192.168.11.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 05BBA3F33F0A; Sat, 4 Feb 2023 23:10:42 -0800 (PST) Received: by keithp.com (Postfix, from userid 1000) id 985B71E600C7; Sat, 4 Feb 2023 23:10:42 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Keith Packard , Andrew Pinski , Kito Cheng , Richard Sandiford , Sebastian Huber Subject: [PATCH 0/3] picolibc: Add picolibc linking help (v3) Date: Sat, 4 Feb 2023 23:10:33 -0800 Message-Id: X-Mailer: git-send-email 2.39.0 In-Reply-To: <20220903060707.1622470-1-keithp@keithp.com> References: <20220903060707.1622470-1-keithp@keithp.com> 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 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 Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756974130892860097?= X-GMAIL-MSGID: =?utf-8?q?1756974130892860097?= 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. The second version of this series includes the following updates: 1. Add a check for unrecognized C library passed to the --with-default-libc to catch errors. Suggested by Richard Sandiford. The third version of this series includes the following updates: 1. Replace the various target-specific hacks with a new file, gcc/config/picolibc.h which adjusts the LIB_SPEC, STARTFILE_SPEC and ENDFILE_SPEC values. Suggested by Sebastian Huber. 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 | 66 +++++++++++++++++++++++++++++++++++------ gcc/config/picolibc.h | 32 ++++++++++++++++++++ gcc/config/picolibc.opt | 26 ++++++++++++++++ gcc/configure.ac | 4 +++ 4 files changed, 119 insertions(+), 9 deletions(-) create mode 100644 gcc/config/picolibc.h create mode 100644 gcc/config/picolibc.opt