From 88ca45002dc8a8f689d88cd93346d3f27034f7f0 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Mon, 19 Sep 2022 03:34:05 +0100 Subject: [PATCH] extend/os/linux/install: update old ld.so symlinks --- Library/Homebrew/extend/os/linux/install.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/extend/os/linux/install.rb b/Library/Homebrew/extend/os/linux/install.rb index 0ea7690616..f0b9c858c8 100644 --- a/Library/Homebrew/extend/os/linux/install.rb +++ b/Library/Homebrew/extend/os/linux/install.rb @@ -64,14 +64,19 @@ module Homebrew def symlink_ld_so brew_ld_so = HOMEBREW_PREFIX/"lib/ld.so" - return if brew_ld_so.readable? ld_so = HOMEBREW_PREFIX/"opt/glibc/lib/ld-linux-x86-64.so.2" unless ld_so.readable? ld_so = DYNAMIC_LINKERS.find { |s| File.executable? s } - raise "Unable to locate the system's dynamic linker" unless ld_so + if ld_so.blank? + raise "Unable to locate the system's dynamic linker" unless brew_ld_so.readable? + + return + end end + return if brew_ld_so.readable? && (brew_ld_so.readlink == ld_so) + FileUtils.mkdir_p HOMEBREW_PREFIX/"lib" FileUtils.ln_sf ld_so, brew_ld_so end