From b5ccf8aac22e7bc96a3767b01965df5ef0322adc Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Tue, 9 Nov 2021 20:38:26 -0800 Subject: [PATCH] Do not pass -Wl,-headerpad_max_install_names to b-linux-path One of the more curious bugs, if you use -Wl,-headerpad_max_install_names on linux, it tries to link a library named "eaderpath_max_install_names" in, which causes all kinds of weird havoc. Most notably, gtester inside glib fails to run for bizarre reasons. -Wl,-headerpad_max_install_names is not an option anywhere outside macos anyway, so move it to macos only and avoid the heartache of extremely weild bugs. --- Library/Homebrew/extend/ENV/std.rb | 2 -- Library/Homebrew/extend/os/mac/extend/ENV/std.rb | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index 5f6b5b38f4..e4b4abb6c8 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -55,8 +55,6 @@ module Stdenv # Os is the default Apple uses for all its stuff so let's trust them define_cflags "-Os #{SAFE_CFLAGS_FLAGS}" - append "LDFLAGS", "-Wl,-headerpad_max_install_names" - send(compiler) return unless cc&.match?(GNU_GCC_REGEXP) diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb index 5500df0b5a..d40fcec500 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb @@ -16,6 +16,8 @@ module Stdenv bottle_arch: bottle_arch, testing_formula: testing_formula ) + append "LDFLAGS", "-Wl,-headerpad_max_install_names" + # sed is strict, and errors out when it encounters files with # mixed character sets delete("LC_ALL")