From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8903A15800F for ; Fri, 20 Jan 2023 23:11:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0ADEDE08C3; Fri, 20 Jan 2023 23:11:47 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C0EB4E086F for ; Fri, 20 Jan 2023 23:11:46 +0000 (UTC) Message-ID: <390111c9eb59ef289a15a2c71f75cc4ce7f5b51a.camel@gentoo.org> Subject: [gentoo-dev] NEWS: Breaking changes to the RAP Prefix toolchain From: James Le Cuirot To: gentoo-dev Cc: pr@gentoo.org Date: Fri, 20 Jan 2023 23:11:23 +0000 Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-gLKfkVbr4fVcC4Qpbtnr" User-Agent: Evolution 3.46.3 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: 107c7370-7da8-49cf-a684-8a478c25360d X-Archives-Hash: d113bf886e19b62dd5e4817fe5bfc654 --=-gLKfkVbr4fVcC4Qpbtnr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The context for this is a pull request I've been working on for a few weeks= . https://github.com/gentoo/gentoo/pull/28851 RAP prefix nobbled gcc/clang's sysroot when invoking the linker because gli= bc installed its linker scripts with prefixed paths, such as /path/to/prefix/l= ib rather than just /lib. Adjusting the linker scripts rather than the compile= r behaviour is more natural and makes cross-compiling far easier. For the migration procedure, I did try a different approach of manually fix= ing up the linker scripts, but if you do this first, the gcc build fails immediately, and if you do this afterwards, the gcc build fails later. A symlink is therefore needed to allow the sysroot to be applied, even when t= he linker script paths are still prefixed. Unfortunately, it's not possible to filter news items on USE flags or even profile parents, so I've had to resort to explicitly listing all the prefix profiles. Prefix is quite a niche feature, so I don't want to show this new= s to everyone. ---- Title: Breaking changes to the RAP Prefix toolchain Author: James Le Cuirot Posted: 2023-01-20 Revision: 1 News-Item-Format: 2.0 Display-If-Profile: default/linux/amd64/17.0/no-multilib/prefix/* Display-If-Profile: default/linux/amd64/17.1/no-multilib/prefix/* Display-If-Profile: default/linux/amd64/23.0/no-multilib/prefix/* Display-If-Profile: default/linux/amd64/23.0/split-usr/no-multilib/prefix/* Display-If-Profile: default/linux/arm/17.0/armv7a/prefix/* Display-If-Profile: default/linux/arm/23.0/armv7a/prefix/* Display-If-Profile: default/linux/arm/23.0/split-usr/armv7a/prefix/* Display-If-Profile: default/linux/arm64/17.0/prefix/* Display-If-Profile: default/linux/arm64/23.0/prefix/* Display-If-Profile: default/linux/arm64/23.0/split-usr/prefix/* Display-If-Profile: default/linux/ppc64le/17.0/prefix/* Display-If-Profile: default/linux/riscv/20.0/rv64gc/lp64d/prefix/* Display-If-Profile: default/linux/riscv/23.0/rv64/lp64d/prefix/* Display-If-Profile: default/linux/riscv/23.0/rv64/split-usr/lp64d/prefix/* Display-If-Profile: default/linux/x86/17.0/prefix/* Display-If-Profile: default/linux/x86/23.0/prefix/* Display-If-Profile: default/linux/x86/23.0/split-usr/prefix/* We are changing the way the toolchain operates on RAP Prefix systems in ord= er to reduce the number of hacks we need to apply and make cross-compiling easier= . If you using a non-RAP "Prefix Guest" or "Prefix Stack" variant (e.g. macOS= ) then this does not apply. If you are using a libc other than glibc (e.g. musl) then this *does* apply= , but your libc will *not* break, so you should not carry out the following proce= dure. The only other package known to be affected is dev-libs/libbsd, which you c= an simply update. If you find another package affected by this, then please fi= le a bug report. WARNING! It is important that you carry out the following procedure, otherw= ise your toolchain will break when you next update your compiler or glibc. 1. Run the following to create a temporary symlink: EPREFIX=3D$(portageq envvar EPREFIX) mkdir -p "${EPREFIX}${EPREFIX%/*}" ln -sn "${EPREFIX}" "${EPREFIX}${EPREFIX}" 2. Update or rebuild all installed slots of sys-devel/gcc and sys-devel/c= lang (if any). Feel free to remove any you no longer need. 3. Update or rebuild sys-libs/glibc. 4. Run the following to remove the symlink: EPREFIX=3D$(portageq envvar EPREFIX) rm "${EPREFIX}${EPREFIX}" 5. If dev-libs/libbsd is installed, then update it to 0.11.7-r2 or later. If you are reading this having updated glibc first and you are no longer ab= le to build anything, then don't panic. Simply execute the line below and then ca= rry out the regular procedure above. qlist sys-libs/glibc | xargs grep -lIF "GNU ld script" | xargs sed -i -r = "s: /(usr|lib): $(portageq envvar EPREFIX)/\1:g" --=-gLKfkVbr4fVcC4Qpbtnr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQJFBAABCAAvFiEEPxcZ3tkwcedKm2a8EiZBXQDdMTcFAmPLH5sRHGNoZXdpQGdl bnRvby5vcmcACgkQEiZBXQDdMTc1BQ//c1mICfQNiuiRVMNu+kXt/hqMQYDbnvyG +AdlT/D8Z0ybaI8ibc/xe8HWzRgdpqxZL7OnBDI7NmJcH4KHRzcDpmlEWZMCBFeH tMtW2wo36cZ/UbzNiRYPu9jkSzgftHZHcoVutrLYU5jwQWq1Utp8oweaeV2mJR+q Cw3GGhfSwdzAV9ITxiDIwZqS5B5l0s0yYUNvzKV9NjZfXs4TAEn0NW+2nQ5RMuBA 4ThGq/ah1vXWANOBtKlOfM6N+NLilUPqNu1Xz06xMHIud28PruJJyt1bYNhZydyS 8bDQUKXrZ2U1Zahdmg7XujzYHPTFcFkn66ZHs3Qfd4aPQRd15x3ArGrher4dWGaT 0eMm7rbbtI0/dYe1dWCP3VZMGT2SyudLc6rtFgndoq5JL2fyFmLd1j3DKYO9z8m1 ksYwi9fHBqKIHI7gvEgCEuM9F+DPNzrb7km0aig2bTCgNYwB7RhT6MnGeT4Ecjwp O0gWLww8Eb8nSC9bBit+OkddlPoBcK/ELKb+2qHtjEztCjG3auQJf5H/HTAdJwlV k/vjeYXnQ8q/XzZe3LDYwr87y3uKcw2zJflhcify1VFykt9H1wGvUe/IeeCZeMZd 1YxUdx5dSWeXG8WagEPtvNmqTdRlei6bZGmQd8Ab8nLAgckTdx+pqEFjSB0gS2x5 t3HkEHM/Qk0= =r9Nd -----END PGP SIGNATURE----- --=-gLKfkVbr4fVcC4Qpbtnr--