Skip to content

PortAudio: Enable build on macOS/arm64 #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChinYikMing
Copy link
Collaborator

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

Environment

OS: macOS/arm64 Version 15.3.1 (Darwin 24.3.0 Darwin Kernel Version 24.3.0)
Compiler: Apple clang version 16.0.0 (clang-1600.0.26.6)

Reproduce

$ make check

Expected error

git submodule update --init portaudio
cd portaudio/ && ./configure --without-sndio
checking build system type... arm-apple-darwin24.3.0
checking host system type... arm-apple-darwin24.3.0
checking target system type... arm-apple-darwin24.3.0
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/semu/portaudio':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** [Makefile:100: portaudio/lib/.libs/libportaudio.a] Error 77

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: sysprog21#76
@ChinYikMing
Copy link
Collaborator Author

Tested and also worked on Ubuntu 22.04/x86_64 (6.5.0-41-generic) with gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.. @shengwen-tw @Cuda-Chen Could you please verify the claim? Thanks!

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

# During boot process, he emulator manually manages the growth of ticks to
# suppress RCU CPU stall warnings. Thus, we need an target time to set the
# During boot process, he emulator manually manages the growth of ticks to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

he emulator => the emulator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants