Skip to content

Commit

Permalink
Merge pull request #178774 from Homebrew/i686-elf-gcc-linkage
Browse files Browse the repository at this point in the history
i686-elf-gcc, i386-elf-gdb: declare indirect deps with linkage
  • Loading branch information
chenrui333 authored Jul 28, 2024
2 parents ef9b2fc + 68d29ec commit 5b19e68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions Formula/i/i386-elf-gdb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class I386ElfGdb < Formula
depends_on "[email protected]"
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
Expand Down Expand Up @@ -60,7 +62,8 @@ def install
test do
(testpath/"test.c").write "void _start(void) {}"
system Formula["i686-elf-gcc"].bin/"i686-elf-gcc", "-g", "-nostdlib", "test.c"
assert_match "Symbol \"_start\" is a function at address 0x",
shell_output("#{bin}/i386-elf-gdb -batch -ex 'info address _start' a.out")

output = shell_output("#{bin}/i386-elf-gdb -batch -ex 'info address _start' a.out")
assert_match "Symbol \"_start\" is a function at address 0x", output
end
end
8 changes: 5 additions & 3 deletions Formula/i/i686-elf-gcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class I686ElfGcc < Formula
depends_on "i686-elf-binutils"
depends_on "libmpc"
depends_on "mpfr"
depends_on "zstd"

def install
target = "i686-elf"
Expand Down Expand Up @@ -56,8 +57,9 @@ def install
return i;
}
EOS
system "#{bin}/i686-elf-gcc", "-c", "-o", "test-c.o", "test-c.c"
assert_match "file format elf32-i386",
shell_output("#{Formula["i686-elf-binutils"].bin}/i686-elf-objdump -a test-c.o")

system bin/"i686-elf-gcc", "-c", "-o", "test-c.o", "test-c.c"
output = shell_output("#{Formula["i686-elf-binutils"].bin}/i686-elf-objdump -a test-c.o")
assert_match "file format elf32-i386", output
end
end

0 comments on commit 5b19e68

Please sign in to comment.