Compare commits

..

1 Commits

Author SHA1 Message Date
Ignacio Roldán Etchevery
e6cc45816e Add missing --osx-sdk and --osx-version-min options
- Add missing `--osx-version-min` option to the iOS AOT compiler script.
- Add missing `--osx-sdk` and `--osx-version-min` options to the macOS desktop script.
- Use xcrun to get macosx sdk path in the macOS desktop script. Previously the path was hard-coded. This matches the iOS script.
2021-07-12 22:27:57 +02:00
10 changed files with 123 additions and 193 deletions

View File

@@ -21,20 +21,21 @@ on:
branches:
- 'release/**'
# Use ubuntu-18.04 for Linux for the best glibc compatibility.
# Use ubuntu-latest for other platforms.
# Use ubuntu-16.04 for the best compatibility.
# Use ubuntu-latest for the Windows builds because of outdated MinGW headers on ubuntu-16.04.
# Use ubuntu-latest for the WASM runtime ("machine `wasm32' not recognized" on ubuntu-16.04)
env:
# Use SHA or tag instead of the branch for caching purposes.
MONO_TAG: mono-6.12.0.174
MONO_TAG: mono-6.12.0.147
PYTHON_VERSION: 3.9
# Should match the version that Mono supports.
EMSDK_VERSION: 1.39.9
ANDROID_CMAKE_VERSION: 3.10.2.4988404
# These should be synced with the Godot repo.
# platform/android/java/app/config.gradle
ANDROID_PLATFORM: android-30
ANDROID_API: 19
ANDROID_PLATFORM: android-29
ANDROID_API: 18
ANDROID_NDK_VERSION: 21.4.7075529
# platform/iphone/detect.py
IOS_VERSION_MIN: 10.0
@@ -42,7 +43,7 @@ env:
jobs:
linux:
name: Linux
runs-on: ubuntu-18.04
runs-on: ubuntu-16.04
strategy:
matrix:
target: [x86, x86_64]
@@ -64,13 +65,13 @@ jobs:
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -79,11 +80,11 @@ jobs:
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -138,13 +139,13 @@ jobs:
sudo apt-get -y install mingw-w64 libz-mingw-w64-dev
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -153,11 +154,11 @@ jobs:
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -202,13 +203,13 @@ jobs:
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -217,11 +218,11 @@ jobs:
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -266,13 +267,13 @@ jobs:
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -281,11 +282,11 @@ jobs:
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -336,13 +337,13 @@ jobs:
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -351,11 +352,11 @@ jobs:
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -411,7 +412,7 @@ jobs:
android:
name: Android
runs-on: ubuntu-latest
runs-on: ubuntu-16.04
strategy:
matrix:
target: [armeabi-v7a, arm64-v8a, x86, x86_64]
@@ -434,13 +435,13 @@ jobs:
echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION" >> $GITHUB_ENV
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -449,11 +450,11 @@ jobs:
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -490,7 +491,7 @@ jobs:
strategy:
matrix:
target: [cross-arm, cross-arm64, cross-x86, cross-x86_64, cross-arm-win, cross-arm64-win, cross-x86-win, cross-x86_64-win]
os: [ubuntu-18.04, ubuntu-latest]
os: [ubuntu-16.04, ubuntu-latest]
exclude:
- target: cross-arm
os: ubuntu-latest
@@ -501,30 +502,30 @@ jobs:
- target: cross-x86_64
os: ubuntu-latest
- target: cross-arm-win
os: ubuntu-18.04
os: ubuntu-16.04
- target: cross-arm64-win
os: ubuntu-18.04
os: ubuntu-16.04
- target: cross-x86-win
os: ubuntu-18.04
os: ubuntu-16.04
- target: cross-x86_64-win
os: ubuntu-18.04
os: ubuntu-16.04
include:
- target: cross-arm
llvm: llvm64
runtime_target: armeabi-v7a
os: ubuntu-18.04
os: ubuntu-16.04
- target: cross-arm64
llvm: llvm64
runtime_target: arm64-v8a
os: ubuntu-18.04
os: ubuntu-16.04
- target: cross-x86
llvm: llvm64
runtime_target: x86
os: ubuntu-18.04
os: ubuntu-16.04
- target: cross-x86_64
llvm: llvm64
runtime_target: x86_64
os: ubuntu-18.04
os: ubuntu-16.04
- target: cross-arm-win
llvm: llvmwin64
runtime_target: armeabi-v7a
@@ -563,13 +564,13 @@ jobs:
echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION" >> $GITHUB_ENV
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -578,11 +579,11 @@ jobs:
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Download LLVM artifact
@@ -650,13 +651,13 @@ jobs:
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -665,15 +666,15 @@ jobs:
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Emscripten SDK
uses: mymindstorm/setup-emsdk@v11
uses: mymindstorm/setup-emsdk@v10
with:
version: ${{ env.EMSDK_VERSION }}
- name: Patch Mono
@@ -708,11 +709,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-latest, macos-latest]
os: [ubuntu-16.04, ubuntu-latest, macos-latest]
target: [llvm64, llvmwin64]
exclude:
# Ubuntu 18.04 is only needed for the Linux build
- os: ubuntu-18.04
# Ubuntu 16.04 is only needed for the Linux build
- os: ubuntu-16.04
target: llvmwin64
# Ubuntu latest is only needed for the Windows build
- os: ubuntu-latest
@@ -723,7 +724,7 @@ jobs:
steps:
- name: Cache LLVM
id: cache_llvm
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ~/mono-installs/llvm-${{ matrix.target }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-llvm-${{ matrix.target }}
@@ -746,13 +747,13 @@ jobs:
- name: Cache Mono Sources
if: steps.cache_llvm.outputs.cache-hit != 'true'
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' && steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -763,12 +764,12 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
if: steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
if: steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -796,7 +797,7 @@ jobs:
bcl:
name: BCL
runs-on: ubuntu-18.04
runs-on: ubuntu-16.04
strategy:
matrix:
product: [desktop, desktop-win32, android, ios, wasm]
@@ -810,13 +811,13 @@ jobs:
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
@@ -825,11 +826,11 @@ jobs:
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -864,7 +865,7 @@ jobs:
if: success() && github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release/')
needs: [linux, windows, osx, ios, ios-cross, android, android-cross, wasm, bcl]
name: Create Release
runs-on: ubuntu-18.04
runs-on: ubuntu-16.04
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
@@ -893,7 +894,7 @@ jobs:
if: success() && github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release/')
needs: create-release
name: Upload Release Artifacts
runs-on: ubuntu-18.04
runs-on: ubuntu-16.04
strategy:
matrix:
artifact_name: [linux-x86, linux-x86_64, windows-x86, windows-x86_64, osx-x86_64,

View File

@@ -9,9 +9,9 @@ This repository contains scripts for building the Mono runtime to use with Godot
The scripts are tested against specific versions of the toolchains used by Godot.
While they may work with other versions, you might have issues applying patches or compiling, so we recommend using the versions below.
- Mono: 6.12.0.174.
- Mono: 6.12.0.147.
- Emscripten: 1.39.9.
- Android: API level 30.
- Android: API level 29.
## Command-line options
@@ -36,7 +36,7 @@ export MONO_SOURCE_ROOT=$HOME/git/mono
### Notes
- Python 3.7 or higher is required.
- OSXCROSS is supported except for building the Mono cross-compilers.
- OSXCROSS is supported expect for building the Mono cross-compilers.
- Building on Windows is not supported. It's possible to use Cygwin or WSL (Windows Subsystem for Linux) but this hasn't been tested.
## Compiling Godot for Desktop with this Runtime

View File

@@ -104,6 +104,17 @@ def setup_android_target_template(env: dict, opts: AndroidOpts, target: str):
if target in extra_target_envs:
env.update(extra_target_envs[target])
android_new_ndk = True
with open(path_join(opts.android_ndk_root, 'source.properties')) as file:
for line in file:
line = line.strip()
if line.startswith('Pkg.Revision ') or line.startswith('Pkg.Revision='):
pkg_revision = line.split('=')[1].strip()
mayor = int(pkg_revision.split('.')[0])
android_new_ndk = mayor >= 18
break
arch = AndroidTargetTable.archs[target]
abi_name = AndroidTargetTable.abi_names[target]
host_triple = AndroidTargetTable.host_triples[target]
@@ -165,14 +176,14 @@ def setup_android_target_template(env: dict, opts: AndroidOpts, target: str):
CFLAGS += [
'-fstack-protector',
'-DMONODROID=1'
'-D__ANDROID_API__=' + api,
]
CFLAGS += ['-D__ANDROID_API__=' + api] if android_new_ndk else []
CXXFLAGS += [
'-fstack-protector',
'-DMONODROID=1'
'-D__ANDROID_API__=' + api,
]
CXXFLAGS += ['-D__ANDROID_API__=' + api] if android_new_ndk else []
CPPFLAGS += ['-I%s/sysroot/usr/include' % toolchain_path]
CXXCPPFLAGS += ['-I%s/sysroot/usr/include' % toolchain_path]
@@ -205,7 +216,7 @@ def setup_android_target_template(env: dict, opts: AndroidOpts, target: str):
]
CONFIGURE_FLAGS += ['--enable-monodroid']
CONFIGURE_FLAGS += ['--with-btls-android-ndk-asm-workaround']
CONFIGURE_FLAGS += ['--with-btls-android-ndk-asm-workaround'] if android_new_ndk else []
CONFIGURE_FLAGS += [
'--with-btls-android-cmake-toolchain=%s/build/cmake/android.toolchain.cmake' % opts.android_ndk_root,
@@ -513,7 +524,7 @@ def main(raw_args):
parser.add_argument('--android-ndk', default=android_ndk_default, help=default_help)
# Default API version should be in sync with Godot's platform/android/detect.py.
# Note that `get_api_version_or_min` will upgrade it to 21 for arm64v8 and x86_64.
parser.add_argument('--android-api-version', default='19', help=default_help)
parser.add_argument('--android-api-version', default='18', help=default_help)
parser.add_argument('--android-cmake-version', default='autodetect', help=default_help)
cmd_utils.add_runtime_arguments(parser, default_help)

19
bcl.py
View File

@@ -40,7 +40,7 @@ def get_profile_install_dirs(opts: BaseOpts, product: str):
profiles = profiles_table[product]
return [path_join(install_dir, get_profile_dir(profile, product)) for profile in profiles]
def configure_bcl(opts: BclOpts, product: str):
def configure_bcl(opts: BclOpts):
stamp_file = path_join(opts.configure_dir, '.stamp-bcl-configure')
if os.path.isfile(stamp_file):
@@ -54,21 +54,12 @@ def configure_bcl(opts: BclOpts, product: str):
CONFIGURE_FLAGS = [
'--disable-boehm',
'--disable-btls-lib',
'--disable-nls',
'--disable-support-build',
'--with-mcs-docs=no'
]
if product == 'desktop-win32':
CONFIGURE_FLAGS += [
'--enable-btls',
'--enable-btls-lib'
]
else:
CONFIGURE_FLAGS += [
'--disable-btls-lib'
]
configure = path_join(opts.mono_source_root, 'configure')
configure_args = CONFIGURE_FLAGS
@@ -93,8 +84,8 @@ def make_bcl(opts: BclOpts):
touch(stamp_file)
def build_bcl(opts: BclOpts, product: str):
configure_bcl(opts, product)
def build_bcl(opts: BclOpts):
configure_bcl(opts)
make_bcl(opts)
@@ -106,7 +97,7 @@ def clean_bcl(opts: BclOpts):
def make_product(opts: BclOpts, product: str):
build_bcl(opts, product)
build_bcl(opts)
build_dir = path_join(opts.configure_dir, 'bcl')

View File

@@ -87,9 +87,7 @@ def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_pl
'--disable-mcs-build',
'--enable-maintainer-mode',
'--with-tls=pthread',
'--without-ikvm-native',
'--enable-btls',
'--enable-btls-lib'
'--without-ikvm-native'
]
if target_platform == 'windows':
@@ -100,6 +98,7 @@ def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_pl
CONFIGURE_FLAGS += [
'--disable-iconv',
'--disable-nls',
'--enable-dynamic-btls',
'--with-sigaltstack=yes',
]
@@ -124,6 +123,16 @@ def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_pl
#'--enable-static-gcc-libs'
]
elif target_platform == 'osx':
osx_sysroot_path = opts.osx_sdk_path
if not osx_sysroot_path and sys.platform == 'darwin':
# Auto-detect on macOS
osx_sysroot_path = xcrun_find_sdk('macosx')
osx_sysroot_flags = ['-isysroot', osx_sysroot_path, '-mmacosx-version-min=%s' % opts.osx_version_min]
CFLAGS = osx_sysroot_flags
if is_cross_compiling(target_platform):
osxcross_root = os.environ['OSXCROSS_ROOT']
osx_toolchain_path = path_join(osxcross_root, 'target')
@@ -153,15 +162,10 @@ def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_pl
env['_%s-%s_CC' % (product, target)] = '%s/usr/bin/clang' % osx_toolchain
env['_%s-%s_CXX' % (product, target)] = '%s/usr/bin/clang++' % osx_toolchain
osx_sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'
CFLAGS += ['-arch', target_arch[target_platform][target]]
CFLAGS = [
'-isysroot', osx_sysroot,
'-arch', target_arch[target_platform][target]
]
env['_%s-%s_CFLAGS' % (product, target)] = CFLAGS
env['_%s-%s_CXXFLAGS' % (product, target)] = CFLAGS
env['_%s-%s_CFLAGS' % (product, target)] = CFLAGS
env['_%s-%s_CXXFLAGS' % (product, target)] = CFLAGS
env['_%s-%s_CONFIGURE_FLAGS' % (product, target)] = CONFIGURE_FLAGS
@@ -211,14 +215,6 @@ def configure(opts: DesktopOpts, product: str, target_platform: str, target: str
def make(opts: DesktopOpts, product: str, target_platform: str, target: str):
build_dir = path_join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration))
if target_platform == 'windows':
mxe = 'mxe-Win64' if target == 'x86_64' else 'mxe-Win32'
replace_in_new_file(
src_file='%s/sdks/builds/%s.cmake.in' % (opts.mono_source_root, mxe),
search='@MXE_PATH@', replace=opts.mxe_prefix,
dst_file='%s/mono/btls/%s.cmake' % (opts.mono_source_root, mxe)
)
make_args = make_default_args(opts)
make_args += ['-C', build_dir]
@@ -234,7 +230,7 @@ def copy_bcl(opts: DesktopOpts, product: str, target_platform: str, target: str)
from distutils.dir_util import copy_tree
from bcl import get_profile_install_dirs
dest_dir = path_join(opts.install_dir, '%s-%s-%s' % (product, target, opts.configuration), 'lib/mono/4.5')
for src_dir in get_profile_install_dirs(opts, 'desktop-win32' if target_platform == 'windows' else 'desktop'):
for src_dir in get_profile_install_dirs(opts, 'desktop'):
if not os.path.isdir(src_dir):
raise BuildError('BCL source directory does not exist: %s. The BCL must be built prior to this.' % src_dir)
copy_tree(src_dir, dest_dir)
@@ -262,9 +258,13 @@ def run_main(raw_args, target_platform):
default_help = 'default: %(default)s'
default_osx_version_min = '10.9'
parser.add_argument('action', choices=['configure', 'make', 'copy-bcl', 'clean'])
parser.add_argument('--target', choices=targets[target_platform], action='append', required=True)
parser.add_argument('--with-llvm', action='store_true', default=False, help=default_help)
parser.add_argument('--osx-sdk', default='', help=default_help)
parser.add_argument('--osx-version-min', default=default_osx_version_min, help=default_help)
cmd_utils.add_runtime_arguments(parser, default_help)

View File

@@ -1,33 +0,0 @@
diff --git a/configure.ac b/configure.ac
index 088128e5e74..54693aace64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5918,6 +5918,8 @@ if test "x$enable_btls" = "xyes"; then
if test "x$HAVE_YASM" != "xyes"; then
BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1"
fi
+ mono_btls_dir_abs=`cd $srcdir && pwd`/mono/btls
+ BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCYGWIN=TRUE -DCMAKE_TOOLCHAIN_FILE=\"$mono_btls_dir_abs/mxe-Win32.cmake\""
;;
esac
;;
@@ -5929,6 +5931,8 @@ if test "x$enable_btls" = "xyes"; then
if test "x$HAVE_YASM" != "xyes"; then
BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1"
fi
+ mono_btls_dir_abs=`cd $srcdir && pwd`/mono/btls
+ BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCYGWIN=TRUE -DCMAKE_TOOLCHAIN_FILE=\"$mono_btls_dir_abs/mxe-Win64.cmake\""
;;
esac
;;
diff --git a/mono/btls/CMakeLists.txt b/mono/btls/CMakeLists.txt
index 992f41e4c7f..9946f5d21a4 100644
--- a/mono/btls/CMakeLists.txt
+++ b/mono/btls/CMakeLists.txt
@@ -129,4 +129,5 @@ endif ()
if (CYGWIN)
target_link_libraries (mono-btls-shared wsock32 ws2_32)
+ target_link_options (mono-btls-shared PRIVATE -static-libgcc)
endif ()
\ No newline at end of file

View File

@@ -1,48 +0,0 @@
diff --git a/mono/metadata/threadpool-io.c b/mono/metadata/threadpool-io.c
index fdfef2de91e28..45ac0d84b2429 100644
--- a/mono/metadata/threadpool-io.c
+++ b/mono/metadata/threadpool-io.c
@@ -180,6 +180,7 @@ selector_thread_wakeup_drain_pipes (void)
{
gchar buffer [128];
gint received;
+ static gint warnings_issued = 0;
for (;;) {
#if !defined(HOST_WIN32)
@@ -192,11 +193,16 @@ selector_thread_wakeup_drain_pipes (void)
* some unices (like AIX) send ERESTART, which doesn't
* exist on some other OSes errno
*/
- if (errno != EINTR && errno != EAGAIN && errno != ERESTART)
+ if (errno != EINTR && errno != EAGAIN && errno != ERESTART) {
#else
- if (errno != EINTR && errno != EAGAIN)
+ if (errno != EINTR && errno != EAGAIN) {
#endif
- g_warning ("selector_thread_wakeup_drain_pipes: read () failed, error (%d) %s\n", errno, g_strerror (errno));
+ // limit amount of spam we write
+ if (warnings_issued < 100) {
+ g_warning ("selector_thread_wakeup_drain_pipes: read () failed, error (%d) %s\n", errno, g_strerror (errno));
+ warnings_issued++;
+ }
+ }
break;
}
#else
@@ -204,8 +210,13 @@ selector_thread_wakeup_drain_pipes (void)
if (received == 0)
break;
if (received == SOCKET_ERROR) {
- if (WSAGetLastError () != WSAEINTR && WSAGetLastError () != WSAEWOULDBLOCK)
- g_warning ("selector_thread_wakeup_drain_pipes: recv () failed, error (%d)\n", WSAGetLastError ());
+ if (WSAGetLastError () != WSAEINTR && WSAGetLastError () != WSAEWOULDBLOCK) {
+ // limit amount of spam we write
+ if (warnings_issued < 100) {
+ g_warning ("selector_thread_wakeup_drain_pipes: recv () failed, error (%d)\n", WSAGetLastError ());
+ warnings_issued++;
+ }
+ }
break;
}
#endif

10
ios.py
View File

@@ -390,8 +390,10 @@ def setup_ios_cross_template(env: dict, opts: iOSOpts, target: str, host_arch: s
AC_VARS = ['ac_cv_func_shm_open_working_with_mmap=no']
CFLAGS = ['-isysroot', osx_sysroot_path, '-mmacosx-version-min=10.9', '-Qunused-arguments']
CXXFLAGS = ['-isysroot', osx_sysroot_path, '-mmacosx-version-min=10.9', '-Qunused-arguments', '-stdlib=libc++']
osx_sysroot_flags = ['-isysroot', osx_sysroot_path, '-mmacosx-version-min=%s' % opts.osx_version_min]
CFLAGS = osx_sysroot_flags + ['-Qunused-arguments']
CXXFLAGS = osx_sysroot_flags + ['-Qunused-arguments', '-stdlib=libc++']
CPPFLAGS = ['-DMONOTOUCH=1']
LDFLAGS = ['-stdlib=libc++']
@@ -500,7 +502,8 @@ def main(raw_args):
default_ios_toolchain = '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain'
default_osx_toolchain = '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain'
default_ios_version_min = '10.0' # Same as Godot
default_ios_version_min = '10.0'
default_osx_version_min = '10.9'
parser.add_argument('action', choices=['configure', 'make', 'clean'])
parser.add_argument('--target', choices=target_values, action='append', required=True)
@@ -509,6 +512,7 @@ def main(raw_args):
parser.add_argument('--ios-version-min', default=default_ios_version_min, help=default_help)
parser.add_argument('--osx-toolchain', default=default_osx_toolchain, help=default_help)
parser.add_argument('--osx-sdk', default='', help=default_help)
parser.add_argument('--osx-version-min', default=default_osx_version_min, help=default_help)
parser.add_argument('--osx-triple-abi', default='darwin18', help=default_help)
cmd_utils.add_runtime_arguments(parser, default_help)

View File

@@ -38,12 +38,15 @@ class iOSOpts(RuntimeOpts):
ios_version_min: str
osx_toolchain_path: str
osx_sdk_path: str
osx_version_min: str
osx_triple_abi: str
@dataclass
class DesktopOpts(RuntimeOpts):
with_llvm: bool
osx_sdk_path: str
osx_version_min: str
@dataclass
@@ -95,7 +98,8 @@ def ios_opts_from_args(args):
ios_sdk_path = abspath(args.ios_sdk) if args.ios_sdk else '',
ios_version_min = args.ios_version_min,
osx_toolchain_path = abspath(args.osx_toolchain),
osx_sdk_path = abspath(args.osx_sdk) if args.ios_sdk else '',
osx_sdk_path = abspath(args.osx_sdk) if args.osx_sdk else '',
osx_version_min = args.osx_version_min,
osx_triple_abi = args.osx_triple_abi
)
@@ -111,7 +115,9 @@ def bcl_opts_from_args(args):
def desktop_opts_from_args(args):
return DesktopOpts(
**vars(runtime_opts_from_args(args)),
with_llvm = args.with_llvm
with_llvm = args.with_llvm,
osx_sdk_path = abspath(args.osx_sdk) if args.osx_sdk else '',
osx_version_min = args.osx_version_min
)

View File

@@ -27,12 +27,10 @@ def main(raw_args):
patches = [
'fix-mono-android-tkill.diff',
'fix-mono-log-spam.diff',
'mono-dbg-agent-clear-tls-instead-of-abort.diff',
'bcl-profile-platform-override.diff',
'mono_ios_asl_log_deprecated.diff',
'wasm_m2n_trampolines_hook.diff',
'btls-cmake-args-linux-mingw.diff'
]
if os.path.isfile(os.path.join(mono_source_root, 'mono/tools/offsets-tool/offsets-tool.py')):