Open P1nkz opened 6 years ago
Fails to build for me as well on G5/10.5.8 as well.
I have the same problem.
Looking like a linker problem. If you add depends_on :ld64
to the dependencies in the qemu.rb
file, does that fix it?
No Here is the top of qemu.rb file: class Qemu < Formula desc "x86 and PowerPC Emulator" homepage "http://wiki.qemu.org"
url "http://wiki.qemu-project.org/download/qemu-2.2.1.tar.bz2" sha256 "4617154c6ef744b83e10b744e392ad111dd351d435d6563ce24d8da75b1335a0" head "git://git.qemu-project.org/qemu.git"
depends_on "make" => :build if MacOS.version < :leopard depends_on :ld64 depends_on "pkg-config" => :build depends_on "libtool" => :build depends_on "jpeg" depends_on "gnutls" depends_on "glib" depends_on "pixman" depends_on "vde" => :optional depends_on "sdl" => :optional
depends_on "gtk+" => :optional
depends_on "libssh2" => :optional
to test qemu functionality. resource "armtest" do url "http://wiki.qemu.org/download/arm-test-0.2.tar.gz" sha256 "4b4c2dce4c055f0a2adb93d571987a3d40c96c6cbfd9244d19b9708ce5aea454" end
def install ENV["LIBTOOL"] = "glibtool"
if MacOS.version < :leopard
# Needed for certain stdint macros on 10.4 ENV.append_to_cflags "-D__STDC_CONSTANT_MACROS"
# Make 3.80 does not support the `or` operator and has trouble evaluating `unnest-vars`
# See https://github.com/mistydemeo/tigerbrew/pull/496
ENV["MAKE"] = make_path
end
args = %W[ --prefix=#{prefix} --cc=#{ENV.cc} --host-cc=#{ENV.cc} --disable-bsd-user --disable-guest-agent ]
# Cocoa UI uses features that require 10.5 or newer
if MacOS.version > :tiger
args << "--enable-cocoa"
else
args << "--disable-cocoa"
end
# qemu will try to build 64-bit on 64-bit hardware, but we might not want that
args << "--cpu=#{Hardware::CPU.arch_32_bit}" unless MacOS.prefer_64_bit?
args << (build.with?("sdl") ? "--enable-sdl" : "--disable-sdl")
args << (build.with?("vde") ? "--enable-vde" : "--disable-vde")
args << (build.with?("gtk+") ? "--enable-gtk" : "--disable-gtk")
args << (build.with?("libssh2") ? "--enable-libssh2" : "--disable-libssh2")
system "./configure", *args
make "V=1", "install"
end
test do resource("armtest").stage testpath assert_match /file format: raw/, shell_output("#{bin}/qemu-img info arm_root.img") end end
Many of the .o files and one .dylib are for a different archuitecture.Could this cause a issue?
I no longer have a 10.5.8 install
Building with the --cc=gcc-7
flag specified fixes this issue on 10.5.8.
Karen002ppc-osx105:local karen$ time brew install qemu --cc=gcc-7 --with-vde
==> Downloading http://wiki.qemu-project.org/download/qemu-2.2.1.tar.bz2
Already downloaded: /Users/karen/Library/Caches/Homebrew/qemu-2.2.1.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/qemu/2.2.1_1 --cc=gcc-7 --host-cc=gcc-7 --disable-bsd-user --disable-guest-agent --enable-cocoa --cpu=ppc --disable-sdl --enable-vde --disable-gtk --disable-li
==> /usr/bin/make V=1 install
Warning: qemu dependency gmp was built with a different C++ standard
library (libstdc++ from gcc). This may cause problems at runtime.
/usr/local/Cellar/qemu/2.2.1_1: 123 files, 97M, built in 389.9 minutes
real 390m18.378s
user 238m14.483s
sys 68m22.546s
Interestingly, using gcc-7
is unnecessary when building on 10.4.11.
I'll probably submit a PR at some point in time (whenever I have free time) that fixes this via a conditional fails_with :gcc
, but I'll need to test things a bit more.
https://gist.github.com/P1nkz/bb6eaf67865be812aa474d7ba094bb49