Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonojenkins <jo.shields+jenkins@xamarin.com>2020-11-13 16:29:43 +0300
committerGitHub <noreply@github.com>2020-11-13 16:29:43 +0300
commit124f1157141b323b6de883b45021170f1fe70539 (patch)
tree8f8b917bc836914523c93aa59cbc9011c183d630
parentdfbfe5eed1992905b0dac80a8dc7d6f1f9647735 (diff)
Fix iOS sdks build on Xcode 12 (#20574)mono-6.12.0.111
The new Xcode introduced functions like preadv/pwritev in the SDK that get erraneously detected by autoconf even though we can't use them. Disable these functions and also add a check for Xcode version to workaround https://github.com/mono/mono/issues/19393. Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
-rw-r--r--sdks/builds/ios.mk12
-rw-r--r--sdks/builds/mac.mk8
-rw-r--r--sdks/versions.mk2
3 files changed, 19 insertions, 3 deletions
diff --git a/sdks/builds/ios.mk b/sdks/builds/ios.mk
index a1efda3ca78..28752f2c3ae 100644
--- a/sdks/builds/ios.mk
+++ b/sdks/builds/ios.mk
@@ -67,6 +67,9 @@ _ios-$(1)_AC_VARS= \
ac_cv_func_futimens=no \
ac_cv_func_utimensat=no \
ac_cv_func_shm_open_working_with_mmap=no \
+ ac_cv_func_pthread_jit_write_protect_np=no \
+ ac_cv_func_preadv=no \
+ ac_cv_func_pwritev=no \
mono_cv_sizeof_sunpath=104 \
mono_cv_uscore=yes
@@ -90,11 +93,15 @@ _ios-$(1)_CPPFLAGS= \
-DSMALL_CONFIG -D_XOPEN_SOURCE -DHOST_IOS -DHAVE_LARGE_FILE_SUPPORT=1 \
_ios-$(1)_LDFLAGS= \
- -Wl,-no_weak_imports \
-arch $(3) \
-framework CoreFoundation \
-lobjc -lc++
+# Xcode 12 and later cause issues with no_weak_imports: https://github.com/mono/mono/issues/19393
+ifeq ($(XCODE_MAJOR_VERSION),$(filter $(XCODE_MAJOR_VERSION), 11 10 9))
+_ios-$(1)_LDFLAGS += -Wl,-no_weak_imports
+endif
+
_ios-$(1)_CONFIGURE_FLAGS = \
--disable-boehm \
--disable-btls \
@@ -296,6 +303,9 @@ _ios-$(1)_AC_VARS= \
ac_cv_func_futimens=no \
ac_cv_func_utimensat=no \
ac_cv_func_shm_open_working_with_mmap=no \
+ ac_cv_func_pthread_jit_write_protect_np=no \
+ ac_cv_func_preadv=no \
+ ac_cv_func_pwritev=no \
mono_cv_uscore=yes
_ios-$(1)_CFLAGS= \
diff --git a/sdks/builds/mac.mk b/sdks/builds/mac.mk
index bded6b2c22b..9c7a4840e3c 100644
--- a/sdks/builds/mac.mk
+++ b/sdks/builds/mac.mk
@@ -36,8 +36,12 @@ _mac-$(1)_CXXFLAGS= \
_mac-$(1)_CPPFLAGS=
-_mac-$(1)_LDFLAGS= \
- -Wl,-no_weak_imports
+_mac-$(1)_LDFLAGS=
+
+# Xcode 12 and later cause issues with no_weak_imports: https://github.com/mono/mono/issues/19393
+ifeq ($(XCODE_MAJOR_VERSION),$(filter $(XCODE_MAJOR_VERSION), 11 10 9))
+_mac-$(1)_LDFLAGS += -Wl,-no_weak_imports
+endif
_mac-$(1)_CONFIGURE_FLAGS= \
--disable-boehm \
diff --git a/sdks/versions.mk b/sdks/versions.mk
index 11f47bbcd96..7c7e48eeb7a 100644
--- a/sdks/versions.mk
+++ b/sdks/versions.mk
@@ -20,6 +20,8 @@ ANDROID_SDK_VERSION_x86_64?=21
# iOS
XCODE_DIR?=/Applications/Xcode.app/Contents/Developer
+XCODE_VERSION:=$(shell /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" $(XCODE_DIR)/../version.plist)
+XCODE_MAJOR_VERSION:=$(word 1, $(subst ., ,$(XCODE_VERSION)))
# min versions of the targets
MACOS_VERSION_MIN?=10.9