Skip to content

Commit

Permalink
arm-none-eabi-gcc 13.2.0 (new formula)
Browse files Browse the repository at this point in the history
Added GCC for the 32-bit ARM baremetal toolchain.
  • Loading branch information
glingy committed Aug 3, 2023
1 parent 22a1404 commit 94f5a52
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions Formula/arm-none-eabi-gcc.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
class ArmNoneEabiGcc < Formula
desc "GNU compiler collection for arm-none-eabi"
homepage "https://gcc.gnu.org"
url "https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz"

This comment has been minimized.

Copy link
@yiyah

yiyah Aug 19, 2023

hi, I think this link is incorrect.
arm-none-eabi-gcc is work on last month(version is V10.3).
But I found �it is V13.2 now, and work abnormal.

sha256 "e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da"
license "GPL-3.0-or-later" => { with: "GCC-exception-3.1" }

livecheck do
formula "gcc"
end

depends_on "arm-none-eabi-binutils"
depends_on "gmp"
depends_on "libmpc"
depends_on "mpfr"

def install
target = "arm-none-eabi"
mkdir "arm-none-eabi-gcc-build" do
system "../configure", "--target=#{target}",
"--prefix=#{prefix}",
"--infodir=#{info}/#{target}",
"--disable-nls",
"--without-isl",
"--without-headers",
"--with-as=#{Formula["arm-none-eabi-binutils"].bin}/arm-none-eabi-as",
"--with-ld=#{Formula["arm-none-eabi-binutils"].bin}/arm-none-eabi-ld",
"--enable-languages=c,c++"
system "make", "all-gcc"
system "make", "install-gcc"
system "make", "all-target-libgcc"
system "make", "install-target-libgcc"

# FSF-related man pages may conflict with native gcc
(share/"man/man7").rmtree
end
end

test do
(testpath/"test-c.c").write <<~EOS
int main(void)
{
int i=0;
while(i<10) i++;
return i;
}
EOS
system "#{bin}/arm-none-eabi-gcc", "-c", "-o", "test-c.o", "test-c.c"
assert_match "file format elf32-littlearm",
shell_output("#{Formula["arm-none-eabi-binutils"].bin}/arm-none-eabi-objdump -a test-c.o")
end
end

0 comments on commit 94f5a52

Please sign in to comment.