From 812b9fee090e88a7fb6986fa3a18767f64bc56e4 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Wed, 4 Jan 2023 19:57:26 -0800 Subject: [PATCH] gcc@10: fix build on arm64 linux Closes #119825. Signed-off-by: Patrick Linnane Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/gcc@10.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Formula/gcc@10.rb b/Formula/gcc@10.rb index fc5b3c9a01a..0ec08fdaf03 100644 --- a/Formula/gcc@10.rb +++ b/Formula/gcc@10.rb @@ -23,7 +23,6 @@ class GccAT10 < Formula # out of the box on Xcode-only systems due to an incorrect sysroot. pour_bottle? only_if: :clt_installed - depends_on arch: :x86_64 depends_on "gmp" depends_on "isl" depends_on "libmpc" @@ -31,6 +30,10 @@ class GccAT10 < Formula uses_from_macos "zlib" + on_macos do + depends_on arch: :x86_64 + end + on_linux do depends_on "binutils" end @@ -103,7 +106,11 @@ class GccAT10 < Formula # Change the default directory name for 64-bit libraries to `lib` # https://www.linuxfromscratch.org/lfs/view/development/chapter06/gcc-pass2.html - inreplace "gcc/config/i386/t-linux64", "m64=../lib64", "m64=" + if Hardware::CPU.arm? + inreplace "gcc/config/aarch64/t-aarch64-linux", "lp64=../lib64", "lp64=" + else + inreplace "gcc/config/i386/t-linux64", "m64=../lib64", "m64=" + end end mkdir "build" do