From 32eb84eff246d0e1dc879e9e9e12f1fb91a1f1d8 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 11 Jan 2023 14:28:04 +0100 Subject: [PATCH] coreos: Add a user patch for sys-devel/gcc-config Makes a hack in script not necessary. --- ...elative-paths-for-liblto-and-cc-syml.patch | 47 +++++++++++++++++++ .../sys-devel/gcc-config/README.md | 1 + 2 files changed, 48 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-devel/gcc-config/0001-gcc-config-Use-relative-paths-for-liblto-and-cc-syml.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-devel/gcc-config/README.md diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-devel/gcc-config/0001-gcc-config-Use-relative-paths-for-liblto-and-cc-syml.patch b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-devel/gcc-config/0001-gcc-config-Use-relative-paths-for-liblto-and-cc-syml.patch new file mode 100644 index 0000000000..c745f0b60e --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-devel/gcc-config/0001-gcc-config-Use-relative-paths-for-liblto-and-cc-syml.patch @@ -0,0 +1,47 @@ +From d245197378818f66c978d4427b6d0d81fbfaefc6 Mon Sep 17 00:00:00 2001 +From: Krzesimir Nowak +Date: Thu, 10 Nov 2022 16:45:48 +0100 +Subject: [PATCH] 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 +Closes: https://github.com/gentoo/gcc-config/pull/2 +Signed-off-by: Sam James +--- + gcc-config | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/gcc-config b/gcc-config +index a44fced..f39dd5c 100755 +--- a/gcc-config ++++ b/gcc-config +@@ -345,7 +345,7 @@ update_wrappers() { + # But create our own ${CTARGET}-cc in /usr/bin to avoid fallbacks + # to the symlinks LLVM creates (sys-devel/clang-toolchain-symlinks). + # bug #872416. +- atomic_ln "${EROOT}usr/bin/${CTARGET}-gcc" "${EROOT}usr/bin" "${CTARGET}-cc" ++ atomic_ln "${CTARGET}-gcc" "${EROOT}usr/bin" "${CTARGET}-cc" + + # handle the canonical cpp wrapper + if ! is_cross_compiler ; then +@@ -813,11 +813,12 @@ switch_profile() { + # Update LTO plugin for GCC. Supported as of binutils 2.25. + local BFD_PLUGINS_DIR + local LIBLTO_PLUGIN +- LIBLTO_PLUGIN="${EROOT}usr/libexec/gcc/${CTARGET}/${CC_COMP_VERSION}/liblto_plugin.so" + if is_cross_compiler; then + BFD_PLUGINS_DIR="${EROOT}usr/${CHOST}/${CTARGET}/binutils-bin/lib/bfd-plugins" ++ LIBLTO_PLUGIN="../../../../../libexec/gcc/${CTARGET}/${CC_COMP_VERSION}/liblto_plugin.so" + else + BFD_PLUGINS_DIR="${EROOT}usr/${CHOST}/binutils-bin/lib/bfd-plugins" ++ LIBLTO_PLUGIN="../../../../libexec/gcc/${CTARGET}/${CC_COMP_VERSION}/liblto_plugin.so" + fi + mkdir -p "${BFD_PLUGINS_DIR}" + ln -sf "${LIBLTO_PLUGIN}" "${BFD_PLUGINS_DIR}" +-- +2.25.1 + diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-devel/gcc-config/README.md b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-devel/gcc-config/README.md new file mode 100644 index 0000000000..ab450503dc --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-devel/gcc-config/README.md @@ -0,0 +1 @@ +Drop `0001-gcc-config-Use-relative-paths-for-liblto-and-cc-syml.patch` when we have gcc-config 2.10 or greater.