UTM icon indicating copy to clipboard operation
UTM copied to clipboard

build(macos): fix QEMU build by disabling SDL and adding build include paths

Open peterneutron opened this issue 3 months ago • 2 comments

peterneutron avatar Sep 20 '25 09:09 peterneutron

Could you provide more details about the error you were getting before your fix?

gabefair avatar Nov 01 '25 17:11 gabefair

OS: macOS 26.0.1 (25A362) ARCH: arm64 (M3 Pro)

./scripts/build_dependencies.sh -p macos -a arm64`

...

ld: warning: building for macOS-11.0, but linking with dylib '/opt/homebrew/opt/sdl2/lib/libSDL2-2.0.0.dylib' which was built for newer version 15.0
Undefined symbols for architecture arm64:
  "_qemu_main", referenced from:
      _sdl2_display_init in ui_sdl2.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[4923/6254] Compiling C object libqemu-xtensaeb-softmmu.dylib.p/target_xtensa_core-dsp3400.c.o
ninja: build stopped: subcommand failed.
make[1]: *** [run-ninja] Error 1
make: *** [build] Error 2

Could not reproduce the error condition that previously needed the addition of

--extra-cflags=-I$QEMU_DIR/build \
--extra-cflags=-I$QEMU_DIR/build/include"

with the current master branch.

peterneutron avatar Nov 02 '25 11:11 peterneutron