Skip to content

Commit b4e93f0

Browse files
committed
binutils: symlink ld.so.conf
1 parent 07d2fbf commit b4e93f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Formula/b/binutils.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class Binutils < Formula
2424
uses_from_macos "bison" => :build
2525
uses_from_macos "zlib"
2626

27+
skip_clean "etc/ld.so.conf"
28+
2729
link_overwrite "bin/dwp"
2830

2931
def install
@@ -61,9 +63,13 @@ def install
6163
bin_files = bin.children.select(&:elf?)
6264
system "strip", *bin_files, *lib.glob("*.a")
6365
end
66+
67+
# Allow ld to find brew glibc. A broken symlink falls back to /etc/ld.so.conf
68+
(prefix/"etc").install_symlink etc/"ld.so.conf" if OS.linux?
6469
end
6570

6671
test do
6772
assert_match "Usage:", shell_output("#{bin}/strings #{bin}/strings")
73+
assert_predicate prefix/"etc/ld.so.conf", :symlink? if OS.linux?
6874
end
6975
end

0 commit comments

Comments
 (0)