From ef5884a769fb9b2394b4b1700ae6edd1588e275c Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sun, 28 Jul 2024 12:23:20 -0400 Subject: [PATCH 1/2] x86_64-elf-gcc: declare indirect deps with linkage Signed-off-by: Rui Chen --- Formula/x/x86_64-elf-gcc.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Formula/x/x86_64-elf-gcc.rb b/Formula/x/x86_64-elf-gcc.rb index 8a961a2c84418..b5737b994e6dc 100644 --- a/Formula/x/x86_64-elf-gcc.rb +++ b/Formula/x/x86_64-elf-gcc.rb @@ -24,6 +24,7 @@ class X8664ElfGcc < Formula depends_on "libmpc" depends_on "mpfr" depends_on "x86_64-elf-binutils" + depends_on "zstd" def install target = "x86_64-elf" @@ -56,8 +57,9 @@ def install return i; } EOS - system "#{bin}/x86_64-elf-gcc", "-c", "-o", "test-c.o", "test-c.c" - assert_match "file format elf64-x86-64", - shell_output("#{Formula["x86_64-elf-binutils"].bin}/x86_64-elf-objdump -a test-c.o") + + system bin/"x86_64-elf-gcc", "-c", "-o", "test-c.o", "test-c.c" + output = shell_output("#{Formula["x86_64-elf-binutils"].bin}/x86_64-elf-objdump -a test-c.o") + assert_match "file format elf64-x86-64", output end end From 5479b1927cfc29bfa5f1b57732d6ccf0793507d2 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sun, 28 Jul 2024 12:21:22 -0400 Subject: [PATCH 2/2] x86_64-elf-gdb: declare indirect deps with linkage Signed-off-by: Rui Chen --- Formula/x/x86_64-elf-gdb.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Formula/x/x86_64-elf-gdb.rb b/Formula/x/x86_64-elf-gdb.rb index e4e5f2f5b11a2..46292d19882de 100644 --- a/Formula/x/x86_64-elf-gdb.rb +++ b/Formula/x/x86_64-elf-gdb.rb @@ -22,11 +22,14 @@ class X8664ElfGdb < Formula end depends_on "x86_64-elf-gcc" => :test + depends_on "gmp" depends_on "mpfr" depends_on "python@3.12" depends_on "xz" # required for lzma support + uses_from_macos "expat" + uses_from_macos "ncurses" uses_from_macos "zlib" on_system :linux, macos: :ventura_or_newer do @@ -60,7 +63,8 @@ def install test do (testpath/"test.c").write "void _start(void) {}" system "#{Formula["x86_64-elf-gcc"].bin}/x86_64-elf-gcc", "-g", "-nostdlib", "test.c" - assert_match "Symbol \"_start\" is a function at address 0x", - shell_output("#{bin}/x86_64-elf-gdb -batch -ex 'info address _start' a.out") + + output = shell_output("#{bin}/x86_64-elf-gdb -batch -ex 'info address _start' a.out") + assert_match "Symbol \"_start\" is a function at address 0x", output end end