diff --git a/Formula/x86_64-linux-gnu-binutils.rb b/Formula/x86_64-linux-gnu-binutils.rb new file mode 100644 index 00000000000..ef7d129508d --- /dev/null +++ b/Formula/x86_64-linux-gnu-binutils.rb @@ -0,0 +1,49 @@ +class X8664LinuxGnuBinutils < Formula + desc "GNU Binutils for x86_64-linux-gnu cross development" + homepage "https://www.gnu.org/software/binutils/binutils.html" + url "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.xz" + mirror "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.xz" + sha256 "e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024" + license "GPL-3.0-or-later" + + livecheck do + formula "binutils" + end + + uses_from_macos "texinfo" + + def install + ENV.cxx11 + + # Avoid build failure: https://sourceware.org/bugzilla/show_bug.cgi?id=23424 + ENV.append "CXXFLAGS", "-Wno-c++11-narrowing" + + target = "x86_64-linux-gnu" + system "./configure", "--disable-debug", + "--disable-dependency-tracking", + "--enable-deterministic-archives", + "--prefix=#{prefix}", + "--libdir=#{lib/target}", + "--infodir=#{info/target}", + "--disable-werror", + "--target=#{target}", + "--enable-gold=yes", + "--enable-ld=yes", + "--enable-interwork", + "--with-system-zlib", + "--disable-nls" + system "make" + system "make", "install" + end + + test do + assert_match "f()", shell_output("#{bin}/x86_64-linux-gnu-c++filt _Z1fv") + return if OS.linux? + + (testpath/"hello.c").write <<~EOS + void hello() {} + EOS + system ENV.cc, "--target=x86_64-pc-linux-gnu", "-c", "hello.c" + assert_match "hello", shell_output("#{bin}/x86_64-linux-gnu-nm hello.o") + end +end diff --git a/synced_versions_formulae.json b/synced_versions_formulae.json index eb827769aff..445f3ca5cd2 100644 --- a/synced_versions_formulae.json +++ b/synced_versions_formulae.json @@ -1,5 +1,12 @@ [ ["aarch64-elf-gcc", "i686-elf-gcc", "x86_64-elf-gcc"], + [ + "aarch64-elf-binutils", + "arm-linux-gnueabihf-binutils", + "i686-elf-binutils", + "x86_64-elf-binutils", + "x86_64-linux-gnu-binutils" + ], ["apache-arrow", "apache-arrow-glib"], ["apache-pulsar", "libpulsar"], ["avro-c", "avro-cpp", "avro-tools"],