-
Notifications
You must be signed in to change notification settings - Fork 193
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
Fix compilation on current MacOS #108
Conversation
The "-force_cpusubtype_ALL" flag is not supported by current Apple compilers. It's not clear to me why that flag was used to begin with.
Here is the entry from Apple's newest
Here are excerpts from Apple's old gcc man page:
And here is the entry from Apple's
The I guess the best course of action would be limiting that flag diff --git a/configure.ac b/configure.ac
index 14a267f..3d62bc9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,10 +201,14 @@ else
DEBUG="-g -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char $sparc_cpu"
CFLAGS="-O3 -Wall -Wextra -ffast-math -D__NO_MATH_INLINES -fsigned-char $sparc_cpu"
PROFILE="-pg -g -O3 -D__NO_MATH_INLINES -fsigned-char $sparc_cpu" ;;
- *-*-darwin*)
+ powerpc-*-darwin*)
DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O3 -ffast-math -fsigned-char"
PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O3 -ffast-math -fsigned-char";;
+ *-*-darwin*)
+ DEBUG="-DDARWIN -fno-common -Wall -g -O0 -fsigned-char"
+ CFLAGS="-DDARWIN -fno-common -Wall -g -O3 -ffast-math -fsigned-char"
+ PROFILE="-DDARWIN -fno-common -Wall -g -pg -O3 -ffast-math -fsigned-char";;
*-*-os2*)
# Use -W instead of -Wextra because gcc on OS/2 is an old version.
DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char" |
Thanks for the detailed references. It seems to me that if somebody wants to build binaries compatible with a particular CPU model, then they should use But, if you think it's better not to fix what ain't broken, and keep the flag enabled for |
Yes, I think that's best |
Fixes: xiph#107 Fixes: xiph#108 (See also: mkxp-z/mkxp-z#200)
Created #109 |
Fixes: xiph#107 Fixes: xiph#108 (See also: mkxp-z/mkxp-z#200)
Sounds good to me. Closing this pull in favor of #109. |
The "-force_cpusubtype_ALL" flag, which configure adds unconditionally when building for Darwin, is apparently not supported by current Apple compilers.
I don't use MacOS, so I have no way to test this myself.
However, it appears that in GitHub workflows targetting "macos-12", the flag is supported, whereas in GitHub workflows targetting "macos-13" or "macos-14" the flag is not supported, and results in the error
The patch that introduced this flag doesn't provide any details: https://lists.xiph.org/pipermail/vorbis-dev/2001-January/002993.html
(Fixes issue #107)