From b2cc1720f8e8fe9d64549aafa7a26ca70d487a00 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Fri, 2 Sep 2022 22:03:22 +0800 Subject: [PATCH] Add comment explaining `gcc` exception for undeclared_deps. --- Library/Homebrew/extend/os/linux/linkage_checker.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/extend/os/linux/linkage_checker.rb b/Library/Homebrew/extend/os/linux/linkage_checker.rb index 2603ed0d9a..b708cf23a9 100644 --- a/Library/Homebrew/extend/os/linux/linkage_checker.rb +++ b/Library/Homebrew/extend/os/linux/linkage_checker.rb @@ -81,6 +81,13 @@ class LinkageChecker SYSTEM_LIBRARY_ALLOWLIST.include? File.basename(s) end + # We build all formulae with an RPATH that includes the gcc formula's runtime lib directory. + # See: https://github.com/Homebrew/brew/blob/e689cc07/Library/Homebrew/extend/os/linux/extend/ENV/super.rb#L53 + # This results in formulae showing linkage with gcc whenever it is installed, even if no dependency is declared. + # See discussions at: + # https://github.com/Homebrew/brew/pull/13659 + # https://github.com/Homebrew/brew/pull/13796 + # TODO: Find a nicer way to handle this. (e.g. examining the ELF file to determine the required libstdc++.) @undeclared_deps.delete("gcc") end end