From 53fdb6411337ec322946b65a4800f965c09b6cd8 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 2 Aug 2022 11:02:47 +0800 Subject: [PATCH] keg_relocate (linux): prepend `gcc/lib/current` to `RPATH` when needed This should help keep bottles that require GCC working when Homebrew/homebrew-core#106755 is merged. This only works on freshly-poured bottles. Previously installed bottles will still break on systems with a host GCC older than GCC 11. --- Library/Homebrew/extend/os/linux/keg_relocate.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/extend/os/linux/keg_relocate.rb b/Library/Homebrew/extend/os/linux/keg_relocate.rb index ee1537910c..69061c1199 100644 --- a/Library/Homebrew/extend/os/linux/keg_relocate.rb +++ b/Library/Homebrew/extend/os/linux/keg_relocate.rb @@ -32,6 +32,7 @@ class Keg lib_path = "#{new_prefix}/lib" rpath << lib_path unless rpath.include? lib_path + rpath.prepend HOMEBREW_PREFIX/"opt/gcc/lib/current" if rpath.any? { |rp| rp.match?(%r{lib/gcc/\d+$}) } rpath.join(":") end