unable to build on Sequoia 15.3

Host environment

  • Operating system: MacOS Sequoia
  • OS/kernel version: 15.3
  • Architecture: ARM M1
  • QEMU flavor: build issue
  • QEMU version: latest github source b69801dd

Description of problem

Steps to reproduce

  1. git clone https://gitlab.com/qemu-project/qemu.git
  2. ../configure --target-list=riscv32-softmmu --enable-debug
  3. make

Error: ld: multiple errors: archive member '/' not a mach-o file in '../qemu/build/subprojects/dtc/libfdt/libfdt.a'; archive member '/' not a mach-o file in '../qemu/build/libqemuutil.a'

Additional information

I tried the more detailed "build for macos" instructions ./configure --cc=clang-7 --cxx=clang++-7 --host-cc=clang-7
--extra-cflags=-mavx2
--extra-cxxflags="-I/usr/local/opt/llvm/include"
--extra-ldflags="-L/usr/local/opt/llvm/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
--target-list=""

but this didn't work for any version of clang I tried, giving me the error in all cases: ERROR: C compiler "clang-xxx" either does not exist or does not work.

Actions to try and resolve

I searched and found a StackOverflow post:https://stackoverflow.com/questions/77444892/xcode-15-0-1-macos-sonoma-clang-archive-or-linking-issue That indicated the problem was with the version of "ar" used.

which ar returned /opt/homebrew/opt/binutils/bin/ar

the StackOverflow post recommended "switching ar to the one in /usr/bin/ar", which I did via a script, but this gave a different error: /usr/bin/ar: illegal option -- D

At this point I figured it's a deeper issue than I can fix with my current knowledge. Am happy to volunteer my time to help fix the problem.

Edited by ash