diff --git a/Formula/i386-elf-binutils.rb b/Formula/i386-elf-binutils.rb index 597b54b..dc5b2d1 100644 --- a/Formula/i386-elf-binutils.rb +++ b/Formula/i386-elf-binutils.rb @@ -1,9 +1,11 @@ class I386ElfBinutils < Formula desc "GNU Binutils targetting i386-elf" homepage "https://www.gnu.org/software/binutils/" - url "https://sourceware.org/pub/binutils/releases/binutils-2.37.tar.xz" - sha256 "820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c" - revision 2 + url "https://sourceware.org/pub/binutils/releases/binutils-2.42.tar.xz" + sha256 "f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800" + revision 1 + + depends_on "texinfo" => :build def install mkdir "binutils-build" do @@ -11,13 +13,21 @@ def install "--target=i386-elf", "--disable-multilib", "--disable-nls", - "--disable-werror" + "--disable-werror", + "--enable-interwork" system "make" system "make", "install" end end test do - system "#{bin}/i386-elf-as", "--version" + (testpath/"program.S").write <<~DATA + .text + example: + movl 0x80, %eax + movl 0x40, %ebx + DATA + system "#{bin}/i386-elf-as", "program.S" + assert_match "file format elf32-i386", shell_output("#{bin}/i386-elf-objdump -D a.out") end end diff --git a/Formula/i386-elf-gcc.rb b/Formula/i386-elf-gcc.rb index 77934c2..60a5c65 100644 --- a/Formula/i386-elf-gcc.rb +++ b/Formula/i386-elf-gcc.rb @@ -35,7 +35,13 @@ def install end test do - # should try to compile something? - system "#{bin}/i386-elf-gcc", "--version" + (testpath/"program.c").write <<~DATA + int sum(int a, int b) { + return a + b; + } + DATA + system "#{bin}/i386-elf-gcc", "-c", "program.c" + binutils = Formula["nativeos/i386-elf-toolchain/i386-elf-binutils"].prefix + assert_match "file format elf32-i386", shell_output("#{binutils}/bin/i386-elf-objdump -D program.o") end end diff --git a/README.md b/README.md index c3d176b..cf99198 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,10 @@ Default version is marked in bold. For older versions, you must use the @. - i386-elf-binutils - - **2.37 (`nativeos/i386-elf-toolchain/i386-elf-binutils`)** + - **2.42 (`nativeos/i386-elf-toolchain/i386-elf-binutils`)** - 2.36.1 (`nativeos/i386-elf-toolchain/i386-elf-binutils@2.36.1`) - i386-elf-gcc - - **12.2.0 (`nativeos/i386-elf-toolchain/i386-elf-gcc`)** + - **14.1.0 (`nativeos/i386-elf-toolchain/i386-elf-gcc`)** - 11.2.0 (`nativeos/i386-elf-toolchain/i386-elf-gcc@11.2`). - 11.1.0 (`nativeos/i386-elf-toolchain/i386-elf-gcc@11.1`). - i386-elf-gdb