mirror of
https://github.com/godotengine/godot-mono-builds.git
synced 2025-12-31 17:48:28 +03:00
Compare commits
18 Commits
release-fc
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3504af335e | ||
|
|
df26bb676c | ||
|
|
ae49eba999 | ||
|
|
9fb4d32e35 | ||
|
|
945d2619f8 | ||
|
|
4912f62a8f | ||
|
|
6236e2ee74 | ||
|
|
d496154ab1 | ||
|
|
8767196960 | ||
|
|
a0e457e7c1 | ||
|
|
5299efd80c | ||
|
|
11364fafc7 | ||
|
|
a7297fdf09 | ||
|
|
08b10e1b66 | ||
|
|
6291fa07a6 | ||
|
|
574f1404d2 | ||
|
|
4bf530983a | ||
|
|
d29929a407 |
463
.github/workflows/build.yml
vendored
463
.github/workflows/build.yml
vendored
@@ -21,28 +21,21 @@ on:
|
||||
branches:
|
||||
- 'release/**'
|
||||
|
||||
# Use ubuntu-18.04 for Linux for the best glibc compatibility.
|
||||
# Use ubuntu-latest for other platforms.
|
||||
|
||||
env:
|
||||
# Use SHA or tag instead of the branch for caching purposes.
|
||||
MONO_TAG: mono-6.12.0.182
|
||||
PYTHON_VERSION: '3.10'
|
||||
MONO_TAG: mono-6.12.0.206
|
||||
PYTHON_VERSION: '3.11'
|
||||
# Should match the version that Mono supports.
|
||||
EMSDK_VERSION: 1.39.9
|
||||
ANDROID_CMAKE_VERSION: 3.18.1
|
||||
# These should be synced with the Godot repo.
|
||||
# platform/android/java/app/config.gradle
|
||||
ANDROID_PLATFORM: android-32
|
||||
ANDROID_API: 19
|
||||
ANDROID_NDK_VERSION: 21.4.7075529
|
||||
# platform/iphone/detect.py
|
||||
IOS_VERSION_MIN: 10.0
|
||||
IOS_VERSION_MIN: 12.0
|
||||
# Supporting Xcode 15+ requires backporting a bunch of stuff.
|
||||
XCODE_VERSION: 14.3.1
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
name: Linux
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
target: [x86, x86_64]
|
||||
@@ -50,27 +43,45 @@ jobs:
|
||||
- name: Set Environment Variables
|
||||
run: |
|
||||
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
|
||||
- name: Install Dependencies (x86)
|
||||
if: matrix.target == 'x86'
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
|
||||
sudo apt-get -y install gcc-multilib g++-multilib zlib1g-dev:i386
|
||||
- name: Install Dependencies (x86_64)
|
||||
sudo apt-get -y install git autoconf libtool libtool-bin automake gettext cmake python3 curl
|
||||
- name: Install Linux SDK (x86_64)
|
||||
if: matrix.target == 'x86_64'
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
|
||||
cd /home/runner
|
||||
curl -LO https://github.com/godotengine/buildroot/releases/download/godot-2023.08.x-4/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
cd x86_64-godot-linux-gnu_sdk-buildroot
|
||||
./relocate-sdk.sh
|
||||
cd bin
|
||||
for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
|
||||
echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
|
||||
echo "LD_LIBRARY_PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/x86_64-godot-linux-gnu/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
|
||||
- name: Install Linux SDK (x86)
|
||||
if: matrix.target == 'x86'
|
||||
run: |
|
||||
cd /home/runner
|
||||
curl -LO https://github.com/godotengine/buildroot/releases/download/godot-2023.08.x-4/i686-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
tar xf i686-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
rm -f i686-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
cd i686-godot-linux-gnu_sdk-buildroot
|
||||
./relocate-sdk.sh
|
||||
cd bin
|
||||
for file in i686-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
|
||||
echo "PATH=/home/runner/i686-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
|
||||
echo "LD_LIBRARY_PATH=/home/runner/i686-godot-linux-gnu_sdk-buildroot/i686-godot-linux-gnu/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
|
||||
- name: Cache Mono Sources
|
||||
id: cache_mono_sources
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
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@v5
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
@@ -79,11 +90,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@v5
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Patch Mono
|
||||
@@ -100,7 +111,7 @@ jobs:
|
||||
mkdir -p $HOME/mono-installs-artifacts
|
||||
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/linux-${{ matrix.target }}.zip desktop-linux-${{ matrix.target }}-release)
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-${{ matrix.target }}
|
||||
path: ~/mono-installs-artifacts/linux-${{ matrix.target }}.zip
|
||||
@@ -108,14 +119,14 @@ 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: Upload config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-${{ matrix.target }}-config.log
|
||||
path: ~/mono-configs/desktop-linux-${{ matrix.target }}-release/config.log
|
||||
|
||||
windows:
|
||||
name: Windows
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
target: [x86, x86_64]
|
||||
@@ -138,13 +149,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@v4
|
||||
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@v5
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
@@ -153,11 +164,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@v5
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Patch Mono
|
||||
@@ -174,7 +185,7 @@ jobs:
|
||||
mkdir -p $HOME/mono-installs-artifacts
|
||||
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/windows-${{ matrix.target }}.zip desktop-windows-${{ matrix.target }}-release)
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-${{ matrix.target }}
|
||||
path: ~/mono-installs-artifacts/windows-${{ matrix.target }}.zip
|
||||
@@ -182,33 +193,41 @@ 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: Upload config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-${{ matrix.target }}-config.log
|
||||
path: ~/mono-configs/desktop-windows-${{ matrix.target }}-release/config.log
|
||||
|
||||
osx:
|
||||
name: macOS
|
||||
runs-on: macos-latest
|
||||
runs-on: macos-13
|
||||
strategy:
|
||||
matrix:
|
||||
target: [x86_64]
|
||||
target: [arm64, x86_64]
|
||||
steps:
|
||||
- name: Set Environment Variables
|
||||
run: |
|
||||
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
|
||||
- name: Setup compatible Xcode version
|
||||
uses: maxim-lobanov/setup-xcode@v1
|
||||
with:
|
||||
xcode-version: ${{ env.XCODE_VERSION }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
brew install autoconf automake libtool pkg-config cmake python3
|
||||
brew install automake
|
||||
- name: Install cmake 3
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.31.7'
|
||||
- name: Cache Mono Sources
|
||||
id: cache_mono_sources
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
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@v5
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
@@ -217,15 +236,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@v5
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Patch Mono
|
||||
run:
|
||||
run: |
|
||||
python3 godot-mono-builds/patch_mono.py
|
||||
- name: Configure
|
||||
run:
|
||||
@@ -238,7 +257,7 @@ jobs:
|
||||
mkdir -p $HOME/mono-installs-artifacts
|
||||
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/osx-${{ matrix.target }}.zip desktop-osx-${{ matrix.target }}-release)
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: osx-${{ matrix.target }}
|
||||
path: ~/mono-installs-artifacts/osx-${{ matrix.target }}.zip
|
||||
@@ -246,14 +265,14 @@ 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: Upload config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: osx-${{ matrix.target }}-config.log
|
||||
path: ~/mono-configs/desktop-osx-${{ matrix.target }}-release/config.log
|
||||
|
||||
ios:
|
||||
name: iOS
|
||||
runs-on: macos-latest
|
||||
runs-on: macos-13
|
||||
strategy:
|
||||
matrix:
|
||||
target: [arm64, x86_64, arm64-sim]
|
||||
@@ -261,18 +280,26 @@ jobs:
|
||||
- name: Set Environment Variables
|
||||
run: |
|
||||
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
|
||||
- name: Setup compatible Xcode version
|
||||
uses: maxim-lobanov/setup-xcode@v1
|
||||
with:
|
||||
xcode-version: ${{ env.XCODE_VERSION }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
brew install autoconf automake libtool pkg-config cmake python3
|
||||
brew install automake
|
||||
- name: Install cmake 3
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.31.7'
|
||||
- name: Cache Mono Sources
|
||||
id: cache_mono_sources
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
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@v5
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
@@ -281,15 +308,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@v5
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Patch Mono
|
||||
run:
|
||||
run: |
|
||||
python3 godot-mono-builds/patch_mono.py
|
||||
- name: Configure
|
||||
run: |
|
||||
@@ -303,7 +330,7 @@ jobs:
|
||||
mkdir -p $HOME/mono-installs-artifacts
|
||||
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/ios-${{ matrix.target }}.zip ios-${{ matrix.target }}-release)
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-${{ matrix.target }}
|
||||
path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip
|
||||
@@ -311,15 +338,16 @@ 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: Upload config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-${{ matrix.target }}-config.log
|
||||
path: ~/mono-configs/ios-${{ matrix.target }}-release/config.log
|
||||
|
||||
ios-cross:
|
||||
# Disable for now as it doesn't build.
|
||||
needs: llvm
|
||||
name: iOS Cross-compiler
|
||||
runs-on: macos-latest
|
||||
runs-on: macos-13
|
||||
strategy:
|
||||
matrix:
|
||||
target: [cross-arm64]
|
||||
@@ -331,18 +359,26 @@ jobs:
|
||||
- name: Set Environment Variables
|
||||
run: |
|
||||
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
|
||||
- name: Setup compatible Xcode version
|
||||
uses: maxim-lobanov/setup-xcode@v1
|
||||
with:
|
||||
xcode-version: ${{ env.XCODE_VERSION }}
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
brew install autoconf automake libtool pkg-config cmake python3
|
||||
brew install automake
|
||||
- name: Install cmake 3
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.31.7'
|
||||
- name: Cache Mono Sources
|
||||
id: cache_mono_sources
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
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@v5
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
@@ -351,20 +387,20 @@ 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@v5
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Patch Mono
|
||||
run:
|
||||
run: |
|
||||
python3 godot-mono-builds/patch_mono.py
|
||||
- name: Download LLVM artifact
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: llvm-${{ matrix.llvm }}-macos-latest
|
||||
name: llvm-${{ matrix.llvm }}-macos-13
|
||||
# Tilde ~/ not supported when downloading yet: https://github.com/actions/download-artifact/issues/37
|
||||
# File permissions are also messed up: https://github.com/actions/upload-artifact/issues/38
|
||||
# We have to manually move the folder and restore the file permissions in the next step.
|
||||
@@ -390,7 +426,7 @@ jobs:
|
||||
mkdir -p $HOME/mono-installs-artifacts
|
||||
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/ios-${{ matrix.target }}.zip ios-${{ matrix.target }}-release)
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-${{ matrix.target }}
|
||||
path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip
|
||||
@@ -398,23 +434,23 @@ 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: Upload Runtime config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-${{ matrix.target }}-runtime-config.log
|
||||
path: ~/mono-configs/ios-${{ matrix.runtime_target }}-release/config.log
|
||||
- name: Upload Cross config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-${{ matrix.target }}-config.log
|
||||
path: ~/mono-configs/ios-${{ matrix.target }}-release/config.log
|
||||
|
||||
android:
|
||||
name: Android
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
target: [armeabi-v7a, arm64-v8a, x86, x86_64]
|
||||
target: [armv7, arm64v8, x86, x86_64]
|
||||
steps:
|
||||
- name: Set Environment Variables
|
||||
run: |
|
||||
@@ -423,24 +459,15 @@ jobs:
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
|
||||
sudo apt-get -y install snapd
|
||||
- name: Install Android SDK Manager
|
||||
run: |
|
||||
sudo snap install androidsdk
|
||||
androidsdk "platforms;${ANDROID_PLATFORM}"
|
||||
androidsdk "ndk;${ANDROID_NDK_VERSION}"
|
||||
androidsdk "cmake;${ANDROID_CMAKE_VERSION}"
|
||||
echo "ANDROID_SDK_ROOT=$HOME/snap/androidsdk/current/" >> $GITHUB_ENV
|
||||
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@v4
|
||||
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@v5
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
@@ -449,11 +476,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@v5
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Patch Mono
|
||||
@@ -461,16 +488,16 @@ jobs:
|
||||
python3 godot-mono-builds/patch_mono.py
|
||||
- name: Configure
|
||||
run:
|
||||
python3 godot-mono-builds/android.py configure --target=${{ matrix.target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||
python3 godot-mono-builds/android.py configure --target=${{ matrix.target }} -j 2
|
||||
- name: Make
|
||||
run:
|
||||
python3 godot-mono-builds/android.py make --target=${{ matrix.target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||
python3 godot-mono-builds/android.py make --target=${{ matrix.target }} -j 2
|
||||
- name: Compress Output
|
||||
run: |
|
||||
mkdir -p $HOME/mono-installs-artifacts
|
||||
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/android-${{ matrix.target }}.zip android-${{ matrix.target }}-release)
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: android-${{ matrix.target }}
|
||||
path: ~/mono-installs-artifacts/android-${{ matrix.target }}.zip
|
||||
@@ -478,165 +505,14 @@ 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: Upload config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android-${{ matrix.target }}-config.log
|
||||
path: ~/mono-configs/android-${{ matrix.target }}-release/config.log
|
||||
|
||||
android-cross:
|
||||
needs: llvm
|
||||
name: Android Cross-compiler
|
||||
runs-on: ${{ matrix.os }}
|
||||
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]
|
||||
exclude:
|
||||
- target: cross-arm
|
||||
os: ubuntu-latest
|
||||
- target: cross-arm64
|
||||
os: ubuntu-latest
|
||||
- target: cross-x86
|
||||
os: ubuntu-latest
|
||||
- target: cross-x86_64
|
||||
os: ubuntu-latest
|
||||
- target: cross-arm-win
|
||||
os: ubuntu-18.04
|
||||
- target: cross-arm64-win
|
||||
os: ubuntu-18.04
|
||||
- target: cross-x86-win
|
||||
os: ubuntu-18.04
|
||||
- target: cross-x86_64-win
|
||||
os: ubuntu-18.04
|
||||
include:
|
||||
- target: cross-arm
|
||||
llvm: llvm64
|
||||
runtime_target: armeabi-v7a
|
||||
os: ubuntu-18.04
|
||||
- target: cross-arm64
|
||||
llvm: llvm64
|
||||
runtime_target: arm64-v8a
|
||||
os: ubuntu-18.04
|
||||
- target: cross-x86
|
||||
llvm: llvm64
|
||||
runtime_target: x86
|
||||
os: ubuntu-18.04
|
||||
- target: cross-x86_64
|
||||
llvm: llvm64
|
||||
runtime_target: x86_64
|
||||
os: ubuntu-18.04
|
||||
- target: cross-arm-win
|
||||
llvm: llvmwin64
|
||||
runtime_target: armeabi-v7a
|
||||
os: ubuntu-latest
|
||||
- target: cross-arm64-win
|
||||
llvm: llvmwin64
|
||||
runtime_target: arm64-v8a
|
||||
os: ubuntu-latest
|
||||
- target: cross-x86-win
|
||||
llvm: llvmwin64
|
||||
runtime_target: x86
|
||||
os: ubuntu-latest
|
||||
- target: cross-x86_64-win
|
||||
llvm: llvmwin64
|
||||
runtime_target: x86_64
|
||||
os: ubuntu-latest
|
||||
steps:
|
||||
- name: Set Environment Variables
|
||||
run: |
|
||||
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
|
||||
- name: Install Dependencies (Targeting Windows)
|
||||
if: matrix.llvm == 'llvmwin64'
|
||||
run: |
|
||||
sudo apt-get -y install mingw-w64 libz-mingw-w64-dev
|
||||
- name: Install Android SDK Manager
|
||||
run: |
|
||||
sudo apt-get -y install snapd
|
||||
sudo snap install androidsdk
|
||||
androidsdk "ndk;${ANDROID_NDK_VERSION}"
|
||||
androidsdk "cmake;${ANDROID_CMAKE_VERSION}"
|
||||
echo "ANDROID_SDK_ROOT=$HOME/snap/androidsdk/current/" >> $GITHUB_ENV
|
||||
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
|
||||
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
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
submodules: true
|
||||
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||
- 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
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Download LLVM artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: llvm-${{ matrix.llvm }}-${{ matrix.os }}
|
||||
# Tilde ~/ not supported when downloading yet: https://github.com/actions/download-artifact/issues/37
|
||||
# File permissions are also messed up: https://github.com/actions/upload-artifact/issues/38
|
||||
# We have to manually move the folder and restore the file permissions in the next step.
|
||||
path: ./llvm-${{ matrix.llvm }}
|
||||
- name: Stamp LLVM
|
||||
run: |
|
||||
mkdir -p $HOME/mono-installs/ && mv ./llvm-${{ matrix.llvm }} $HOME/mono-installs/
|
||||
chmod 755 $HOME/mono-installs/llvm-${{ matrix.llvm }}/bin/*
|
||||
mkdir -p $HOME/mono-configs/ && touch $HOME/mono-configs/.stamp-${{ matrix.llvm }}-make
|
||||
- name: Patch Mono
|
||||
run:
|
||||
python3 godot-mono-builds/patch_mono.py
|
||||
- name: Configure Runtime
|
||||
run:
|
||||
python3 godot-mono-builds/android.py configure --target=${{ matrix.runtime_target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||
- name: Configure
|
||||
run:
|
||||
python3 godot-mono-builds/android.py configure --target=${{ matrix.target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||
- name: Make
|
||||
run:
|
||||
python3 godot-mono-builds/android.py make --target=${{ matrix.target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||
- name: Compress Output
|
||||
run: |
|
||||
mkdir -p $HOME/mono-installs-artifacts
|
||||
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/android-${{ matrix.target }}.zip android-${{ matrix.target }}-release)
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android-${{ matrix.target }}
|
||||
path: ~/mono-installs-artifacts/android-${{ matrix.target }}.zip
|
||||
- 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: Upload Runtime config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android-${{ matrix.target }}-runtime-config.log
|
||||
path: ~/mono-configs/android-${{ matrix.runtime_target }}-release/config.log
|
||||
- name: Upload Cross config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: android-${{ matrix.target }}-config.log
|
||||
path: ~/mono-configs/android-${{ matrix.target }}-release/config.log
|
||||
|
||||
wasm:
|
||||
name: WebAssembly
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
target: [runtime, runtime-threads]
|
||||
@@ -650,13 +526,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@v4
|
||||
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@v5
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
@@ -665,15 +541,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@v5
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Setup Emscripten SDK
|
||||
uses: mymindstorm/setup-emsdk@v11
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: ${{ env.EMSDK_VERSION }}
|
||||
- name: Patch Mono
|
||||
@@ -690,7 +566,7 @@ jobs:
|
||||
mkdir -p $HOME/mono-installs-artifacts
|
||||
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/wasm-${{ matrix.target }}.zip wasm-${{ matrix.target }}-release)
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wasm-${{ matrix.target }}
|
||||
path: ~/mono-installs-artifacts/wasm-${{ matrix.target }}.zip
|
||||
@@ -698,7 +574,7 @@ 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: Upload config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wasm-${{ matrix.target }}-config.log
|
||||
path: ~/mono-configs/wasm-${{ matrix.target }}-release/config.log
|
||||
@@ -708,51 +584,68 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-18.04, ubuntu-latest, macos-latest]
|
||||
os: [ubuntu-22.04, macos-13]
|
||||
target: [llvm64, llvmwin64]
|
||||
exclude:
|
||||
# Ubuntu 18.04 is only needed for the Linux build
|
||||
- os: ubuntu-18.04
|
||||
target: llvmwin64
|
||||
# Ubuntu latest is only needed for the Windows build
|
||||
- os: ubuntu-latest
|
||||
target: llvm64
|
||||
# We already build for Windows on ubuntu-latest
|
||||
- os: macos-latest
|
||||
# We already build for Windows on ubuntu-22.04
|
||||
- os: macos-13
|
||||
target: llvmwin64
|
||||
steps:
|
||||
- name: Cache LLVM
|
||||
id: cache_llvm
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/mono-installs/llvm-${{ matrix.target }}
|
||||
key: ${{ runner.os }}-${{ env.MONO_TAG }}-llvm-${{ matrix.target }}
|
||||
- name: Set Environment Variables
|
||||
run: |
|
||||
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
|
||||
- name: Setup compatible Xcode version
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-13'
|
||||
uses: maxim-lobanov/setup-xcode@v1
|
||||
with:
|
||||
xcode-version: ${{ env.XCODE_VERSION }}
|
||||
- name: Install Dependencies (Linux)
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
|
||||
sudo apt-get -y install git autoconf libtool libtool-bin automake gettext cmake python3 curl
|
||||
- name: Install Linux SDK (x86_64)
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux'
|
||||
run: |
|
||||
cd /home/runner
|
||||
curl -LO https://github.com/godotengine/buildroot/releases/download/godot-2023.08.x-4/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
cd x86_64-godot-linux-gnu_sdk-buildroot
|
||||
./relocate-sdk.sh
|
||||
cd bin
|
||||
for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
|
||||
echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
|
||||
echo "LD_LIBRARY_PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/x86_64-godot-linux-gnu/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
|
||||
- name: Install Dependencies (Linux Targeting Windows)
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.target == 'llvmwin64'
|
||||
run: |
|
||||
sudo apt-get -y install mingw-w64 libz-mingw-w64-dev
|
||||
- name: Install Dependencies (macOS)
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-latest'
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-13'
|
||||
run: |
|
||||
brew install autoconf automake libtool pkg-config cmake python3
|
||||
brew install automake
|
||||
- name: Install cmake 3 (macOS)
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-13'
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.31.7'
|
||||
- name: Cache Mono Sources
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true'
|
||||
id: cache_mono_sources
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
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@v5
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
@@ -763,24 +656,24 @@ 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@v5
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true'
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Patch Mono
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true'
|
||||
run:
|
||||
run: |
|
||||
python3 godot-mono-builds/patch_mono.py
|
||||
- name: Make
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true'
|
||||
run:
|
||||
python3 godot-mono-builds/llvm.py make --target=${{ matrix.target }} -j 2
|
||||
- name: Upload LLVM Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: llvm-${{ matrix.target }}-${{ matrix.os }}
|
||||
path: ~/mono-installs/llvm-${{ matrix.target }}
|
||||
@@ -789,14 +682,14 @@ 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: Upload config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: llvm-${{ matrix.target }}-${{ matrix.os }}-config.log
|
||||
path: ~/mono-configs/llvm-${{ matrix.target }}/config.log
|
||||
|
||||
bcl:
|
||||
name: BCL
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
product: [desktop, desktop-win32, android, ios, wasm]
|
||||
@@ -807,16 +700,28 @@ jobs:
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
|
||||
sudo apt-get -y install git autoconf libtool libtool-bin automake gettext cmake python3 curl
|
||||
- name: Install Linux SDK (x86_64)
|
||||
run: |
|
||||
cd /home/runner
|
||||
curl -LO https://github.com/godotengine/buildroot/releases/download/godot-2023.08.x-4/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
||||
cd x86_64-godot-linux-gnu_sdk-buildroot
|
||||
./relocate-sdk.sh
|
||||
cd bin
|
||||
for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
|
||||
echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
|
||||
echo "LD_LIBRARY_PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/x86_64-godot-linux-gnu/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
|
||||
- name: Cache Mono Sources
|
||||
id: cache_mono_sources
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
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@v5
|
||||
with:
|
||||
repository: mono/mono
|
||||
ref: ${{ env.MONO_TAG }}
|
||||
@@ -825,11 +730,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@v5
|
||||
with:
|
||||
path: godot-mono-builds
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
- name: Patch Mono
|
||||
@@ -847,7 +752,7 @@ jobs:
|
||||
mkdir -p $HOME/mono-installs-artifacts
|
||||
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/bcl-${{ matrix.product }}.zip ${{ matrix.product }}-bcl)
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bcl-${{ matrix.product }}
|
||||
path: ~/mono-installs-artifacts/bcl-${{ matrix.product }}.zip
|
||||
@@ -855,16 +760,16 @@ 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: Upload config.log After Error
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bcl-${{ matrix.product }}-config.log
|
||||
path: ~/mono-configs/bcl/config.log
|
||||
|
||||
create-release:
|
||||
if: success() && github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release/')
|
||||
needs: [linux, windows, osx, ios, ios-cross, android, android-cross, wasm, bcl]
|
||||
needs: [linux, windows, osx, ios, ios-cross, android, wasm, bcl]
|
||||
name: Create Release
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
steps:
|
||||
@@ -883,8 +788,6 @@ jobs:
|
||||
Mono Version: ${{ env.MONO_TAG }}
|
||||
|
||||
EMSDK Version: ${{ env.EMSDK_VERSION }}
|
||||
Android Platform: ${{ env.ANDROID_PLATFORM }}
|
||||
Android API: ${{ env.ANDROID_API }}
|
||||
iOS Min Version: ${{ env.IOS_VERSION_MIN }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
@@ -893,19 +796,17 @@ 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-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
artifact_name: [linux-x86, linux-x86_64, windows-x86, windows-x86_64, osx-x86_64,
|
||||
artifact_name: [linux-x86, linux-x86_64, windows-x86, windows-x86_64, osx-arm64, osx-x86_64,
|
||||
ios-arm64, ios-x86_64, ios-cross-arm64,
|
||||
android-armeabi-v7a, android-arm64-v8a, android-x86, android-x86_64,
|
||||
android-cross-arm, android-cross-arm64, android-cross-x86, android-cross-x86_64,
|
||||
android-cross-arm-win, android-cross-arm64-win, android-cross-x86-win, android-cross-x86_64-win,
|
||||
android-armv7, android-arm64v8, android-x86, android-x86_64,
|
||||
wasm-runtime, wasm-runtime-threads,
|
||||
bcl-desktop, bcl-desktop-win32, bcl-android, bcl-ios, bcl-wasm]
|
||||
steps:
|
||||
- name: Download Artifact
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: ${{ matrix.artifact_name }}
|
||||
path: ./
|
||||
|
||||
4
.github/workflows/static_checks.yml
vendored
4
.github/workflows/static_checks.yml
vendored
@@ -3,10 +3,10 @@ on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Lint repo
|
||||
run: |
|
||||
|
||||
23
README.md
23
README.md
@@ -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.182.
|
||||
- Mono: 6.12.0.206.
|
||||
- Emscripten: 1.39.9.
|
||||
- Android: API level 32.
|
||||
- Android NDK: 23.2.8568313
|
||||
|
||||
## Command-line options
|
||||
|
||||
@@ -72,25 +72,18 @@ _AOT cross-compilers for desktop platforms cannot be built with these scripts ye
|
||||
|
||||
## Android
|
||||
|
||||
Building for Android requires the Android SDK cmdline-tools to be installed in the Android SDK folder.
|
||||
|
||||
```bash
|
||||
# These are the default values. This step can be omitted if SDK and NDK root are in this location.
|
||||
# The default location for the Android SDK is $HOME/Android/Sdk. This step can be omitted if SDK is in this location.
|
||||
export ANDROID_SDK_ROOT=$HOME/Android/Sdk
|
||||
export ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk-bundle
|
||||
|
||||
# Build the runtime for all supported Android ABIs.
|
||||
./android.py configure --target=all-runtime
|
||||
./android.py make --target=all-runtime
|
||||
|
||||
# Build the AOT cross-compilers targeting all supported Android ABIs.
|
||||
./android.py configure --target=all-cross
|
||||
./android.py make --target=all-cross
|
||||
|
||||
# Build the AOT cross-compilers for Windows targeting all supported Android ABIs.
|
||||
./android.py configure --target=all-cross-win --mxe-prefix=/usr
|
||||
./android.py make --target=all-cross-win --mxe-prefix=/usr
|
||||
./android.py configure --target=all-targets
|
||||
./android.py make --target=all-targets
|
||||
```
|
||||
|
||||
The option `--target=all-runtime` is a shortcut for `--target=armeabi-v7a --target=x86 --target=arm64-v8a --target=x86_64`. The equivalent applies for `all-cross` and `all-cross-win`.
|
||||
The option `--target=all-targets` is a shortcut for `--target=armv7 --target=arm64v8 --target=x86 --target=x86_64`.
|
||||
|
||||
# iOS
|
||||
|
||||
|
||||
456
android.py
456
android.py
@@ -2,142 +2,127 @@
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from os.path import join as path_join
|
||||
|
||||
from options import *
|
||||
from os_utils import *
|
||||
import runtime
|
||||
|
||||
|
||||
runtime_targets = ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64']
|
||||
cross_targets = ['cross-arm', 'cross-arm64', 'cross-x86', 'cross-x86_64']
|
||||
cross_mxe_targets = ['cross-arm-win', 'cross-arm64-win', 'cross-x86-win', 'cross-x86_64-win']
|
||||
DEFAULT_NDK_VERSION = '23.2.8568313'
|
||||
DEFAULT_CMAKE_VERSION = '3.18.1'
|
||||
targets = ['armv7', 'arm64v8', 'x86', 'x86_64']
|
||||
|
||||
|
||||
def is_cross(target) -> bool:
|
||||
return target in cross_targets or is_cross_mxe(target)
|
||||
def get_min_api_version(target) -> str:
|
||||
# Minimum API version should be in sync with Godot's platform/android/detect.py.
|
||||
# Note: The minimum API version for arm64v8 and x86_64 is '21'
|
||||
min_versions = {
|
||||
'armv7': '19',
|
||||
'arm64v8': '21',
|
||||
'x86': '19',
|
||||
'x86_64': '21',
|
||||
}
|
||||
return min_versions[target]
|
||||
|
||||
|
||||
def is_cross_mxe(target) -> bool:
|
||||
return target in cross_mxe_targets
|
||||
def check_for_android_ndk(opts: AndroidOpts):
|
||||
if not os.path.exists(os.path.join(opts.android_sdk_root, 'ndk', opts.android_ndk_version)):
|
||||
print("Attempting to install Android NDK version %s" % (opts.android_ndk_version))
|
||||
sdkmanager = opts.android_sdk_root + "/cmdline-tools/latest/bin/sdkmanager"
|
||||
if os.path.exists(sdkmanager):
|
||||
sdk_args = "ndk;" + opts.android_ndk_version
|
||||
subprocess.check_call([sdkmanager, sdk_args])
|
||||
else:
|
||||
print("ERROR: Cannot find %s. Please ensure ANDROID_SDK_ROOT is correct and cmdline-tools are installed" % (sdkmanager))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def android_autodetect_cmake(opts: AndroidOpts) -> str:
|
||||
from distutils.version import LooseVersion
|
||||
from os import listdir
|
||||
|
||||
sdk_cmake_basedir = path_join(opts.android_sdk_root, 'cmake')
|
||||
versions = []
|
||||
|
||||
for entry in listdir(sdk_cmake_basedir):
|
||||
if os.path.isdir(path_join(sdk_cmake_basedir, entry)):
|
||||
try:
|
||||
version = LooseVersion(entry)
|
||||
versions += [version]
|
||||
except ValueError:
|
||||
continue # Not a version folder
|
||||
|
||||
if len(versions) == 0:
|
||||
raise BuildError('Cannot auto-detect Android CMake version')
|
||||
|
||||
lattest_version = str(sorted(versions)[-1])
|
||||
print('Auto-detected Android CMake version: ' + lattest_version)
|
||||
|
||||
return lattest_version
|
||||
def check_for_cmake(opts: AndroidOpts):
|
||||
if not os.path.exists(os.path.join(opts.android_sdk_root, 'cmake', opts.android_cmake_version)):
|
||||
print("Attempting to install CMake version %s" % (opts.android_cmake_version))
|
||||
sdkmanager = opts.android_sdk_root + "/cmdline-tools/latest/bin/sdkmanager"
|
||||
if os.path.exists(sdkmanager):
|
||||
sdk_args = "cmake;" + opts.android_cmake_version
|
||||
subprocess.check_call([sdkmanager, sdk_args])
|
||||
else:
|
||||
print("ERROR: Cannot find %s. Please ensure ANDROID_SDK_ROOT is correct and cmdline-tools are installed" % (sdkmanager))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def get_api_version_or_min(opts: AndroidOpts, target: str) -> str:
|
||||
min_versions = { 'arm64-v8a': '21', 'x86_64': '21' }
|
||||
if target in min_versions and int(opts.android_api_version) < int(min_versions[target]):
|
||||
print('WARNING: %s is less than minimum platform for %s; using %s' % (opts.android_api_version, target, min_versions[target]))
|
||||
return min_versions[target]
|
||||
min_api_version = get_min_api_version(target)
|
||||
if int(opts.android_api_version) < int(min_api_version):
|
||||
print('WARNING: API version %s is less than the minimum for platform %s; using %s' % (opts.android_api_version, target, min_api_version))
|
||||
return min_api_version
|
||||
return opts.android_api_version
|
||||
|
||||
|
||||
def get_android_cmake_version(opts: AndroidOpts) -> str:
|
||||
return opts.android_cmake_version if opts.android_cmake_version != 'autodetect' else android_autodetect_cmake(opts)
|
||||
|
||||
|
||||
class AndroidTargetTable:
|
||||
archs = {
|
||||
'armeabi-v7a': 'arm',
|
||||
'arm64-v8a': 'arm64',
|
||||
'x86': 'x86',
|
||||
'x86_64': 'x86_64'
|
||||
}
|
||||
|
||||
abi_names = {
|
||||
'armeabi-v7a': 'arm-linux-androideabi',
|
||||
'arm64-v8a': 'aarch64-linux-android',
|
||||
'x86': 'i686-linux-android',
|
||||
'x86_64': 'x86_64-linux-android'
|
||||
}
|
||||
|
||||
host_triples = {
|
||||
'armeabi-v7a': 'armv5-linux-androideabi',
|
||||
'arm64-v8a': 'aarch64-linux-android',
|
||||
'x86': 'i686-linux-android',
|
||||
'x86_64': 'x86_64-linux-android'
|
||||
}
|
||||
|
||||
|
||||
def setup_android_target_template(env: dict, opts: AndroidOpts, target: str):
|
||||
extra_target_envs = {
|
||||
'armeabi-v7a': {
|
||||
'android-armeabi-v7a_CFLAGS': ['-D__POSIX_VISIBLE=201002', '-DSK_RELEASE', '-DNDEBUG', '-UDEBUG', '-fpic', '-march=armv7-a', '-mtune=cortex-a8', '-mfpu=vfp', '-mfloat-abi=softfp'],
|
||||
'android-armeabi-v7a_CXXFLAGS': ['-D__POSIX_VISIBLE=201002', '-DSK_RELEASE', '-DNDEBUG', '-UDEBUG', '-fpic', '-march=armv7-a', '-mtune=cortex-a8', '-mfpu=vfp', '-mfloat-abi=softfp'],
|
||||
'android-armeabi-v7a_LDFLAGS': ['-Wl,--fix-cortex-a8']
|
||||
'armv7': {
|
||||
'android-armv7_CFLAGS': ['-D__POSIX_VISIBLE=201002', '-DSK_RELEASE', '-DNDEBUG', '-UDEBUG', '-fpic', '-march=armv7-a', '-mtune=cortex-a8', '-mfpu=vfp', '-mfloat-abi=softfp'],
|
||||
'android-armv7_CXXFLAGS': ['-D__POSIX_VISIBLE=201002', '-DSK_RELEASE', '-DNDEBUG', '-UDEBUG', '-fpic', '-march=armv7-a', '-mtune=cortex-a8', '-mfpu=vfp', '-mfloat-abi=softfp'],
|
||||
'android-armv7_LDFLAGS': ['-Wl,--fix-cortex-a8']
|
||||
},
|
||||
'arm64-v8a': {
|
||||
'android-arm64-v8a_CFLAGS': ['-D__POSIX_VISIBLE=201002', '-DSK_RELEASE', '-DNDEBUG', '-UDEBUG', '-fpic', '-DL_cuserid=9', '-DANDROID64'],
|
||||
'android-arm64-v8a_CXXFLAGS': ['-D__POSIX_VISIBLE=201002', '-DSK_RELEASE', '-DNDEBUG', '-UDEBUG', '-fpic', '-DL_cuserid=9', '-DANDROID64']
|
||||
'arm64v8': {
|
||||
'android-arm64v8_CFLAGS': ['-D__POSIX_VISIBLE=201002', '-DSK_RELEASE', '-DNDEBUG', '-UDEBUG', '-fpic', '-DL_cuserid=9', '-DANDROID64'],
|
||||
'android-arm64v8_CXXFLAGS': ['-D__POSIX_VISIBLE=201002', '-DSK_RELEASE', '-DNDEBUG', '-UDEBUG', '-fpic', '-DL_cuserid=9', '-DANDROID64'],
|
||||
'android-arm64v8_LDFLAGS': ['-Wl,-z,max-page-size=16384', '-Wl,-z,common-page-size=16384']
|
||||
},
|
||||
'x86': {},
|
||||
'x86_64': {
|
||||
'android-x86_64_CFLAGS': ['-DL_cuserid=9'],
|
||||
'android-x86_64_CXXFLAGS': ['-DL_cuserid=9']
|
||||
'android-x86_64_CXXFLAGS': ['-DL_cuserid=9'],
|
||||
'android-x86_64_LDFLAGS': ['-Wl,-z,max-page-size=16384', '-Wl,-z,common-page-size=16384']
|
||||
}
|
||||
}
|
||||
env.update(extra_target_envs[target])
|
||||
|
||||
if target in extra_target_envs:
|
||||
env.update(extra_target_envs[target])
|
||||
if target == "armv7":
|
||||
target_triple = "armv7a-linux-androideabi"
|
||||
bin_utils = "arm-linux-androideabi"
|
||||
elif target == "arm64v8":
|
||||
target_triple = "aarch64-linux-android"
|
||||
bin_utils = target_triple
|
||||
elif target == "x86":
|
||||
target_triple = "i686-linux-android"
|
||||
bin_utils = target_triple
|
||||
elif target == "x86_64":
|
||||
target_triple = "x86_64-linux-android"
|
||||
bin_utils = target_triple
|
||||
|
||||
arch = AndroidTargetTable.archs[target]
|
||||
abi_name = AndroidTargetTable.abi_names[target]
|
||||
host_triple = AndroidTargetTable.host_triples[target]
|
||||
api = env['ANDROID_API_VERSION']
|
||||
if sys.platform.startswith("linux"):
|
||||
host_subpath = "linux-x86_64"
|
||||
elif sys.platform.startswith("darwin"):
|
||||
host_subpath = "darwin-x86_64"
|
||||
elif sys.platform.startswith("win"):
|
||||
if platform.machine().endswith("64"):
|
||||
host_subpath = "windows-x86_64"
|
||||
else:
|
||||
host_subpath = "windows"
|
||||
|
||||
toolchain_path = path_join(opts.android_toolchains_prefix, opts.toolchain_name_fmt % (target, api))
|
||||
cmake_path = os.path.join(opts.android_sdk_root, 'cmake', opts.android_cmake_version, 'bin')
|
||||
ndk_path = os.path.join(opts.android_sdk_root, 'ndk', opts.android_ndk_version)
|
||||
toolchain_path = os.path.join(ndk_path, 'toolchains/llvm/prebuilt', host_subpath)
|
||||
compiler_path = os.path.join(toolchain_path, 'bin')
|
||||
compiler_wrapper = target_triple + env['ANDROID_API_VERSION'] + '-'
|
||||
bin_utils_path = os.path.join(toolchain_path, bin_utils, 'bin')
|
||||
android_api = env['ANDROID_API_VERSION']
|
||||
|
||||
tools_path = path_join(toolchain_path, 'bin')
|
||||
name_fmt = abi_name + '-%s'
|
||||
|
||||
sdk_cmake_dir = path_join(opts.android_sdk_root, 'cmake', get_android_cmake_version(opts))
|
||||
if not os.path.isdir(sdk_cmake_dir):
|
||||
print('Android CMake directory \'%s\' not found' % sdk_cmake_dir)
|
||||
|
||||
AR = path_join(tools_path, name_fmt % 'ar')
|
||||
AS = path_join(tools_path, name_fmt % 'as')
|
||||
CC = path_join(tools_path, name_fmt % 'clang')
|
||||
CXX = path_join(tools_path, name_fmt % 'clang++')
|
||||
AR = os.path.join(compiler_path, 'llvm-ar')
|
||||
AS = os.path.join(bin_utils_path, 'as')
|
||||
CC = os.path.join(compiler_path, compiler_wrapper + 'clang')
|
||||
CXX = os.path.join(compiler_path, compiler_wrapper + 'clang++')
|
||||
LD = os.path.join(compiler_path, 'ld')
|
||||
DLLTOOL = ''
|
||||
LD = path_join(tools_path, name_fmt % 'ld')
|
||||
OBJDUMP = path_join(tools_path, name_fmt % 'objdump')
|
||||
RANLIB = path_join(tools_path, name_fmt % 'ranlib')
|
||||
CMAKE = path_join(sdk_cmake_dir, 'bin', 'cmake')
|
||||
STRIP = path_join(tools_path, name_fmt % 'strip')
|
||||
|
||||
CPP = path_join(tools_path, name_fmt % 'cpp')
|
||||
if not os.path.isfile(CPP):
|
||||
CPP = path_join(tools_path, (name_fmt % 'clang'))
|
||||
CPP += ' -E'
|
||||
|
||||
CXXCPP = path_join(tools_path, name_fmt % 'cpp')
|
||||
if not os.path.isfile(CXXCPP):
|
||||
CXXCPP = path_join(tools_path, (name_fmt % 'clang++'))
|
||||
CXXCPP += ' -E'
|
||||
OBJDUMP = os.path.join(compiler_path, 'llvm-objdump')
|
||||
RANLIB = os.path.join(compiler_path, 'llvm-ranlib')
|
||||
CMAKE = os.path.join(cmake_path, 'cmake')
|
||||
STRIP = os.path.join(compiler_path, 'llvm-strip')
|
||||
CPP = CC + ' -E'
|
||||
CXXCPP = CXX + ' -E'
|
||||
|
||||
ccache_path = os.environ.get('CCACHE', '')
|
||||
if ccache_path:
|
||||
@@ -165,25 +150,18 @@ def setup_android_target_template(env: dict, opts: AndroidOpts, target: str):
|
||||
CFLAGS += [
|
||||
'-fstack-protector',
|
||||
'-DMONODROID=1'
|
||||
'-D__ANDROID_API__=' + api,
|
||||
'-D__ANDROID_API__=' + android_api
|
||||
]
|
||||
|
||||
CXXFLAGS += [
|
||||
'-fstack-protector',
|
||||
'-DMONODROID=1'
|
||||
'-D__ANDROID_API__=' + api,
|
||||
'-D__ANDROID_API__=' + android_api,
|
||||
]
|
||||
|
||||
CPPFLAGS += ['-I%s/sysroot/usr/include' % toolchain_path]
|
||||
CXXCPPFLAGS += ['-I%s/sysroot/usr/include' % toolchain_path]
|
||||
|
||||
path_link = '%s/platforms/android-%s/arch-%s/usr/lib' % (opts.android_ndk_root, api, arch)
|
||||
|
||||
LDFLAGS += [
|
||||
'-z', 'now', '-z', 'relro', '-z', 'noexecstack',
|
||||
'-ldl', '-lm', '-llog', '-lc', '-lgcc',
|
||||
'-Wl,-rpath-link=%s,-dynamic-linker=/system/bin/linker' % path_link,
|
||||
'-L' + path_link
|
||||
'-ldl', '-lm', '-llog', '-lc'
|
||||
]
|
||||
|
||||
# Fixes this error: DllImport unable to load library 'dlopen failed: empty/missing DT_HASH in "libmono-native.so" (built with --hash-style=gnu?)'.
|
||||
@@ -200,15 +178,15 @@ def setup_android_target_template(env: dict, opts: AndroidOpts, target: str):
|
||||
'--enable-minimal=ssa,portability,attach,verifier,full_messages,sgen_remset'
|
||||
',sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par'
|
||||
',sgen_copying,logging,security,shared_handles,interpreter',
|
||||
'--with-btls-android-ndk=%s' % opts.android_ndk_root,
|
||||
'--with-btls-android-api=%s' % api,
|
||||
'--with-btls-android-ndk=%s' % ndk_path,
|
||||
'--with-btls-android-api=%s' % android_api,
|
||||
]
|
||||
|
||||
CONFIGURE_FLAGS += ['--enable-monodroid']
|
||||
CONFIGURE_FLAGS += ['--with-btls-android-ndk-asm-workaround']
|
||||
|
||||
CONFIGURE_FLAGS += [
|
||||
'--with-btls-android-cmake-toolchain=%s/build/cmake/android.toolchain.cmake' % opts.android_ndk_root,
|
||||
'--with-btls-android-cmake-toolchain=%s/build/cmake/android.toolchain.cmake' % ndk_path,
|
||||
'--with-sigaltstack=yes',
|
||||
'--with-tls=pthread',
|
||||
'--without-ikvm-native',
|
||||
@@ -239,186 +217,16 @@ def setup_android_target_template(env: dict, opts: AndroidOpts, target: str):
|
||||
env['_android-%s_CONFIGURE_FLAGS' % target] = CONFIGURE_FLAGS
|
||||
|
||||
# Runtime template
|
||||
runtime.setup_runtime_template(env, opts, 'android', target, host_triple)
|
||||
runtime.setup_runtime_template(env, opts, 'android', target, target_triple)
|
||||
|
||||
|
||||
class AndroidCrossTable:
|
||||
target_archs = {
|
||||
'cross-arm': 'armv7',
|
||||
'cross-arm64': 'aarch64-v8a',
|
||||
'cross-x86': 'i686',
|
||||
'cross-x86_64': 'x86_64'
|
||||
}
|
||||
def strip_libs(opts: AndroidOpts, product: str, target: str):
|
||||
ndk_path = os.path.join(opts.android_sdk_root, 'ndk', opts.android_ndk_version)
|
||||
toolchain_path = os.path.join(ndk_path, 'toolchains/llvm/prebuilt/linux-x86_64')
|
||||
strip = os.path.join(toolchain_path, 'bin', 'llvm-strip')
|
||||
|
||||
device_targets = {
|
||||
'cross-arm': 'armeabi-v7a',
|
||||
'cross-arm64': 'arm64-v8a',
|
||||
'cross-x86': 'x86',
|
||||
'cross-x86_64': 'x86_64'
|
||||
}
|
||||
|
||||
offsets_dumper_abis = {
|
||||
'cross-arm': 'armv7-none-linux-androideabi',
|
||||
'cross-arm64': 'aarch64-v8a-linux-android',
|
||||
'cross-x86': 'i686-none-linux-android',
|
||||
'cross-x86_64': 'x86_64-none-linux-android'
|
||||
}
|
||||
|
||||
|
||||
def get_android_libclang_path(opts):
|
||||
if sys.platform == 'darwin':
|
||||
return '%s/toolchains/llvm/prebuilt/darwin-x86_64/lib64/libclang.dylib' % opts.android_ndk_root
|
||||
elif sys.platform in ['linux', 'linux2']:
|
||||
loc = '%s/toolchains/llvm/prebuilt/linux-x86_64/lib64/libclang.so.9svn' % opts.android_ndk_root
|
||||
if os.path.isfile(loc):
|
||||
return loc
|
||||
return '%s/toolchains/llvm/prebuilt/linux-x86_64/lib64/libclang.so.8svn' % opts.android_ndk_root
|
||||
assert False
|
||||
|
||||
|
||||
def setup_android_cross_template(env: dict, opts: AndroidOpts, target: str, host_arch: str):
|
||||
def get_host_triple():
|
||||
if sys.platform == 'darwin':
|
||||
return '%s-apple-darwin11' % host_arch
|
||||
elif sys.platform in ['linux', 'linux2']:
|
||||
return '%s-linux-gnu' % host_arch
|
||||
assert False
|
||||
|
||||
target_arch = AndroidCrossTable.target_archs[target]
|
||||
device_target = AndroidCrossTable.device_targets[target]
|
||||
offsets_dumper_abi = AndroidCrossTable.offsets_dumper_abis[target]
|
||||
host_triple = get_host_triple()
|
||||
target_triple = '%s-linux-android' % target_arch
|
||||
|
||||
android_libclang = get_android_libclang_path(opts)
|
||||
|
||||
env['_android-%s_OFFSETS_DUMPER_ARGS' % target] = [
|
||||
'--libclang=%s' % android_libclang,
|
||||
'--sysroot=%s/sysroot' % opts.android_ndk_root
|
||||
]
|
||||
|
||||
env['_android-%s_AR' % target] = 'ar'
|
||||
env['_android-%s_AS' % target] = 'as'
|
||||
env['_android-%s_CC' % target] = 'cc'
|
||||
env['_android-%s_CXX' % target] = 'c++'
|
||||
env['_android-%s_CXXCPP' % target] = 'cpp'
|
||||
env['_android-%s_LD' % target] = 'ld'
|
||||
env['_android-%s_RANLIB' % target] = 'ranlib'
|
||||
env['_android-%s_STRIP' % target] = 'strip'
|
||||
|
||||
is_darwin = sys.platform == 'darwin'
|
||||
|
||||
CFLAGS = []
|
||||
CFLAGS += ['-DDEBUG_CROSS'] if not opts.release else []
|
||||
CFLAGS += ['-mmacosx-version-min=10.9'] if is_darwin else []
|
||||
|
||||
env['_android-%s_CFLAGS' % target] = CFLAGS
|
||||
|
||||
CXXFLAGS = []
|
||||
CXXFLAGS += ['-DDEBUG_CROSS'] if not opts.release else []
|
||||
CXXFLAGS += ['-mmacosx-version-min=10.9', '-stdlib=libc++'] if is_darwin else []
|
||||
|
||||
env['_android-%s_CXXFLAGS' % target] = CXXFLAGS
|
||||
|
||||
env['_android-%s_CONFIGURE_FLAGS' % target] = [
|
||||
'--disable-boehm',
|
||||
'--disable-mcs-build',
|
||||
'--disable-nls',
|
||||
'--enable-maintainer-mode',
|
||||
'--with-tls=pthread'
|
||||
]
|
||||
|
||||
# Runtime cross template
|
||||
runtime.setup_runtime_cross_template(env, opts, 'android', target, host_triple, target_triple, device_target, 'llvm64', offsets_dumper_abi)
|
||||
|
||||
|
||||
def setup_android_cross_mxe_template(env: dict, opts: AndroidOpts, target: str, host_arch: str):
|
||||
table_target = cross_targets[cross_mxe_targets.index(target)] # Re-use the non-mxe table
|
||||
|
||||
target_arch = AndroidCrossTable.target_archs[table_target]
|
||||
device_target = AndroidCrossTable.device_targets[table_target]
|
||||
offsets_dumper_abi = AndroidCrossTable.offsets_dumper_abis[table_target]
|
||||
host_triple = '%s-w64-mingw32' % host_arch
|
||||
target_triple = '%s-linux-android' % target_arch
|
||||
|
||||
android_libclang = get_android_libclang_path(opts)
|
||||
|
||||
env['_android-%s_OFFSETS_DUMPER_ARGS' % target] = [
|
||||
'--libclang=%s' % android_libclang,
|
||||
'--sysroot=%s/sysroot' % opts.android_ndk_root
|
||||
]
|
||||
|
||||
mxe_bin = path_join(opts.mxe_prefix, 'bin')
|
||||
|
||||
env['_android-%s_PATH' % target] = mxe_bin
|
||||
|
||||
name_fmt = host_arch + '-w64-mingw32-%s'
|
||||
|
||||
env['_android-%s_AR' % target] = path_join(mxe_bin, name_fmt % 'ar')
|
||||
env['_android-%s_AS' % target] = path_join(mxe_bin, name_fmt % 'as')
|
||||
env['_android-%s_CC' % target] = path_join(mxe_bin, name_fmt % 'gcc')
|
||||
env['_android-%s_CXX' % target] = path_join(mxe_bin, name_fmt % 'g++')
|
||||
env['_android-%s_DLLTOOL' % target] = path_join(mxe_bin, name_fmt % 'dlltool')
|
||||
env['_android-%s_LD' % target] = path_join(mxe_bin, name_fmt % 'ld')
|
||||
env['_android-%s_OBJDUMP' % target] = path_join(mxe_bin, name_fmt % 'objdump')
|
||||
env['_android-%s_RANLIB' % target] = path_join(mxe_bin, name_fmt % 'ranlib')
|
||||
env['_android-%s_STRIP' % target] = path_join(mxe_bin, name_fmt % 'strip')
|
||||
|
||||
mingw_zlib_prefix = '%s/opt/mingw-zlib/usr' % opts.mxe_prefix
|
||||
if not os.path.isdir(mingw_zlib_prefix):
|
||||
mingw_zlib_prefix = opts.mxe_prefix
|
||||
|
||||
CFLAGS = []
|
||||
CFLAGS += ['-DDEBUG_CROSS'] if not opts.release else []
|
||||
CFLAGS += ['-I%s/%s-w64-mingw32/include' % (mingw_zlib_prefix, host_arch)]
|
||||
|
||||
env['_android-%s_CFLAGS' % target] = CFLAGS
|
||||
|
||||
CXXFLAGS = []
|
||||
CXXFLAGS += ['-DDEBUG_CROSS'] if not opts.release else []
|
||||
CXXFLAGS += ['-I%s/%s-w64-mingw32/include' % (mingw_zlib_prefix, host_arch)]
|
||||
|
||||
env['_android-%s_CXXFLAGS' % target] = CXXFLAGS
|
||||
|
||||
env['_android-%s_LDFLAGS' % target] = []
|
||||
|
||||
CONFIGURE_FLAGS = [
|
||||
'--disable-boehm',
|
||||
'--disable-mcs-build',
|
||||
'--disable-nls',
|
||||
'--enable-static-gcc-libs',
|
||||
'--enable-maintainer-mode',
|
||||
'--with-tls=pthread'
|
||||
]
|
||||
|
||||
CONFIGURE_FLAGS += ['--with-static-zlib=%s/%s-w64-mingw32/lib/libz.a' % (mingw_zlib_prefix, host_arch)]
|
||||
|
||||
env['_android-%s_CONFIGURE_FLAGS' % target] = CONFIGURE_FLAGS
|
||||
|
||||
# Runtime cross template
|
||||
runtime.setup_runtime_cross_template(env, opts, 'android', target, host_triple, target_triple, device_target, 'llvmwin64', offsets_dumper_abi)
|
||||
|
||||
|
||||
def make_standalone_toolchain(opts: AndroidOpts, target: str, api: str):
|
||||
install_dir = path_join(opts.android_toolchains_prefix, opts.toolchain_name_fmt % (target, api))
|
||||
if os.path.isdir(path_join(install_dir, 'bin')):
|
||||
return # Looks like it's already there, so no need to re-create it
|
||||
command = path_join(opts.android_ndk_root, 'build', 'tools', 'make_standalone_toolchain.py')
|
||||
args = [command, '--verbose', '--force', '--api=' + api, '--arch=' + AndroidTargetTable.archs[target],
|
||||
'--install-dir=' + install_dir]
|
||||
run_command('python3', args=args, name='make_standalone_toolchain')
|
||||
|
||||
|
||||
def strip_libs(opts: AndroidOpts, product: str, target: str, api: str):
|
||||
toolchain_path = path_join(opts.android_toolchains_prefix, opts.toolchain_name_fmt % (target, api))
|
||||
|
||||
tools_path = path_join(toolchain_path, 'bin')
|
||||
name_fmt = AndroidTargetTable.abi_names[target] + '-%s'
|
||||
|
||||
strip = path_join(tools_path, name_fmt % 'strip')
|
||||
|
||||
install_dir = path_join(opts.install_dir, '%s-%s-%s' % (product, target, opts.configuration))
|
||||
out_libs_dir = path_join(install_dir, 'lib')
|
||||
install_dir = os.path.join(opts.install_dir, '%s-%s-%s' % (product, target, opts.configuration))
|
||||
out_libs_dir = os.path.join(install_dir, 'lib')
|
||||
|
||||
lib_files = globs(('*.a', '*.so'), dirpath=out_libs_dir)
|
||||
if len(lib_files):
|
||||
@@ -428,20 +236,9 @@ def strip_libs(opts: AndroidOpts, product: str, target: str, api: str):
|
||||
def configure(opts: AndroidOpts, product: str, target: str):
|
||||
env = { 'ANDROID_API_VERSION': get_api_version_or_min(opts, target) }
|
||||
|
||||
if is_cross(target):
|
||||
import llvm
|
||||
setup_android_target_template(env, opts, target)
|
||||
|
||||
if is_cross_mxe(target):
|
||||
llvm.make(opts, 'llvmwin64')
|
||||
setup_android_cross_mxe_template(env, opts, target, host_arch='x86_64')
|
||||
else:
|
||||
llvm.make(opts, 'llvm64')
|
||||
setup_android_cross_template(env, opts, target, host_arch='x86_64')
|
||||
else:
|
||||
make_standalone_toolchain(opts, target, env['ANDROID_API_VERSION'])
|
||||
setup_android_target_template(env, opts, target)
|
||||
|
||||
if not os.path.isfile(path_join(opts.mono_source_root, 'configure')):
|
||||
if not os.path.isfile(os.path.join(opts.mono_source_root, 'configure')):
|
||||
runtime.run_autogen(opts)
|
||||
|
||||
runtime.run_configure(env, opts, product, target)
|
||||
@@ -450,7 +247,7 @@ def configure(opts: AndroidOpts, product: str, target: str):
|
||||
def make(opts: AndroidOpts, product: str, target: str):
|
||||
env = { 'ANDROID_API_VERSION': get_api_version_or_min(opts, target) }
|
||||
|
||||
build_dir = path_join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration))
|
||||
build_dir = os.path.join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration))
|
||||
|
||||
make_args = make_default_args(opts)
|
||||
make_args += ['-C', build_dir]
|
||||
@@ -460,15 +257,15 @@ def make(opts: AndroidOpts, product: str, target: str):
|
||||
run_command('make', args=['-C', '%s/support' % build_dir, 'install'], name='make install support')
|
||||
run_command('make', args=['-C', '%s/data' % build_dir, 'install'], name='make install data')
|
||||
|
||||
if opts.strip_libs and not is_cross(target):
|
||||
strip_libs(opts, product, target, env['ANDROID_API_VERSION'])
|
||||
if opts.strip_libs:
|
||||
strip_libs(opts, product, target)
|
||||
|
||||
|
||||
def clean(opts: AndroidOpts, product: str, target: str):
|
||||
rm_rf(
|
||||
path_join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration)),
|
||||
path_join(opts.configure_dir, '%s-%s-%s.config.cache' % (product, target, opts.configuration)),
|
||||
path_join(opts.install_dir, '%s-%s-%s' % (product, target, opts.configuration))
|
||||
os.path.join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration)),
|
||||
os.path.join(opts.configure_dir, '%s-%s-%s.config.cache' % (product, target, opts.configuration)),
|
||||
os.path.join(opts.install_dir, '%s-%s-%s' % (product, target, opts.configuration))
|
||||
)
|
||||
|
||||
|
||||
@@ -478,13 +275,7 @@ def main(raw_args):
|
||||
from collections import OrderedDict
|
||||
from typing import Callable
|
||||
|
||||
target_shortcuts = {
|
||||
'all-runtime': runtime_targets,
|
||||
'all-cross': cross_targets,
|
||||
'all-cross-win': cross_mxe_targets
|
||||
}
|
||||
|
||||
target_values = runtime_targets + cross_targets + cross_mxe_targets + list(target_shortcuts)
|
||||
target_choices = targets + ['all-targets']
|
||||
|
||||
actions = OrderedDict()
|
||||
actions['configure'] = configure
|
||||
@@ -493,28 +284,20 @@ def main(raw_args):
|
||||
|
||||
parser = cmd_utils.build_arg_parser(
|
||||
description='Builds the Mono runtime for Android',
|
||||
env_vars={
|
||||
'ANDROID_SDK_ROOT': 'Overrides default value for --android-sdk',
|
||||
'ANDROID_NDK_ROOT': 'Overrides default value for --android-ndk',
|
||||
'ANDROID_HOME': 'Same as ANDROID_SDK_ROOT'
|
||||
}
|
||||
env_vars={ 'ANDROID_SDK_ROOT': 'Overrides default value for --android-sdk' }
|
||||
)
|
||||
|
||||
home = os.environ.get('HOME')
|
||||
android_sdk_default = os.environ.get('ANDROID_HOME', os.environ.get('ANDROID_SDK_ROOT', path_join(home, 'Android/Sdk')))
|
||||
android_ndk_default = os.environ.get('ANDROID_NDK_ROOT', path_join(android_sdk_default, 'ndk-bundle'))
|
||||
android_sdk_default = os.environ.get('ANDROID_SDK_ROOT', os.path.join(home, 'Android/Sdk'))
|
||||
|
||||
default_help = 'default: %(default)s'
|
||||
|
||||
parser.add_argument('action', choices=['configure', 'make', 'clean'])
|
||||
parser.add_argument('--target', choices=target_values, action='append', required=True)
|
||||
parser.add_argument('--toolchains-prefix', default=path_join(home, 'android-toolchains'), help=default_help)
|
||||
parser.add_argument('--target', choices=target_choices, action='append', required=True)
|
||||
parser.add_argument('--android-sdk', default=android_sdk_default, help=default_help)
|
||||
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-cmake-version', default='autodetect', help=default_help)
|
||||
parser.add_argument('--android-ndk-version', default=DEFAULT_NDK_VERSION, help=default_help)
|
||||
parser.add_argument('--android-api-version', default=get_min_api_version(targets[0]), help=default_help)
|
||||
parser.add_argument('--android-cmake-version', default=DEFAULT_CMAKE_VERSION, help=default_help)
|
||||
|
||||
cmd_utils.add_runtime_arguments(parser, default_help)
|
||||
|
||||
@@ -529,11 +312,14 @@ def main(raw_args):
|
||||
print('Mono sources directory not found: ' + opts.mono_source_root)
|
||||
sys.exit(1)
|
||||
|
||||
targets = cmd_utils.expand_input_targets(input_targets, target_shortcuts)
|
||||
check_for_android_ndk(opts)
|
||||
check_for_cmake(opts)
|
||||
|
||||
build_targets = cmd_utils.expand_input_targets(input_targets, { 'all-targets': targets })
|
||||
action = actions[input_action]
|
||||
|
||||
try:
|
||||
for target in targets:
|
||||
for target in build_targets:
|
||||
action(opts, 'android', target)
|
||||
except BuildError as e:
|
||||
sys.exit(e.message)
|
||||
|
||||
10
bcl.py
10
bcl.py
@@ -132,10 +132,10 @@ def make_product(opts: BclOpts, product: str):
|
||||
run_command('make', args=test_make_args, name='make tests')
|
||||
|
||||
# Copy the bcl profiles to the output directory
|
||||
from distutils.dir_util import copy_tree
|
||||
from shutil import copytree
|
||||
for profile in profiles:
|
||||
profile_dir = get_profile_dir(profile, product)
|
||||
copy_tree('%s/mcs/class/lib/%s' % (opts.mono_source_root, profile_dir), '%s/%s' % (install_dir, profile_dir))
|
||||
copytree('%s/mcs/class/lib/%s' % (opts.mono_source_root, profile_dir), '%s/%s' % (install_dir, profile_dir))
|
||||
|
||||
# Remove unneeded files
|
||||
import glob
|
||||
@@ -195,16 +195,16 @@ def make_product(opts: BclOpts, product: str):
|
||||
|
||||
mkdir_p(monotouch_profile_dir)
|
||||
|
||||
android_env_csc_args = [
|
||||
ios_env_csc_args = [
|
||||
path_join(this_script_dir, 'files', 'xi.cs'),
|
||||
'-keyfile:' + path_join(this_script_dir, 'files', 'xi.snk'),
|
||||
'-out:%s' % path_join(monotouch_profile_dir, 'Xamarin.iOS.dll'),
|
||||
'-optimize', '-deterministic', '-publicsign', '-target:library',
|
||||
'-nostdlib', '-noconfig', '-langversion:latest'
|
||||
]
|
||||
android_env_csc_args += ['-r:%s' % path_join(monotouch_profile_dir, r) for r in refs]
|
||||
ios_env_csc_args += ['-r:%s' % path_join(monotouch_profile_dir, r) for r in refs]
|
||||
|
||||
run_command('csc', android_env_csc_args)
|
||||
run_command('csc', ios_env_csc_args)
|
||||
|
||||
|
||||
def clean_product(opts: BclOpts, product: str):
|
||||
|
||||
@@ -231,13 +231,13 @@ def make(opts: DesktopOpts, product: str, target_platform: str, target: str):
|
||||
strip_libs(opts, product, target_platform, target)
|
||||
|
||||
def copy_bcl(opts: DesktopOpts, product: str, target_platform: str, target: str):
|
||||
from distutils.dir_util import copy_tree
|
||||
from shutil import copytree
|
||||
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'):
|
||||
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)
|
||||
copytree(src_dir, dest_dir)
|
||||
|
||||
def clean(opts: DesktopOpts, product: str, target_platform: str, target: str):
|
||||
rm_rf(
|
||||
|
||||
@@ -3,11 +3,11 @@ index e57a636ef4d..60c60a8fc17 100644
|
||||
--- a/mcs/build/rules.make
|
||||
+++ b/mcs/build/rules.make
|
||||
@@ -94,7 +94,7 @@ include $(topdir)/build/config-default.make
|
||||
|
||||
|
||||
include $(topdir)/build/platforms/$(BUILD_PLATFORM).make
|
||||
|
||||
|
||||
-PROFILE_PLATFORM = $(if $(PLATFORMS),$(if $(filter $(PLATFORMS),$(HOST_PLATFORM)),$(HOST_PLATFORM),$(error Unknown platform "$(HOST_PLATFORM)" for profile "$(PROFILE)")))
|
||||
+PROFILE_PLATFORM ?= $(if $(PLATFORMS),$(if $(filter $(PLATFORMS),$(HOST_PLATFORM)),$(HOST_PLATFORM),$(error Unknown platform "$(HOST_PLATFORM)" for profile "$(PROFILE)")))
|
||||
PROFILE_DIRECTORY = $(PROFILE)$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))
|
||||
|
||||
|
||||
# Useful
|
||||
|
||||
20
files/patches/btls-cmake-android-16kb-page-size.diff
Normal file
20
files/patches/btls-cmake-android-16kb-page-size.diff
Normal file
@@ -0,0 +1,20 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 2c052530..6bf193fd 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -5976,13 +5976,13 @@ if test "x$enable_btls" = "xyes"; then
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
;;
|
||||
android-v8a)
|
||||
- BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
+ BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api -DCMAKE_SHARED_LINKER_FLAGS=\"-Wl,-z,max-page-size=16384\""
|
||||
;;
|
||||
android-x86)
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
;;
|
||||
android-x64)
|
||||
- BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
+ BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api -DCMAKE_SHARED_LINKER_FLAGS=\"-Wl,-z,max-page-size=16384\""
|
||||
;;
|
||||
riscv32)
|
||||
btls_arch=riscv32
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 088128e5e74..54693aace64 100644
|
||||
index 19b20127ca2..d07afde5e05 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -5918,6 +5918,8 @@ if test "x$enable_btls" = "xyes"; then
|
||||
@@ -5924,6 +5924,8 @@ if test "x$enable_btls" = "xyes"; then
|
||||
if test "x$HAVE_YASM" != "xyes"; then
|
||||
BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1"
|
||||
fi
|
||||
@@ -11,7 +11,7 @@ index 088128e5e74..54693aace64 100644
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -5929,6 +5931,8 @@ if test "x$enable_btls" = "xyes"; then
|
||||
@@ -5935,6 +5937,8 @@ if test "x$enable_btls" = "xyes"; then
|
||||
if test "x$HAVE_YASM" != "xyes"; then
|
||||
BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1"
|
||||
fi
|
||||
|
||||
59
files/patches/btls-cmake-arm64.diff
Normal file
59
files/patches/btls-cmake-arm64.diff
Normal file
@@ -0,0 +1,59 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d07afde5e05..2c052530f2c 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -4927,9 +4927,6 @@ if test "x$target_mach" = "xyes"; then
|
||||
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_OSX"
|
||||
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_OSX"
|
||||
target_osx=yes
|
||||
- if test "x$TARGET" = "xARM64"; then
|
||||
- BTLS_SUPPORTED=no
|
||||
- fi
|
||||
], [
|
||||
AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
|
||||
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
|
||||
@@ -5952,7 +5949,11 @@ if test "x$enable_btls" = "xyes"; then
|
||||
;;
|
||||
aarch64)
|
||||
btls_arch=aarch64
|
||||
- btls_cflags="-march=armv8-a+crypto"
|
||||
+ if test "x$target_mach" = "xyes"; then
|
||||
+ btls_cflags="-arch arm64"
|
||||
+ else
|
||||
+ btls_cflags="-march=armv8-a+crypto"
|
||||
+ fi
|
||||
;;
|
||||
s390x)
|
||||
btls_arch=s390x
|
||||
diff --git a/mono/btls/CMakeLists.txt b/mono/btls/CMakeLists.txt
|
||||
index 9946f5d21a4..a8aa3d07b0e 100644
|
||||
--- a/mono/btls/CMakeLists.txt
|
||||
+++ b/mono/btls/CMakeLists.txt
|
||||
@@ -21,6 +21,15 @@ if (MSVC OR CYGWIN)
|
||||
set(BTLS_HOST_WIN32 1)
|
||||
endif ()
|
||||
|
||||
+if (NOT "${BTLS_ARCH}" STREQUAL "")
|
||||
+ message (STATUS "SET ARCH: ${BTLS_ARCH}")
|
||||
+ set (CMAKE_SYSTEM_PROCESSOR "${BTLS_ARCH}")
|
||||
+endif ()
|
||||
+
|
||||
+if ((("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") OR ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")) AND APPLE AND NOT IOS)
|
||||
+ set(OPENSSL_NO_ASM 1)
|
||||
+endif ()
|
||||
+
|
||||
if (NOT OPENSSL_NO_ASM)
|
||||
if (BTLS_HOST_WIN32)
|
||||
if (CYGWIN AND "${BTLS_ARCH}" STREQUAL "i386")
|
||||
@@ -38,11 +47,6 @@ if (NOT OPENSSL_NO_ASM)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
-if (NOT "${BTLS_ARCH}" STREQUAL "")
|
||||
- message (STATUS "SET ARCH: ${BTLS_ARCH}")
|
||||
- set (CMAKE_SYSTEM_PROCESSOR "${BTLS_ARCH}")
|
||||
-endif ()
|
||||
-
|
||||
if (NOT MSVC)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX" OR ${CMAKE_SYSTEM_NAME} MATCHES "OS400")
|
||||
# GCC+XCOFF doesn't support -fvisibility=hidden, and we would prefer XCOFF debugging info.
|
||||
25
files/patches/emscripten-python-3.12.diff
Normal file
25
files/patches/emscripten-python-3.12.diff
Normal file
@@ -0,0 +1,25 @@
|
||||
diff -aur a/tools/shared.py b/tools/shared.py
|
||||
--- a/tools/shared.py 2025-10-14 09:16:13.210070677 +0000
|
||||
+++ b/tools/shared.py 2025-10-14 09:15:07.106178680 +0000
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
-from distutils.spawn import find_executable
|
||||
+from shutil import which
|
||||
from subprocess import PIPE, STDOUT
|
||||
import atexit
|
||||
import base64
|
||||
@@ -212,10 +212,10 @@
|
||||
config_file = '\n'.join(config_file)
|
||||
# autodetect some default paths
|
||||
config_file = config_file.replace('\'{{{ EMSCRIPTEN_ROOT }}}\'', repr(__rootpath__))
|
||||
- llvm_root = os.path.dirname(find_executable('llvm-dis') or '/usr/bin/llvm-dis')
|
||||
+ llvm_root = os.path.dirname(which('llvm-dis') or '/usr/bin/llvm-dis')
|
||||
config_file = config_file.replace('\'{{{ LLVM_ROOT }}}\'', repr(llvm_root))
|
||||
|
||||
- node = find_executable('nodejs') or find_executable('node') or 'node'
|
||||
+ node = which('nodejs') or which('node') or 'node'
|
||||
config_file = config_file.replace('\'{{{ NODE }}}\'', repr(node))
|
||||
|
||||
abspath = os.path.abspath(os.path.expanduser(path))
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c
|
||||
index ad9b8823f8f..3542b32b540 100644
|
||||
index 8d6753f2e01..1c1bd460123 100644
|
||||
--- a/mono/metadata/threads.c
|
||||
+++ b/mono/metadata/threads.c
|
||||
@@ -77,8 +77,12 @@ mono_native_thread_join_handle (HANDLE thread_handle, gboolean close_handle);
|
||||
@@ -78,8 +78,12 @@ mono_native_thread_join_handle (HANDLE thread_handle, gboolean close_handle);
|
||||
#include <zircon/syscalls.h>
|
||||
#endif
|
||||
|
||||
@@ -18,10 +18,10 @@ index ad9b8823f8f..3542b32b540 100644
|
||||
|
||||
#ifdef HOST_ANDROID
|
||||
diff --git a/mono/utils/mono-threads-posix.c b/mono/utils/mono-threads-posix.c
|
||||
index 3e4bf93de5f..79c9f731fe7 100644
|
||||
index cd32e6b042d..5e2fd4618b8 100644
|
||||
--- a/mono/utils/mono-threads-posix.c
|
||||
+++ b/mono/utils/mono-threads-posix.c
|
||||
@@ -31,8 +31,12 @@
|
||||
@@ -32,8 +32,12 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
diff --git a/mono/metadata/threadpool-io.c b/mono/metadata/threadpool-io.c
|
||||
index fdfef2de91e28..45ac0d84b2429 100644
|
||||
index a8a947e7dea..b87b59ed5b6 100644
|
||||
--- a/mono/metadata/threadpool-io.c
|
||||
+++ b/mono/metadata/threadpool-io.c
|
||||
@@ -180,6 +180,7 @@ selector_thread_wakeup_drain_pipes (void)
|
||||
@@ -179,6 +179,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)
|
||||
@@ -191,11 +192,16 @@ selector_thread_wakeup_drain_pipes (void)
|
||||
* some unices (like AIX) send ERESTART, which doesn't
|
||||
* exist on some other OSes errno
|
||||
*/
|
||||
@@ -30,7 +30,7 @@ index fdfef2de91e28..45ac0d84b2429 100644
|
||||
break;
|
||||
}
|
||||
#else
|
||||
@@ -204,8 +210,13 @@ selector_thread_wakeup_drain_pipes (void)
|
||||
@@ -203,8 +209,13 @@ selector_thread_wakeup_drain_pipes (void)
|
||||
if (received == 0)
|
||||
break;
|
||||
if (received == SOCKET_ERROR) {
|
||||
|
||||
21
files/patches/llvm-osx-regex-conflict.diff
Normal file
21
files/patches/llvm-osx-regex-conflict.diff
Normal file
@@ -0,0 +1,21 @@
|
||||
diff --git a/external/llvm-project/llvm/lib/Support/regex_impl.h b/external/llvm-project/llvm/lib/Support/regex_impl.h
|
||||
index f8296c9ff75e..45bdb469a0b3 100644
|
||||
--- a/external/llvm-project/llvm/lib/Support/regex_impl.h
|
||||
+++ b/external/llvm-project/llvm/lib/Support/regex_impl.h
|
||||
@@ -35,8 +35,8 @@
|
||||
* @(#)regex.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
-#ifndef _REGEX_H_
|
||||
-#define _REGEX_H_
|
||||
+#ifndef _REGEX_IMPL_H_
|
||||
+#define _REGEX_IMPL_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
typedef off_t llvm_regoff_t;
|
||||
@@ -105,4 +105,4 @@ size_t llvm_strlcpy(char *dst, const char *src, size_t siz);
|
||||
}
|
||||
#endif
|
||||
|
||||
-#endif /* !_REGEX_H_ */
|
||||
+#endif /* !_REGEX_IMPL_H_ */
|
||||
@@ -1,10 +1,10 @@
|
||||
diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c
|
||||
index df6329391df..05f30d5b4dc 100644
|
||||
index 32bfc471ea2..5087405eed5 100644
|
||||
--- a/mono/mini/debugger-agent.c
|
||||
+++ b/mono/mini/debugger-agent.c
|
||||
@@ -4088,8 +4088,12 @@ thread_startup (MonoProfiler *prof, uintptr_t tid)
|
||||
@@ -4172,8 +4172,12 @@ thread_startup (MonoProfiler *prof, uintptr_t tid)
|
||||
}
|
||||
|
||||
|
||||
tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id);
|
||||
- g_assert (!tls);
|
||||
- // FIXME: Free this somewhere
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/mono/utils/mono-log-darwin.c b/mono/utils/mono-log-darwin.c
|
||||
index 3cb127bad59..30ff5edc307 100644
|
||||
index 2cb41b1481e..4f566ddb90a 100644
|
||||
--- a/mono/utils/mono-log-darwin.c
|
||||
+++ b/mono/utils/mono-log-darwin.c
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
32
files/patches/offsets-tool-duplicate-fields.diff
Normal file
32
files/patches/offsets-tool-duplicate-fields.diff
Normal file
@@ -0,0 +1,32 @@
|
||||
Extracted from https://github.com/dotnet/runtime/commit/087651ee0c2e315f7fe1cbecab5f507af364ab5c
|
||||
--
|
||||
diff --git a/mono/tools/offsets-tool/offsets-tool.py b/mono/tools/offsets-tool/offsets-tool.py
|
||||
index adf7eb4b..46214429 100644
|
||||
--- a/mono/tools/offsets-tool/offsets-tool.py
|
||||
+++ b/mono/tools/offsets-tool/offsets-tool.py
|
||||
@@ -303,8 +303,11 @@ class OffsetsTool:
|
||||
if type.size == -1:
|
||||
continue
|
||||
f.write ("DECL_SIZE2(%s,%s)\n" % (type.name, type.size))
|
||||
+ done_fields = {}
|
||||
for field in type.fields:
|
||||
- f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset))
|
||||
+ if field.name not in done_fields:
|
||||
+ f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset))
|
||||
+ done_fields [field.name] = field.name
|
||||
f.write ("#endif //disable metadata check\n")
|
||||
|
||||
f.write ("#ifndef DISABLE_JIT_OFFSETS\n")
|
||||
@@ -314,8 +317,11 @@ class OffsetsTool:
|
||||
if type.size == -1:
|
||||
continue
|
||||
f.write ("DECL_SIZE2(%s,%s)\n" % (type.name, type.size))
|
||||
+ done_fields = {}
|
||||
for field in type.fields:
|
||||
- f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset))
|
||||
+ if field.name not in done_fields:
|
||||
+ f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset))
|
||||
+ done_fields [field.name] = field.name
|
||||
f.write ("#endif //disable jit check\n")
|
||||
|
||||
f.write ("#endif //cross compiler checks\n")
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/mono/tools/offsets-tool/offsets-tool.py b/mono/tools/offsets-tool/offsets-tool.py
|
||||
index 35445ba585c..d1586ee5ecd 100644
|
||||
index f06799cba12..adf7eb4bbd6 100644
|
||||
--- a/mono/tools/offsets-tool/offsets-tool.py
|
||||
+++ b/mono/tools/offsets-tool/offsets-tool.py
|
||||
@@ -54,6 +54,7 @@ class OffsetsTool:
|
||||
@@ -1,22 +0,0 @@
|
||||
diff --git a/tools/offsets-tool-py/offsets-tool.py b/tools/offsets-tool-py/offsets-tool.py
|
||||
index 536206aa5c9..04e515f13f2 100644
|
||||
--- a/tools/offsets-tool-py/offsets-tool.py
|
||||
+++ b/tools/offsets-tool-py/offsets-tool.py
|
||||
@@ -61,6 +61,7 @@ class OffsetsTool:
|
||||
parser.add_argument ('--targetdir', dest='target_path', help='path to mono tree configured for target', required=True)
|
||||
parser.add_argument ('--abi=', dest='abi', help='ABI triple to generate', required=True)
|
||||
parser.add_argument ('--sysroot=', dest='sysroot', help='path to sysroot headers of target')
|
||||
+ parser.add_argument ('--extra-cflag=', dest='extra_cflags', action='append', help='extra flags for clang')
|
||||
args = parser.parse_args ()
|
||||
|
||||
if not args.libclang or not os.path.isfile (args.libclang):
|
||||
@@ -78,6 +79,9 @@ class OffsetsTool:
|
||||
self.target_args = []
|
||||
android_api_level = "-D__ANDROID_API=21"
|
||||
|
||||
+ if args.extra_cflags:
|
||||
+ self.target_args += args.extra_cflags
|
||||
+
|
||||
if "wasm" in args.abi:
|
||||
require_emscipten_path (args)
|
||||
self.sys_includes = [args.emscripten_path + "/system/include/libc"]
|
||||
215
files/patches/offsets-tool-newer-clang.diff
Normal file
215
files/patches/offsets-tool-newer-clang.diff
Normal file
@@ -0,0 +1,215 @@
|
||||
From 63e677701d35c7e2dad4fe74a84eb935cd396155 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= <alex.koeplinger@outlook.com>
|
||||
Date: Mon, 15 May 2023 20:46:12 +0200
|
||||
Subject: [PATCH] [mono] Update offsets-tool python clang binding so it works
|
||||
with newer clang (#86256)
|
||||
|
||||
They introduced a breaking change to CursorKind.TRANSLATION_UNIT in https://github.com/llvm/llvm-project/commit/bb83f8e70bd1d56152f02307adacd718cd67e312, which means we hit an issue when using the binding against a newer clang. Update the binding to the latest upstream and add a tweak so it still works with older clang versions.
|
||||
---
|
||||
mono/tools/offsets-tool/clang/cindex.py | 137 +++++++++++++++++-
|
||||
1 file changed, 135 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/mono/tools/offsets-tool/clang/cindex.py b/mono/tools/offsets-tool/clang/cindex.py
|
||||
index 44c6f49096f495..0ed1c199ba44dd 100644
|
||||
--- a/mono/tools/offsets-tool/clang/cindex.py
|
||||
+++ b/mono/tools/offsets-tool/clang/cindex.py
|
||||
@@ -286,6 +286,11 @@ def offset(self):
|
||||
"""Get the file offset represented by this source location."""
|
||||
return self._get_instantiation()[3]
|
||||
|
||||
+ #@property
|
||||
+ #def is_in_system_header(self):
|
||||
+ # """Returns true if the given source location is in a system header."""
|
||||
+ # return conf.lib.clang_Location_isInSystemHeader(self)
|
||||
+
|
||||
def __eq__(self, other):
|
||||
return conf.lib.clang_equalLocations(self, other)
|
||||
|
||||
@@ -646,6 +651,11 @@ def name(self):
|
||||
|
||||
@classmethod
|
||||
def from_id(cls, id):
|
||||
+ if cls == CursorKind and id == 300:
|
||||
+ # --- DOTNET change ---
|
||||
+ # The id of CursorKind.TRANSLATION_UNIT changed in https://github.com/llvm/llvm-project/commit/bb83f8e70bd1d56152f02307adacd718cd67e312,
|
||||
+ # add mapping from the old to the new value so using the binding with an older clang still works.
|
||||
+ return cls._kinds[350]
|
||||
if id >= len(cls._kinds) or cls._kinds[id] is None:
|
||||
raise ValueError('Unknown template argument kind %d' % id)
|
||||
return cls._kinds[id]
|
||||
@@ -1152,7 +1162,7 @@ def __repr__(self):
|
||||
# Objective-C's @synchronized statement.
|
||||
CursorKind.OBJC_AT_SYNCHRONIZED_STMT = CursorKind(220)
|
||||
|
||||
-# Objective-C's autorealease pool statement.
|
||||
+# Objective-C's autorelease pool statement.
|
||||
CursorKind.OBJC_AUTORELEASE_POOL_STMT = CursorKind(221)
|
||||
|
||||
# Objective-C's for collection statement.
|
||||
@@ -1312,7 +1322,7 @@ def __repr__(self):
|
||||
#
|
||||
# The translation unit cursor exists primarily to act as the root cursor for
|
||||
# traversing the contents of a translation unit.
|
||||
-CursorKind.TRANSLATION_UNIT = CursorKind(300)
|
||||
+CursorKind.TRANSLATION_UNIT = CursorKind(350)
|
||||
|
||||
###
|
||||
# Attributes
|
||||
@@ -1473,6 +1483,107 @@ def is_default_method(self):
|
||||
"""
|
||||
return conf.lib.clang_CXXMethod_isDefaulted(self)
|
||||
|
||||
+ #def is_deleted_method(self):
|
||||
+ # """Returns True if the cursor refers to a C++ member function or member
|
||||
+ # function template that is declared '= delete'.
|
||||
+ # """
|
||||
+ # return conf.lib.clang_CXXMethod_isDeleted(self)
|
||||
+
|
||||
+ #def is_copy_assignment_operator_method(self):
|
||||
+ # """Returnrs True if the cursor refers to a copy-assignment operator.
|
||||
+
|
||||
+ # A copy-assignment operator `X::operator=` is a non-static,
|
||||
+ # non-template member function of _class_ `X` with exactly one
|
||||
+ # parameter of type `X`, `X&`, `const X&`, `volatile X&` or `const
|
||||
+ # volatile X&`.
|
||||
+
|
||||
+
|
||||
+ # That is, for example, the `operator=` in:
|
||||
+
|
||||
+ # class Foo {
|
||||
+ # bool operator=(const volatile Foo&);
|
||||
+ # };
|
||||
+
|
||||
+ # Is a copy-assignment operator, while the `operator=` in:
|
||||
+
|
||||
+ # class Bar {
|
||||
+ # bool operator=(const int&);
|
||||
+ # };
|
||||
+
|
||||
+ # Is not.
|
||||
+ # """
|
||||
+ # return conf.lib.clang_CXXMethod_isCopyAssignmentOperator(self)
|
||||
+
|
||||
+ #def is_move_assignment_operator_method(self):
|
||||
+ # """Returnrs True if the cursor refers to a move-assignment operator.
|
||||
+
|
||||
+ # A move-assignment operator `X::operator=` is a non-static,
|
||||
+ # non-template member function of _class_ `X` with exactly one
|
||||
+ # parameter of type `X&&`, `const X&&`, `volatile X&&` or `const
|
||||
+ # volatile X&&`.
|
||||
+
|
||||
+
|
||||
+ # That is, for example, the `operator=` in:
|
||||
+
|
||||
+ # class Foo {
|
||||
+ # bool operator=(const volatile Foo&&);
|
||||
+ # };
|
||||
+
|
||||
+ # Is a move-assignment operator, while the `operator=` in:
|
||||
+
|
||||
+ # class Bar {
|
||||
+ # bool operator=(const int&&);
|
||||
+ # };
|
||||
+
|
||||
+ # Is not.
|
||||
+ # """
|
||||
+ # return conf.lib.clang_CXXMethod_isMoveAssignmentOperator(self)
|
||||
+
|
||||
+ #def is_explicit_method(self):
|
||||
+ # """Determines if a C++ constructor or conversion function is
|
||||
+ # explicit, returning 1 if such is the case and 0 otherwise.
|
||||
+
|
||||
+ # Constructors or conversion functions are declared explicit through
|
||||
+ # the use of the explicit specifier.
|
||||
+
|
||||
+ # For example, the following constructor and conversion function are
|
||||
+ # not explicit as they lack the explicit specifier:
|
||||
+
|
||||
+ # class Foo {
|
||||
+ # Foo();
|
||||
+ # operator int();
|
||||
+ # };
|
||||
+
|
||||
+ # While the following constructor and conversion function are
|
||||
+ # explicit as they are declared with the explicit specifier.
|
||||
+
|
||||
+ # class Foo {
|
||||
+ # explicit Foo();
|
||||
+ # explicit operator int();
|
||||
+ # };
|
||||
+
|
||||
+ # This method will return 0 when given a cursor pointing to one of
|
||||
+ # the former declarations and it will return 1 for a cursor pointing
|
||||
+ # to the latter declarations.
|
||||
+
|
||||
+ # The explicit specifier allows the user to specify a
|
||||
+ # conditional compile-time expression whose value decides
|
||||
+ # whether the marked element is explicit or not.
|
||||
+
|
||||
+ # For example:
|
||||
+
|
||||
+ # constexpr bool foo(int i) { return i % 2 == 0; }
|
||||
+
|
||||
+ # class Foo {
|
||||
+ # explicit(foo(1)) Foo();
|
||||
+ # explicit(foo(2)) operator int();
|
||||
+ # }
|
||||
+
|
||||
+ # This method will return 0 for the constructor and 1 for
|
||||
+ # the conversion function.
|
||||
+ # """
|
||||
+ # return conf.lib.clang_CXXMethod_isExplicit(self)
|
||||
+
|
||||
def is_mutable_field(self):
|
||||
"""Returns True if the cursor refers to a C++ field that is declared
|
||||
'mutable'.
|
||||
@@ -2059,6 +2170,7 @@ def __repr__(self):
|
||||
TypeKind.OBJCSEL = TypeKind(29)
|
||||
TypeKind.FLOAT128 = TypeKind(30)
|
||||
TypeKind.HALF = TypeKind(31)
|
||||
+TypeKind.IBM128 = TypeKind(40)
|
||||
TypeKind.COMPLEX = TypeKind(100)
|
||||
TypeKind.POINTER = TypeKind(101)
|
||||
TypeKind.BLOCKPOINTER = TypeKind(102)
|
||||
@@ -2122,6 +2234,7 @@ def __repr__(self):
|
||||
TypeKind.OCLRESERVEID = TypeKind(160)
|
||||
|
||||
TypeKind.EXTVECTOR = TypeKind(176)
|
||||
+TypeKind.ATOMIC = TypeKind(177)
|
||||
|
||||
class RefQualifierKind(BaseEnumeration):
|
||||
"""Describes a specific ref-qualifier of a type."""
|
||||
@@ -3424,6 +3537,22 @@ def cursor(self):
|
||||
[Cursor],
|
||||
bool),
|
||||
|
||||
+ #("clang_CXXMethod_isDeleted",
|
||||
+ # [Cursor],
|
||||
+ # bool),
|
||||
+
|
||||
+ #("clang_CXXMethod_isCopyAssignmentOperator",
|
||||
+ # [Cursor],
|
||||
+ # bool),
|
||||
+
|
||||
+ #("clang_CXXMethod_isMoveAssignmentOperator",
|
||||
+ # [Cursor],
|
||||
+ # bool),
|
||||
+
|
||||
+ #("clang_CXXMethod_isExplicit",
|
||||
+ # [Cursor],
|
||||
+ # bool),
|
||||
+
|
||||
("clang_CXXMethod_isPureVirtual",
|
||||
[Cursor],
|
||||
bool),
|
||||
@@ -4012,6 +4141,10 @@ def cursor(self):
|
||||
[Cursor],
|
||||
c_longlong),
|
||||
|
||||
+ #("clang_Location_isInSystemHeader",
|
||||
+ # [SourceLocation],
|
||||
+ # bool),
|
||||
+
|
||||
("clang_Type_getAlignOf",
|
||||
[Type],
|
||||
c_longlong),
|
||||
@@ -23,9 +23,8 @@ class RuntimeOpts(BaseOpts):
|
||||
|
||||
@dataclass
|
||||
class AndroidOpts(RuntimeOpts):
|
||||
android_toolchains_prefix: str
|
||||
android_sdk_root: str
|
||||
android_ndk_root: str
|
||||
android_ndk_version: str
|
||||
android_api_version: str
|
||||
android_cmake_version: str
|
||||
toolchain_name_fmt: str = '%s-api%s-clang'
|
||||
@@ -80,9 +79,8 @@ def runtime_opts_from_args(args):
|
||||
def android_opts_from_args(args):
|
||||
return AndroidOpts(
|
||||
**vars(runtime_opts_from_args(args)),
|
||||
android_toolchains_prefix = abspath(args.toolchains_prefix),
|
||||
android_sdk_root = abspath(args.android_sdk),
|
||||
android_ndk_root = abspath(args.android_ndk),
|
||||
android_ndk_version = args.android_ndk_version,
|
||||
android_api_version = args.android_api_version,
|
||||
android_cmake_version = args.android_cmake_version
|
||||
)
|
||||
|
||||
@@ -18,11 +18,15 @@ def main(raw_args):
|
||||
|
||||
args = parser.parse_args(raw_args)
|
||||
|
||||
this_script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
patches_dir = os.path.join(this_script_dir, 'files', 'patches')
|
||||
|
||||
mono_source_root = args.mono_sources
|
||||
emsdk_root = get_emsdk_root()
|
||||
|
||||
patches = [
|
||||
'%s/sdks/builds/fix-emscripten-8511.diff' % mono_source_root,
|
||||
'%s/emscripten-python-3.12.diff' % patches_dir,
|
||||
]
|
||||
|
||||
from subprocess import Popen
|
||||
|
||||
@@ -32,14 +32,15 @@ def main(raw_args):
|
||||
'bcl-profile-platform-override.diff',
|
||||
'mono_ios_asl_log_deprecated.diff',
|
||||
'wasm_m2n_trampolines_hook.diff',
|
||||
'btls-cmake-args-linux-mingw.diff'
|
||||
'btls-cmake-args-linux-mingw.diff',
|
||||
'btls-cmake-arm64.diff',
|
||||
'btls-cmake-android-16kb-page-size.diff',
|
||||
'offsets-tool-extra-cflags.diff',
|
||||
'offsets-tool-newer-clang.diff',
|
||||
'offsets-tool-duplicate-fields.diff',
|
||||
'llvm-osx-regex-conflict.diff',
|
||||
]
|
||||
|
||||
if os.path.isfile(os.path.join(mono_source_root, 'mono/tools/offsets-tool/offsets-tool.py')):
|
||||
patches += ['offsets-tool-extra-cflags_new.diff']
|
||||
else:
|
||||
patches += ['offsets-tool-extra-cflags_old.diff']
|
||||
|
||||
from subprocess import Popen
|
||||
from sys import exit
|
||||
for patch in patches:
|
||||
|
||||
Reference in New Issue
Block a user