[vlc-commits] [Git][videolan/vlc][3.0.x] 8 commits: configure: darwin: use AX_APPEND_FLAG
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Sep 6 10:25:25 UTC 2026
Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC
Commits:
6d2a34e6 by Marvin Scholz at 2026-09-06T09:11:19+00:00
configure: darwin: use AX_APPEND_FLAG
(cherry picked from commit f8d5d938aa3344cd62e220ccaee64887fa1667d1) (edited)
edited:
- only the part about fno-stack-check is backported
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
d95d081e by Niklas Haas at 2026-09-06T09:11:19+00:00
contrib: generalize cppcheck to take source code
Instead of piping in /dev/null, take the code to pipe from $(2). This
does not regress the existing usages, as passing an empty variable
expands to an empty file.
This allows it to take an extra include statement, or even a more
complicated preprocessor check.
(cherry picked from commit 3d04025e615af586aefbc6d81eca63629b8e2c4c) (rebased)
rebased:
- the code around is slightly different
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
ea8f3693 by Jacob Martin at 2026-09-06T09:11:19+00:00
contrib: silence cppcheck compiler errors
This fixes a misleading 'fatal error' message that appears when make
is invoked for contribs.
Since cppcheck only used stdout of $(CC) to begin with, suppressing
stderr in this manner should not change its overall behavior.
(cherry picked from commit 400cbaa4aee3d9ea7e0fbd8177874d9b1aad165d) (rebased)
rebased:
- the code around is slightly different
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
fa5ed902 by Steve Lhomme at 2026-09-06T09:11:19+00:00
contrib: only force -fno-stack-check on XCode/clang 11
This is what the comment suggests and also how it's done in FFmpeg [^1].
Xcode 11 had 11.0.0 and 11.0.3 version strings [^2].
[^1]: https://code.ffmpeg.org/FFmpeg/FFmpeg/src/commit/6b961f5963d8e362137702d38a744b45fba8ba3a/configure#L5994
[^2]: https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2
(cherry picked from commit f08359e7ff347adec648b8b3d27ea3a22db2886b) (rebased)
rebased:
- the code around is slightly different
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
8d68ae53 by Steve Lhomme at 2026-09-06T09:11:19+00:00
configure: only force -fno-stack-check on XCode/clang 11
This is what the comment suggests and also how it's done in FFmpeg [^1].
Xcode 11 had 11.0.0 and 11.0.3 version strings [^2].
[^1]: https://code.ffmpeg.org/FFmpeg/FFmpeg/src/commit/6b961f5963d8e362137702d38a744b45fba8ba3a/configure#L5994
[^2]: https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2
(cherry picked from commit d2008b8d09936d339eb2fb2ae73938c1d6362574) (rebased)
rebased:
- in VLC 3 the original code was not in the same place
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
3f287a4c by Marvin Scholz at 2026-09-06T09:11:19+00:00
contrib: Fix Apple Clang specific version checks
The versions of Clang and Apple Clang can't be treated
the same, so add a version check specific to Apple Clang
and make the normal one always return false when checking
with Apple Clang.
This also makes the check for Xcode 11 for the -fno-stack-check
workaround more accurate, as it does not rely on the assumption
that Apple Clang is used when the host is Darwin, anymore.
(cherry picked from commit fb16e8db90aafb8bc67d0ae07511b9c7ddb31f50) (edited)
edited:
- VLC 3 used HAVE_MACOSX instead of HAVE_DARWIN_OS for the vpx check
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
4c1c8247 by Marvin Scholz at 2026-09-06T09:11:19+00:00
contrib: add try_cxx_compile helper
Accepts the source code as first argument and additional compiler
flags as second argument.
Will be used in the next commit.
(cherry picked from commit eecc23ba1e83789318d02a671ed213459780f280)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
b938fa7a by Marvin Scholz at 2026-09-06T09:11:19+00:00
contrib: live555: actually test the required C++20 feature
(cherry picked from commit 6b5eca8bb77803eb81d5ac3c895e67f358e55f20)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
4 changed files:
- configure.ac
- contrib/src/live555/rules.mak
- contrib/src/main.mak
- contrib/src/vpx/rules.mak
Changes:
=====================================
configure.ac
=====================================
@@ -154,10 +154,15 @@ case "${host_os}" in
SYS=dragonfly
;;
darwin*)
- dnl Workaround possible Xcode 11 bug
- CFLAGS="${CFLAGS} -fno-stack-check"
- CXXFLAGS="${CXXFLAGS} -fno-stack-check"
- OBJCFLAGS="${OBJCFLAGS} -fno-stack-check"
+ AC_MSG_CHECKING([if AppleClang requires -fno-stack-check])
+ COMPILER_VERSION_MAJ="$(${CC} -dumpversion | cut -d '.' -f -1)"
+ AS_IF([ test ${COMPILER_VERSION_MAJ} -eq 11 ],[
+ dnl Work around an Xcode 11 bug, fixed in Xcode 11.3.1
+ AC_MSG_RESULT([yes])
+ AX_APPEND_FLAG([-fno-stack-check], [CFLAGS])
+ AX_APPEND_FLAG([-fno-stack-check], [CXXFLAGS])
+ AX_APPEND_FLAG([-fno-stack-check], [OBJCFLAGS])
+ ],[AC_MSG_RESULT([no])])
dnl Force gcc "-arch" flag
ARCH_flag=""
=====================================
contrib/src/live555/rules.mak
=====================================
@@ -4,20 +4,15 @@ LIVE555_VERSION := 2026.06.24
LIVE555_FILE := live.$(LIVE555_VERSION).tar.gz
LIVEDOTCOM_URL := $(CONTRIB_VIDEOLAN)/live555/$(LIVE555_FILE)
-ifdef HAVE_GCC
-# older GCC doesn't support -std=c++20 required for std::atomic_flag
-ifeq ($(call gcc_at_least, 10), true)
-HAVE_LIVE555_CPP20=1
-endif
-else
-ifdef HAVE_CLANG
-# older CLANG doesn't support -std=c++20 required for std::atomic_flag
-ifeq ($(call clang_at_least, 12), true)
-HAVE_LIVE555_CPP20=1
-endif
-else
-HAVE_LIVE555_CPP20=1
-endif
+define CXX20_ATOMIC_FLAG_CHECK
+#include <atomic> \n
+#if !defined(__cpp_lib_atomic_flag_test) \n
+FAIL! \n
+#endif \n
+endef
+
+ifeq ($(call try_cxx_compile,$(CXX20_ATOMIC_FLAG_CHECK),-std=c++20),true)
+HAVE_LIVE555_CPP20_ATOMIC_TEST=1
endif
ifdef BUILD_NETWORK
@@ -74,7 +69,7 @@ live555: $(LIVE555_FILE) .sum-live555
# Remove hardcoded cc, c++, ar variables
sed -e 's%C_COMPILER%#C_COMPILER%' -e 's%CPLUSPLUS_COMPILER%#CPLUSPLUS_COMPILER%' -e 's%LIBRARY_LINK%#LIBRARY_LINK%' -i.orig $(UNPACK_DIR)/config.$(LIVE_TARGET)
# Remove hardcoded --std=c+20 on un supported compilers
-ifndef HAVE_LIVE555_CPP20
+ifndef HAVE_LIVE555_CPP20_ATOMIC_TEST
sed -e 's%-std=c++20% -DNO_STD_LIB=1%' -i.orig $(UNPACK_DIR)/config.$(LIVE_TARGET)
endif
# Add the Extra_CFLAGS to all config files
=====================================
contrib/src/main.mak
=====================================
@@ -130,13 +130,6 @@ darwin_min_os_at_least = $(shell echo false)
endif
endif
-# -fno-stack-check is a workaround for a possible
-# bug in Xcode 11 or macOS 10.15+
-ifdef HAVE_DARWIN_OS
-EXTRA_CFLAGS += -fno-stack-check
-XCODE_FLAGS += OTHER_CFLAGS=-fno-stack-check
-endif
-
ifdef HAVE_MACOSX
EXTRA_CXXFLAGS += -stdlib=libc++
ifeq ($(ARCH),aarch64)
@@ -175,12 +168,23 @@ EXTRA_CFLAGS += -DWINSTORECOMPAT
EXTRA_LDFLAGS += -lwinstorecompat
endif
+apple_clang_at_least = $(shell echo false)
+apple_clang_at_most = $(shell echo false)
+apple_clang_major_is = $(shell echo false)
clang_at_least = $(shell echo false)
clang_at_most = $(shell echo false)
clang_major_is = $(shell echo false)
gcc_at_least = $(shell echo false)
gcc_at_most = $(shell echo false)
gcc_major_is = $(shell echo false)
+ifeq ($(shell $(CC) --version 2>/dev/null | grep -qi "Apple clang" || echo FAIL),)
+HAVE_APPLE_CLANG := 1
+HAVE_CLANG := 1
+CLANG_VERSION := $(shell $(CC) --version | head -1 | grep -o '[0-9]\+\.' | head -1 | cut -d '.' -f 1)
+apple_clang_at_least = $(shell [ $(CLANG_VERSION) -ge $(1) ] && echo true)
+apple_clang_at_most = $(shell [ $(CLANG_VERSION) -le $(1) ] && echo true)
+apple_clang_major_is = $(shell [ $(CLANG_VERSION) -eq $(1) ] && echo true)
+else
ifneq ($(findstring clang, $(shell $(CC) --version 2>/dev/null | grep -qi clang && echo "clang")),)
HAVE_CLANG := 1
CLANG_VERSION := $(shell $(CC) --version | head -1 | grep -o '[0-9]\+\.' | head -1 | cut -d '.' -f 1)
@@ -196,8 +200,18 @@ gcc_at_most = $(shell [ $(GCC_VERSION) -le $(1) ] && echo true)
gcc_major_is = $(shell [ $(GCC_VERSION) -eq $(1) ] && echo true)
endif
endif
+endif
+
+# -fno-stack-check is a workaround for a possible
+# bug in Xcode 11 or macOS 10.15+
+ifeq ($(call apple_clang_major_is,11), true)
+EXTRA_CFLAGS += -fno-stack-check
+XCODE_FLAGS += OTHER_CFLAGS=-fno-stack-check
+endif
+
+cppcheck = $(shell printf '$(2)' | $(CC) $(CFLAGS) -E -dM - 2>/dev/null | grep -E $(1))
-cppcheck = $(shell $(CC) $(CFLAGS) -E -dM - < /dev/null | grep -E $(1))
+try_cxx_compile = $(shell printf '$(1)' | $(CXX) $(CXXFLAGS) $(2) -x c++ -c - -o /dev/null 2>/dev/null && echo true)
EXTRA_CFLAGS += -I$(PREFIX)/include
CPPFLAGS := $(CPPFLAGS) $(EXTRA_CFLAGS)
=====================================
contrib/src/vpx/rules.mak
=====================================
@@ -155,13 +155,11 @@ VPX_CONF += --disable-runtime-cpu-detect
endif
VPX_LDFLAGS := -L$(IOS_SDK)/usr/lib -isysroot $(IOS_SDK) $(LDFLAGS)
endif
-ifdef HAVE_MACOSX
ifeq ($(ARCH),$(filter $(ARCH), arm aarch64))
-ifneq ($(call clang_at_least, 13), true)
-# arm_neon.h broken on clang 12
+ifneq ($(call apple_clang_at_least, 13), true)
+# arm_neon.h broken on Apple Clang 12
VPX_CONF += --disable-neon-dotprod
endif
-endif
VPX_LDFLAGS := -L$(MACOSX_SDK)/usr/lib -isysroot $(MACOSX_SDK) -mmacosx-version-min=10.7
endif
VPX_LDFLAGS += -arch $(PLATFORM_SHORT_ARCH)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7313c84b82d6974421ae3f2b23f0260b4d62e678...b938fa7a2cbee3239ecccf3b08c0fbda3672963e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7313c84b82d6974421ae3f2b23f0260b4d62e678...b938fa7a2cbee3239ecccf3b08c0fbda3672963e
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list