├── LICENSE ├── README.md ├── common └── arch.sh ├── generic ├── install.sh └── install_all.sh ├── macos ├── binutils-aarch64.rb ├── binutils-alpha.rb ├── binutils-amd64.rb ├── binutils-arm.rb ├── binutils-avr.rb ├── binutils-cris.rb ├── binutils-hppa.rb ├── binutils-i386.rb ├── binutils-ia64.rb ├── binutils-m68k.rb ├── binutils-mips.rb ├── binutils-mips64.rb ├── binutils-msp430.rb ├── binutils-powerpc.rb ├── binutils-powerpc64.rb ├── binutils-s390.rb ├── binutils-sparc.rb ├── binutils-sparc64.rb ├── binutils-vax.rb ├── binutils-x86_64.rb ├── binutils-xscale.rb ├── generate.sh ├── install.sh ├── install_all.sh ├── upgrade.sh └── upgrade_all.sh └── ubuntu ├── generate.sh ├── install.sh └── install_all.sh /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Zach Riggle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pwntools binutils scripts 2 | 3 | [`pwntools`](https://pwntools.com) depends on `binutils` in order to perform assembly and disassembly of various architectures. 4 | 5 | This is a repository of binutils installation scripts for various operating systems, specifically for cross-installations (e.g. assembling VAX on macOS). 6 | 7 | Select the directory that corresponds to your operating system, and run `install.sh`. If you're curious or want to audit our methodology files used by `install.sh` are generated with `generate.sh`. 8 | 9 | ## Ubuntu 10 | 11 | > **NOTE**: As of Ubuntu 16.04 (Xenial), there are [packages for most architectures](https://launchpad.net/ubuntu/xenial/+source/binutils) available directly form Ubuntu. 12 | You should just be able to `apt-get install binutils-arm-gnueabihf binutils-mipsel-linux-gnu`. 13 | 14 | The Ubuntu installation process uses a [Personal Package Archive (PPA) hosted by Ubuntu's Launchpad](https://launchpad.net/~pwntools/+archive/ubuntu/binutils). These work by modifying a single `binutils-cross` `.deb` source archive, and changing the architecture. 15 | 16 | No source code is changed, as the `binutils-cross` targets rely on the `binutils-source` package being installed, which is completely separate. 17 | 18 | The builds are performed by Ubuntu, on Ubuntu's servers, against digitally signed source changes uploaded by pwntools maintainers. 19 | 20 | ## macOS 21 | 22 | The macOS installation process uses the [`homebrew`](https://brew.sh) package manager to build binutils from source. 23 | 24 | The scripts generated are based on the original [binutils recipe](https://github.com/Homebrew/homebrew-core/blob/master/Formula/binutils.rb) used by `homebrew`. 25 | 26 | The binaries are built on your machine, with source fetched directly from the gnu.org server. 27 | -------------------------------------------------------------------------------- /common/arch.sh: -------------------------------------------------------------------------------- 1 | export ARCHES="aarch64 alpha arm avr cris hppa ia64 m68k mips mips64 msp430 powerpc powerpc64 s390 sparc vax xscale i386 x86_64" 2 | -------------------------------------------------------------------------------- /generic/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source ../common/arch.sh 3 | 4 | if [[ $# -ne 1 ]]; 5 | then 6 | echo "usage: $0 architecture" 7 | else 8 | 9 | TARGET=$1 10 | V=2.34 11 | 12 | cd /tmp 13 | wget -nc https://ftp.gnu.org/gnu/binutils/binutils-$V.tar.gz 14 | wget -nc https://ftp.gnu.org/gnu/binutils/binutils-$V.tar.gz.sig 15 | 16 | gpg --keyserver keys.gnupg.net --recv-keys 13FCEF89DD9E3C4F 17 | gpg --verify binutils-$V.tar.gz.sig 18 | 19 | tar xf binutils-$V.tar.gz 20 | 21 | rm -rf binutils-build 22 | mkdir binutils-build 23 | cd binutils-build 24 | export AR=ar 25 | export AS=as 26 | 27 | ../binutils-$V/configure \ 28 | --prefix=/usr/local \ 29 | --target=$TARGET-unknown-linux-gnu \ 30 | --disable-static \ 31 | --disable-multilib \ 32 | --disable-werror \ 33 | --disable-nls 34 | 35 | MAKE=gmake 36 | hash gmake || MAKE=make 37 | 38 | $MAKE -j 39 | sudo $MAKE install 40 | 41 | fi 42 | -------------------------------------------------------------------------------- /generic/install_all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source ../common/arch.sh 3 | 4 | for arch in $ARCHES; do 5 | bash install.sh $arch 6 | done -------------------------------------------------------------------------------- /macos/binutils-aarch64.rb: -------------------------------------------------------------------------------- 1 | class BinutilsAarch64 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=aarch64-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-alpha.rb: -------------------------------------------------------------------------------- 1 | class BinutilsAlpha < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=alpha-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-amd64.rb: -------------------------------------------------------------------------------- 1 | class BinutilsAmd64 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=amd64-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-arm.rb: -------------------------------------------------------------------------------- 1 | class BinutilsArm < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=arm-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-avr.rb: -------------------------------------------------------------------------------- 1 | class BinutilsAvr < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=avr-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-cris.rb: -------------------------------------------------------------------------------- 1 | class BinutilsCris < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=cris-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-hppa.rb: -------------------------------------------------------------------------------- 1 | class BinutilsHppa < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=hppa-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-i386.rb: -------------------------------------------------------------------------------- 1 | class BinutilsI386 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=i386-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-ia64.rb: -------------------------------------------------------------------------------- 1 | class BinutilsIa64 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=ia64-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-m68k.rb: -------------------------------------------------------------------------------- 1 | class BinutilsM68k < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=m68k-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-mips.rb: -------------------------------------------------------------------------------- 1 | class BinutilsMips < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=mips-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-mips64.rb: -------------------------------------------------------------------------------- 1 | class BinutilsMips64 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=mips64-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-msp430.rb: -------------------------------------------------------------------------------- 1 | class BinutilsMsp430 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=msp430-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-powerpc.rb: -------------------------------------------------------------------------------- 1 | class BinutilsPowerpc < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=powerpc-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-powerpc64.rb: -------------------------------------------------------------------------------- 1 | class BinutilsPowerpc64 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=powerpc64-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-s390.rb: -------------------------------------------------------------------------------- 1 | class BinutilsS390 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=s390-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-sparc.rb: -------------------------------------------------------------------------------- 1 | class BinutilsSparc < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=sparc-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-sparc64.rb: -------------------------------------------------------------------------------- 1 | class BinutilsSparc64 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=sparc64-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-vax.rb: -------------------------------------------------------------------------------- 1 | class BinutilsVax < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=vax-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-x86_64.rb: -------------------------------------------------------------------------------- 1 | class BinutilsX8664 < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=x86_64-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/binutils-xscale.rb: -------------------------------------------------------------------------------- 1 | class BinutilsXscale < Formula 2 | homepage "https://www.gnu.org/software/binutils/binutils.html" 3 | url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz" 4 | mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" 5 | sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" 6 | 7 | # No --default-names option as it interferes with Homebrew builds. 8 | 9 | def install 10 | system "./configure", "--disable-debug", 11 | "--disable-dependency-tracking", 12 | "--prefix=#{prefix}", 13 | "--target=xscale-unknown-linux-gnu", 14 | "--disable-static", 15 | "--disable-multilib", 16 | "--disable-nls", 17 | "--disable-werror" 18 | system "make", "MAKEINFO=true", "-j" 19 | system "make", "MAKEINFO=true", "install" 20 | system "rm", "-rf", "#{prefix}/share/info" 21 | end 22 | 23 | test do 24 | assert .include? 'main' 25 | assert_equal 0, 0.exitstatus 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /macos/generate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source ../common/arch.sh 3 | 4 | title_case() 5 | { 6 | python -c 'import sys;import re; print(" ".join(map(str.capitalize, [sys.argv[1].replace("_", "")])))' $* 7 | } 8 | 9 | for arch in $ARCHES; do 10 | 11 | file=binutils-$arch.rb 12 | 13 | cat > $file <