i386-elf-binutils: add 64-bit support, rename into x86_64-elf-binutils

master
MRNIU 2019-12-18 08:11:05 +08:00 committed by FX Coudert
parent 7d36ba3527
commit 325ebb8de2
3 changed files with 33 additions and 27 deletions

View File

@ -1,27 +0,0 @@
class I386ElfBinutils < Formula
desc "FSF Binutils for i386-elf cross development"
homepage "https://www.gnu.org/software/binutils/"
url "https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.gz"
mirror "https://ftpmirror.gnu.org/binutils/binutils-2.33.1.tar.gz"
sha256 "98aba5f673280451a09df3a8d8eddb3aa0c505ac183f1e2f9d00c67aa04c6f7d"
bottle do
sha256 "d079ddd99730c921a818fcc4a81066170dd22f23896e218d84b4491362b30032" => :catalina
sha256 "e510d350f717f7bd32523f51d7f3c5860ce501f029882515c8c7c7e530b7325f" => :mojave
sha256 "101befd59a8c93c45213df8f2b8166f3804dc10fa16af7f79d6af3892028fc05" => :high_sierra
end
def install
system "./configure", "--target=i386-elf",
"--disable-multilib",
"--disable-nls",
"--disable-werror",
"--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
assert_match "f()", shell_output("#{bin}/i386-elf-c++filt _Z1fv")
end
end

View File

@ -0,0 +1,32 @@
class X8664ElfBinutils < Formula
desc "FSF Binutils for x86_64-elf cross development"
homepage "https://www.gnu.org/software/binutils/"
url "https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.gz"
mirror "https://ftpmirror.gnu.org/binutils/binutils-2.33.1.tar.gz"
sha256 "98aba5f673280451a09df3a8d8eddb3aa0c505ac183f1e2f9d00c67aa04c6f7d"
def install
system "./configure", "--target=x86_64-elf",
"--enable-targets=all",
"--enable-multilib",
"--enable-64-bit-bfd",
"--disable-werror",
"--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
(testpath/"test-s.s").write <<~EOS
.section .data
.section .text
.globl _start
_start:
movl $1, %eax
movl $4, %ebx
int $0x80
EOS
system "#{bin}/x86_64-elf-as", "--64", "-o", "test-s.o", "test-s.s"
assert_match "file format elf64-x86-64", shell_output("#{Formula["x86_64-elf-binutils"].bin}/x86_64-elf-objdump -a test-s.o")
end
end

View File

@ -91,6 +91,7 @@
"hh": "hstr",
"htop-osx": "htop",
"httpd24": "httpd",
"i386-elf-binutils": "x86_64-elf-binutils",
"influxdb08": "influxdb@0.8",
"isl011": "isl@0.11",
"isl012": "isl@0.12",