From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id 89C4D3858C33 for ; Wed, 24 Aug 2022 19:32:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 89C4D3858C33 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=keithp.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=keithp.com Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 2897C3F2FE8C; Wed, 24 Aug 2022 12:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1661369541; bh=p2N7irErOXthXUMGDzJ9kt78nPsq57x6NhBjI/wLf54=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QQyGM8O/hS8FFu9X1xLCuXi3qQju6ZJQzFjaW0OajJ6sYZAj63mgRZEkeh2fIoaNg m+EIxl46OWR7MLP3HoTNyB1tZRG+FdI8QqRlO0gDYmiJHD82LtTlA0f3rbUKxZJRzU cmK+ADnauess2W5s7vS+YtErdqgX5Sl038zuiHUS40Oy9wBUPAh1P/dacmT0gJxPIY C1FyGaomuzFgU6ZduY/FmT/2Xae25LRKldExfdjYWuFBzaxeQ6/3wL4JWxTPMBAADo OMUKhefANgcmqQQRrVZg8VEMwY2lqbUEkQq+IUxQH5mY5bGEgB53Z72jd4jjBJw0dM ljuSyanRBiAYw== 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 Xa9KlGuVCga3; Wed, 24 Aug 2022 12:32:20 -0700 (PDT) Received: from keithp.com (koto.keithp.com [192.168.11.2]) by elaine.keithp.com (Postfix) with ESMTPSA id C1B723F2FE8B; Wed, 24 Aug 2022 12:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1661369540; bh=p2N7irErOXthXUMGDzJ9kt78nPsq57x6NhBjI/wLf54=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=KkQvWhIOgHhJiSQ7TfV0Aw6L1UwLda7j/5/oLCvtE01zM6+yHAgHYa4HvEgg/XfBK e//TJoovVRiTOaZc/sUID3DgHo06+f4tgIqoMKr4ZSd7bWKOe8BgnWs3ox4n9Zvo99 RSojaSdF2lKcqenN5BGXTbwNWzWujIJZZeX+TIgV7bPR8y7kJk21TEne0JCAvkU3ia BNhGGTeIPPqiJWNBdUc+ZWxsrgMLqTpdzUPR+C3QqW0IGaReO0gs97PZ1461+Nbq99 wDLKHMFiSJXRoJ88S1rIOEgw21E+o2M3hCY18g6cUrqXcS4Gl5ssTLOqY20LKXgHjB MCojEHEZD7I/Q== Received: by keithp.com (Postfix, from userid 1000) id 8CBC61E601CB; Wed, 24 Aug 2022 12:32:20 -0700 (PDT) From: Keith Packard To: Andrew Pinski Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 0/3] picolibc: Add picolibc linking help In-Reply-To: References: <20220824180426.820576-1-keithp@keithp.com> Date: Wed, 24 Aug 2022 12:32:20 -0700 Message-ID: <87a67ta14r.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Status: No, score=-4.6 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 List-Id: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Andrew Pinski 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=3Dpicolibc.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. =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAmMGfMQACgkQ2yIaaQAA ABFeZA/+LJ3ISf+Gds2W0e+O3FnfwOmDndbc27+g1c4t2xNn0dTSrnhp5qudUHpa 3J64F07wGR8uLHa7x2GOVH1Y0nsLqRtvtWWram02WjBy+5N1ArMZhnWhU2xdMJSp EVjLrr3zdiQzAcNjNgicpqVUXTMETMSncrIvlg+5PNqqBmbmNTs3hMny9Rz82hfa NVh4/bNBUUP2GZMnVDLEQqiR75xSliPOFFSQgXxdrow97h+NZc6at2dmd8PsS00m S6KCxV7985zFLunpRQNpyFRrvqlc5aN933edpmKGONOlDely2oMcT7PN7/olzizR X36fMx197Sen3L5TscVmMLnB4xWPEmoPXs2JhMheZj4R8/Z8d9AUopLEK254pMhR snvmcpt1fwOlLxA0PoqipbQqfxUE9rRsgsheoitJ3mDytXt7gef7DmN8rwa+tYt9 GJ/tKC7EEBesXJ9q0LWF1QV3KURXPUl11eJ5RrFtRA5JwCNwHj3xmjsbwMcP0SvN fFdAVuE3gHFd82NaPtKCi3VLAqyf550OfJWKMJOf7IfAPdl4FkJ+KhW8bIROUwj8 pRcJ8U/Fz90N/0Q79BZzykFPOWxThNgP+Kr0DRNzEsrffwJFTvRYV8r7a3pkEEMu hAmPELJHo28d7maiiaxzHzhXHSqdaOXSmJNZRmfA9hCDQTFy70s= =uPE8 -----END PGP SIGNATURE----- --=-=-=--