Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions Formula/[email protected]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class AvrGccAT9 < Formula
desc "GNU compiler collection for AVR 8-bit and 32-bit Microcontrollers"
homepage "https://gcc.gnu.org/"
Expand All @@ -7,23 +7,13 @@
sha256 "c95da32f440378d7751dd95533186f7fc05ceb4fb65eb5b85234e6299eb9838e"

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

head "https://gcc.gnu.org/git/gcc.git", branch: "releases/gcc-9"

bottle do
root_url "https://github.com/osx-cross/homebrew-avr/releases/download/[email protected]_1"
sha256 arm64_sonoma: "bd400587fee5d1f34c41de95d80a2e0bd99eb350902e1c535c1ae332a5107f00"
sha256 ventura: "d057720b566d688fd97c5c2293fc07090da0e6988c677abe894e132471243589"
sha256 monterey: "74ce93105e38ff9a61383348924d603f18d41cd7440822ec7337ee6aa9609f8f"
end

# The bottles are built on systems with the CLT installed, and do not work
# out of the box on Xcode-only systems due to an incorrect sysroot.
pour_bottle? only_if: :clt_installed

option "with-ATMega168pbSupport", "Add ATMega168pb Support to avr-gcc"

# automake & autoconf are needed to build from source
# with the ATMega168pbSupport option.
depends_on "autoconf" => :build
Expand All @@ -40,19 +30,9 @@
# GCC bootstraps itself, so it is OK to have an incompatible C++ stdlib
cxxstdlib_check :skip

current_build = build

resource "avr-libc" do
url "https://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.1.0.tar.bz2"
mirror "https://download-mirror.savannah.gnu.org/releases/avr-libc/avr-libc-2.1.0.tar.bz2"
sha256 "0b84cee5c08b5d5cba67c36125e5aaa85251bc9accfba5773bfa87bc34b654e8"

if current_build.with? "ATMega168pbSupport"
patch do
url "https://raw.githubusercontent.com/osx-cross/homebrew-avr/d2e2566b06b90355952ed996707a0a1a24673cd3/Patch/avr-libc-add-mcu-atmega168pb.patch"
sha256 "7a2bf2e11cfd9335e8e143eecb94480b4871e8e1ac54392c2ee2d89010b43711"
end
end
url "https://github.com/avrdudes/avr-libc/releases/download/avr-libc-2_2_1-release/avr-libc-2.2.1.tar.bz2"
sha256 "006a6306cbbc938c3bdb583ac54f93fe7d7c8cf97f9cde91f91c6fb0273ab465"
end

# This patch fixes a GCC compilation error on Apple ARM systems by adding
Expand All @@ -62,7 +42,7 @@
sha256 "c4e9df9802772ddecb71aa675bb9403ad34c085d1359cb0e45b308ab6db551c6"
end

def install

Check warning on line 45 in Formula/[email protected]

View workflow job for this annotation

GitHub Actions / test-bot (macos-15)

`brew install --verbose --formula --build-bottle osx-cross/avr/avr-gcc@9` failed on macOS Sequoia (15) on Apple Silicon!

> tmp-enums.c /bin/sh ../../gcc/../move-if-change tmp-constants.h insn-constants.h /bin/sh ../../gcc/../move-if-change tmp-enums.c insn-enums.c echo timestamp > s-enums echo timestamp > s-constants clang++: error: unsupported option '-print-multi-os-directory' checking for socket libraries... checking for connect... clang++ -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -no-pie -o build/gencfn-macros \ build/gencfn-macros.o build/errors.o build/hash-table.o build/vec.o build/ggc-none.o build/sort.o ../build-arm-apple-darwin24.5.0/libiberty/libiberty.a clang++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/genpreds.o ../../gcc/genpreds.c clang++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/rtl.o ../../gcc/rtl.c yes checking for gethostbyname... yes checking for exported symbols... clang++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/read-rtl.o ../../gcc/read-rtl.c clang++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/gensupport.o ../../gcc/gensupport.c yes checking for library containing dlopen... none required checking for -fPIC -shared... yes checking for socketpair... clang++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/print-rtl.o ../../gcc/print-rtl.c clang++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/genflags.o ../../gcc/genflags.c yes checking for select... yes checking for fork... clang++ -c -g

Check warning on line 45 in Formula/[email protected]

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

`brew install --verbose --formula --build-bottle osx-cross/avr/avr-gcc@9` failed on macOS Sonoma (14) on Apple Silicon!

-o build/hash-table.o ../../gcc/hash-table.c checking whether clang supports -W... clang++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/gencfn-macros.o ../../gcc/gencfn-macros.c yes checking whether clang supports -Wall... yes clang: error: unsupported option '-print-multi-os-directory' checking for socket libraries... checking for connect... clang++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/inchash.o ../../gcc/inchash.c yes checking for gethostbyname... clang++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/genenums.o ../../gcc/genenums.c clang++ -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -no-pie -o build/genmddeps \ build/genmddeps.o build/read-md.o build/errors.o ../build-arm-apple-darwin23.6.0/libiberty/libiberty.a yes checking for exported symbols... clang++ -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -no-pie -o build/genconstants \ build/genconstants.o build/read-md.o build/errors.o ../build-arm-apple-darwin23.6.0/libiberty/libiberty.a clang++ -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -no-pie -o build/gencfn-macros \ build/gencfn-macros.o build/errors.o build/hash-table.o build/vec.o build/ggc-none.o build/sort.o ../build-arm-apple-darwin23.6.0/libiberty/libiberty.a yes checking for library containing dlopen... clang++ -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -no-pie -o build/genenums \ build/genenums.o build/read-md.o build/errors.o ../build-arm-apple-darwin23.6.0/libiberty/libiberty.a build/genmddeps ../../gcc/common.md ../../gcc/config/avr/avr.md > tmp-mddeps /bin/sh ../../gcc/../move-if-change tmp-mddeps mddeps.mk echo timestamp > s-mddeps build/gencfn-macros -c \ > tmp-case-cfn-macros.h /bin/s
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"

Expand Down Expand Up @@ -124,8 +104,6 @@
rm_r(info)
rm_r(man7)

current_build = build

resource("avr-libc").stage do
ENV.prepend_path "PATH", bin

Expand All @@ -142,7 +120,6 @@
puts "Forcing build system to aarch64-apple-darwin."
end

system "./bootstrap" if current_build.with? "ATMega168pbSupport"
system "./configure", "--prefix=#{prefix}", "--host=avr"
system "make", "install"
end
Expand Down
Loading