Skip to content

Commit f19cd97

Browse files
committed
PortAudio: Enable build on macOS/arm64
Quote from portaudio/config.log: ... configure:3194: checking whether the C compiler works configure:3216: gcc -I/opt/homebrew/opt/zlib/include portaudio/lib/.libs/libportaudio.a -framework CoreServices -framework CoreFoundation -framework AudioUnit -framewo rk AudioToolbox -framework CoreAudio -lpthread -lm mini-gdbstub/build/libgdbstub.a conftest.c >&5 clang: error: no such file or directory: 'portaudio/lib/.libs/libportaudio.a' ... configure:3265: error: C compiler cannot create executables ... The ./configure script fails on macOS because LDFLAGS includes static libraries (libportaudio.a) that have not yet been built. This causes the compiler check to fail with "C compiler cannot create executables". This patch unsets LDFLAGS during the configure step to allow the test program to compile and link successfully, enabling builds on macOS. Related: #76
1 parent 81e61bc commit f19cd97

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ ifeq ($(call has, VIRTIOSND), 1)
100100
portaudio/Makefile:
101101
git submodule update --init portaudio
102102
$(PORTAUDIOLIB): portaudio/Makefile
103-
cd $(dir $<) && ./configure --without-sndio
103+
cd $(dir $<) && LDFLAGS="" ./configure --without-sndio
104104
$(MAKE) -C $(dir $<)
105105
main.o: $(PORTAUDIOLIB)
106106

@@ -168,12 +168,12 @@ DTC ?= dtc
168168
E :=
169169
S := $E $E
170170

171-
# During boot process, he emulator manually manages the growth of ticks to
172-
# suppress RCU CPU stall warnings. Thus, we need an target time to set the
171+
# During boot process, he emulator manually manages the growth of ticks to
172+
# suppress RCU CPU stall warnings. Thus, we need an target time to set the
173173
# increment of ticks. According to Using RCU’s CPU Stall Detector[1], the
174-
# grace period for RCU CPU stalls is typically set to 21 seconds.
175-
# By dividing this value by two as the expected completion time, we can
176-
# provide a sufficient buffer to reduce the impact of errors and avoid
174+
# grace period for RCU CPU stalls is typically set to 21 seconds.
175+
# By dividing this value by two as the expected completion time, we can
176+
# provide a sufficient buffer to reduce the impact of errors and avoid
177177
# RCU CPU stall warnings.
178178
# [1] docs.kernel.org/RCU/stallwarn.html#config-rcu-cpu-stall-timeout
179179
CFLAGS += -D SEMU_BOOT_TARGET_TIME=10
@@ -213,6 +213,6 @@ distclean: clean
213213
$(Q)$(RM) riscv-harts.dtsi
214214
$(Q)$(RM) minimal.dtb
215215
$(Q)$(RM) Image rootfs.cpio
216-
$(Q)$(RM) ext4.img
216+
$(Q)$(RM) ext4.img
217217

218218
-include $(deps)

0 commit comments

Comments
 (0)