Created attachment 831367 [details, diff] Patch implementing the relative variant. In Flatcar we are building packages inside `/build/amd64-usr` ROOT, and gcc-config creates symlinks that contain ROOT in their target. Which means that once chrooted into ROOT, those symlinks become dangling: /build/amd64-usr/usr/x86_64-cros-linux-gnu/binutils-bin/lib/bfd-plugins/liblto_plugin.so -> /build/amd64-usr/usr/libexec/gcc/x86_64-cros-linux-gnu/11.3.0/liblto_plugin.so /build/amd64-usr/usr/bin/x86_64-cros-linux-gnu-cc -> /build/amd64-usr/usr/bin/x86_64-cros-linux-gnu-gcc Currently we have a hack to fix up those symlinks (https://github.com/flatcar/scripts/blob/7a7cabf2d933580dfd58cf392970ccf9e485d050/common.sh#L979-L1012). I suppose we wouldn't need this hack if the symlink targets were relative, or didn't use EROOT at all. Please see the attached patches that implement both alternatives. Other possibility could be to remove SYSROOT prefix from the target, but not sure if it's a valid solution. If you prefer me to create a PR on github or need some other information, please let me know. Thanks.
Created attachment 831369 [details, diff] Patch implementing no EROOT variant
Thanks. Would you mind making a PR at https://github.com/gentoo/gcc-config/pulls? It's not required though. I think I prefer the relative option (thanks for providing both).
Filed a PR: https://github.com/gentoo/gcc-config/pull/2
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=d245197378818f66c978d4427b6d0d81fbfaefc6 commit d245197378818f66c978d4427b6d0d81fbfaefc6 Author: Krzesimir Nowak <knowak@microsoft.com> AuthorDate: 2022-11-10 15:45:48 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-01-05 00:16:31 +0000 gcc-config: Use relative paths for liblto and cc symlink targets That way, for ROOT different than / (like /build/amd64-usr) these symlinks won't dangle after chrooting into ROOT. Bug: https://bugs.gentoo.org/880977 Signed-off-by: Krzesimir Nowak <knowak@microsoft.com> Closes: https://github.com/gentoo/gcc-config/pull/2 Signed-off-by: Sam James <sam@gentoo.org> gcc-config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d37acf1855c6dccbab4b9791ae66395c91974f2a commit d37acf1855c6dccbab4b9791ae66395c91974f2a Author: Sam James <sam@gentoo.org> AuthorDate: 2023-01-05 00:18:47 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-01-05 00:18:47 +0000 sys-devel/gcc-config: add 2.10 Closes: https://bugs.gentoo.org/880977 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc-config/Manifest | 1 + sys-devel/gcc-config/gcc-config-2.10.ebuild | 60 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+)