vlc/vlc-3.0 | branch: master | Marvin Scholz <epira...@gmail.com> | Thu Nov 14 
14:34:24 2019 +0100| [5a40648969dd08b41fb7bcb79b8a967bda6be475] | committer: 
Marvin Scholz

macosx: Add -fno-stack-check to workaround Xcode 11 issue

Compiling with Xcode 11 automatically enables the -fstack-check feature
which causes stack checking error due to unaligned stack which seem
to not be true. Lots of projects are affected by this currently
so hopefully this will be fixed in an Xcode update.

(cherry picked from commit 856ddd8d1af955712c7effb1876ca9544b688cab)
Signed-off-by: Marvin Scholz <epira...@gmail.com>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=5a40648969dd08b41fb7bcb79b8a967bda6be475
---

 configure.ac         | 4 ++++
 contrib/src/main.mak | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/configure.ac b/configure.ac
index a9f87dcbb5..a38e385dba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,6 +137,10 @@ 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"
 
     dnl Force gcc "-arch" flag
     ARCH_flag=""
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 03f7b4e421..a16c8cb838 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -118,6 +118,13 @@ CXX := clang++
 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),x86_64)

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to