Skip to content

Commit

Permalink
Update binutils as well
Browse files Browse the repository at this point in the history
  • Loading branch information
danirod committed May 30, 2024
1 parent 467f106 commit 878e9b5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
20 changes: 15 additions & 5 deletions Formula/i386-elf-binutils.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
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
system "../configure", "--prefix=#{prefix}",
"--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
10 changes: 8 additions & 2 deletions Formula/i386-elf-gcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]`)
- 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/[email protected]`).
- 11.1.0 (`nativeos/i386-elf-toolchain/[email protected]`).
- i386-elf-gdb
Expand Down

0 comments on commit 878e9b5

Please sign in to comment.