From 2ad3f0a089716048fe5b7bc0984d2835181c8327 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Sun, 2 Jan 2022 13:44:13 -0800 Subject: [PATCH 1/2] Patch neither glibc nor glibc@* using patchelf Patching the dynamic linker of glibc breaks it. --- Library/Homebrew/extend/os/linux/keg_relocate.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/os/linux/keg_relocate.rb b/Library/Homebrew/extend/os/linux/keg_relocate.rb index 1a4fa8845b..633b998330 100644 --- a/Library/Homebrew/extend/os/linux/keg_relocate.rb +++ b/Library/Homebrew/extend/os/linux/keg_relocate.rb @@ -6,7 +6,7 @@ require "compilers" class Keg def relocate_dynamic_linkage(relocation) # Patching the dynamic linker of glibc breaks it. - return if name == "glibc" + return if name == "glibc" || name.start_with?("glibc@") # Patching patchelf fails with "Text file busy" or SIGBUS. return if name == "patchelf" From 06bf91fe0ba4b0428ea2a11895a464d8bf44daef Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Sun, 2 Jan 2022 17:30:34 -0800 Subject: [PATCH 2/2] Use formula_optionally_versioned_regex Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> --- Library/Homebrew/extend/os/linux/keg_relocate.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/os/linux/keg_relocate.rb b/Library/Homebrew/extend/os/linux/keg_relocate.rb index 633b998330..4fafbbd6fa 100644 --- a/Library/Homebrew/extend/os/linux/keg_relocate.rb +++ b/Library/Homebrew/extend/os/linux/keg_relocate.rb @@ -6,7 +6,7 @@ require "compilers" class Keg def relocate_dynamic_linkage(relocation) # Patching the dynamic linker of glibc breaks it. - return if name == "glibc" || name.start_with?("glibc@") + return if name.match? Version.formula_optionally_versioned_regex(:glibc) # Patching patchelf fails with "Text file busy" or SIGBUS. return if name == "patchelf"