Giter Club home page Giter Club logo

godot-mono-builds's Introduction

Mono build scripts for Godot

Build

This repository contains scripts for building the Mono runtime to use with Godot Engine.

Supported versions

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.198.
  • Emscripten: 1.39.9.
  • Android NDK: 23.2.8568313

Command-line options

Requires Python 3.7 or higher

These scripts are based on the Mono sdks makefiles, with some changes to work well with Godot. Some platforms or targets depend on files from the sdks directory in the Mono source repository. This directory may be missing from tarballs. If that's the case, cloning the git repository may be needed. This table can be used to determine the branch for a specific version of Mono.

Some patches need to be applied to the Mono sources before building. This can be done by running python3 ./patch_mono.py.

Run python3 SCRIPT.py --help for the full list of command line options.

By default, the scripts will install the resulting files to $HOME/mono-installs. A custom output directory can be specified with the --install-dir option.

When cross-compiling to Windows, --mxe-prefix must be specified. For example, with the mingw-w64 package installed on Ubuntu, one can pass --mxe-prefix=/usr.

A path to the Mono source tree must be provided with the --mono-sources option or with the MONO_SOURCE_ROOT environment variable:

export MONO_SOURCE_ROOT=$HOME/git/mono

Notes

  • Python 3.7 or higher is required.
  • OSXCROSS is supported except for building the Mono cross-compilers.
  • Building on Windows is not supported. It's possible to use Cygwin or WSL (Windows Subsystem for Linux) but this hasn't been tested.

Compiling Godot for Desktop with this Runtime

In order to compile mono into Godot for deskop you will need to first build for desktop (see 'Desktop' below), and then Base Class Libraries (see 'Base Class library' below).

Then run the 'copy-bcl' action of the same desktop script you ran configure and make on, specifying the same target platforms you used before. This will copy the bcl runtime into the runtime directories that the subsequent Godot build (using copy_mono_root=yes) expects to find them in. e.g. ./linux.py copy-bcl --target=x86 --target=x86_64

Then you'll need to compile Godot using copy_mono_root=yes e.g. scons -j6 target=release_debug tools=yes module_mono_enabled=yes copy_mono_root=yes mono_prefix="$HOME/mono-installs/desktop-linux-x86_64-release"

Desktop

# Build the runtimes for 32-bit and 64-bit Linux.
./linux.py configure --target=x86 --target=x86_64
./linux.py make --target=x86 --target=x86_64

# Build the runtimes for 32-bit and 64-bit Windows.
./windows.py configure --target=x86 --target=x86_64 --mxe-prefix=/usr
./windows.py make --target=x86 --target=x86_64 --mxe-prefix=/usr

# Build the runtime for 64-bit macOS.
./osx.py configure --target=x86_64
./osx.py make --target=x86_64

AOT cross-compilers for desktop platforms cannot be built with these scripts yet.

Android

Building for Android requires the Android SDK cmdline-tools to be installed in the Android SDK folder.

# 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

# Build the runtime for all supported Android ABIs.
./android.py configure --target=all-targets
./android.py make --target=all-targets

The option --target=all-targets is a shortcut for --target=armv7 --target=arm64v8 --target=x86 --target=x86_64.

iOS

# Build the runtime for the iPhone simulator.
./ios.py configure --target=x86_64
./ios.py make --target=x86_64

# Build the runtime for the iPhone device.
./ios.py configure --target=arm64
./ios.py make --target=arm64

# Build the AOT cross-compiler targeting the iPhone device.
./ios.py configure --target=cross-arm64
./ios.py make --target=cross-arm64

The runtime can also be built an OSXCROSS iOS toolchain. The --ios-toolchain and --ios-sdk options are the equivalent of the Godot SCons options IPHONEPATH and IPHONESDK respectively. The cross compiler cannot be built with OSXCROSS yet.

WebAssembly

Just like with Godot, an active Emscripten SDK is needed for building the Mono WebAssembly runtime.

Some patches may need to be applied to the Emscripten SDK before building Mono. This can be done by running ./patch_emscripten.py.

# Build the runtime for WebAssembly.
./wasm.py configure --target=runtime
./wasm.py make --target=runtime

AOT cross-compilers for WebAssembly cannot be built with this script yet.

Base Class library

# Build the Desktop BCL.
./bcl.py make --product=desktop

# Build the Desktop BCL for Windows.
./bcl.py make --product=desktop-win32

# Build the Android BCL.
./bcl.py make --product=android

# Build the iOS BCL.
./bcl.py make --product=ios

# Build the WebAssembly BCL.
./bcl.py make --product=wasm

NOTE: Building the Desktop BCL for the current system is required first to be able to build the Desktop BCL for Windows.

Reference Assemblies

./reference_assemblies.py install

godot-mono-builds's People

Contributors

aaronfranke avatar akien-mga avatar atlinx avatar bruvzg avatar calinou avatar dependabot[bot] avatar jlosito avatar madmiraal avatar neikeq avatar tdaffin avatar technoporg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

godot-mono-builds's Issues

patch_emscripten.py doesn't return error code when failing

I noticed that in my current builds of mono-6.6.0.166 with emscripten 1.38.47-upstream, the patch_emscripten.py command actually has some failed hunks, but the build script continues nevertheless.

[root@e381878f0b5a godot-mono-builds]# python3 patch_emscripten.py 
[root@e381878f0b5a godot-mono-builds]# patching file src/support.js
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/support.js.rej
patching file emcc.py
patching file tests/test_browser.py
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file tests/test_browser.py.rej
Hunk #1 succeeded at 930 with fuzz 2 (offset 40 lines).
Hunk #2 FAILED at 918.
Hunk #3 FAILED at 987.
Hunk #4 FAILED at 1841.
3 out of 4 hunks FAILED -- saving rejects to file emcc.py.rej
echo $?
0

It should return a non-0 value when failing.

There's also some problems with newlines/early return which might explain why it returns 0 even though some of the patch calls may fail. (See how the prompt returns right after the python3 patch_emscripten.py call.)

Missing template folders at the end of the build process

OS/device including version:

So I went through the entire process described in the readme and at the end of it I seem to be missing a whole bunch of files in the templates directory. Here are all the steps and the result:

Clone mono:

git clone https://github.com/mono/mono.git --recurse-submodules
git checkout tags/mono-6.12.0.111 -b mono-6.12.0.111

Clone the godot-mono-builds repository:

git clone https://github.com/godotengine/godot-mono-builds.git

Directory structure:

/
/godot-mono-builds
/mono

Patch and build

cd godot-mono-builds
export MONO_SOURCE_ROOT=../mono/
./linux.py configure --target=x86 --target=x86_64
./linux.py make --target=x86 --target=x86_64

Export paths

export ANDROID_NDK_ROOT=$HOME/Android/android-ndk-r21d
export ANDROID_HOME=$HOME/Android/Sdk/
export ANDROID_SDK_ROOT=$HOME/Android/Sdk/

Installing CMake for android

Use the Android SDK manager, if it fails to load make sure to use OpenJDK8

sudo apt-get install openjdk-8-jdk
sudo update-alternatives --config java
./sdkmanager --install "cmake;3.10.2.4988404"

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

Build the Desktop BCL.

./bcl.py make --product=desktop

Build the Desktop BCL for Windows.

./bcl.py make --product=desktop-win32

Build the Android BCL.

./bcl.py make --product=android

Build the iOS BCL.

./bcl.py make --product=ios

Build the WebAssembly BCL.

./bcl.py make --product=wasm

Copy the BCL

/linux.py copy-bcl --target=x86 --target=x86_64

Reference assemblies

./reference_assemblies.py install

Compile Godot

Clear any FrameworkPathOverride first!

export FrameworkPathOverride=

scons -j6 platform=x11 target=release_debug tools=yes module_mono_enabled=yes copy_mono_root=yes mono_prefix="$HOME/mono-installs/desktop-linux-x86_64-release/" mono_glue=no

bin/godot.x11.tools.64.mono --generate-mono-glue modules/mono/glue

scons -j6 platform=x11 target=release_debug tools=yes module_mono_enabled=yes copy_mono_root=yes mono_prefix="$HOME/mono-installs/desktop-linux-x86_64-release/"

scons -j6 platform=android target=release tools=no module_mono_enabled=yes copy_mono_root=yes mono_prefix="$HOME/mono-installs/android-armeabi-v7a-release"

scons -j6 platform=android target=release tools=no module_mono_enabled=yes copy_mono_root=yes mono_prefix="$HOME/mono-installs/android-arm64-v8a-release/" android_arch=arm64v8

scons -j6 platform=android target=release_debug tools=no module_mono_enabled=yes copy_mono_root=yes mono_prefix="$HOME/mono-installs/android-armeabi-v7a-release"

scons -j6 platform=android target=release_debug tools=no module_mono_enabled=yes copy_mono_root=yes mono_prefix="$HOME/mono-installs/android-arm64-v8a-release/" android_arch=arm64v8

cd platform/android/java
./gradlew generateGodotTemplates

At the end of this, bin/ contains:

android_debug.apk
android_release.apk
android_source.zip
godot-lib.debug.aar
godot-lib.release.aar
GodotSharp/
godot.x11.opt.tools.64.mono
libmonosgen-2.0.so

I can run godot.x11.opt.tools.64.mono and run games with C# scripts.
When I try to export the game to Android it throws an error:

Failed to export c# project, Assembly not found: "Mono.Android"

It turns out this is because ~/.local/share/godot/templates/3.2.4.beta.mono only contains the following files:

  • android_debug.apk
  • android_release.apk
  • version.txt

whereas the the template directory for the official build contains folders such as bcl, android_source.zip, etc...
There does not seem to be a copy-bcl argument for android.py.

So where are those files and how should I copy them to the templates directory?

Upgrade build scripts for Mono 6.12

OS/device including version:
Fedora 32
Mono 6.12.0.102
Emscripten 1.39.7 (nominal version supported by Mono 6.12.x)

Issue description:
Mono 6.12 has been released (currently 6.12.0.102), and I'm rebuild official containers to use it, based on Fedora 32.

The scripts in this repo will likely need to be updated (as well as the CI) to target Mono 6.12.x and Emscripten 1.39.7.

Current issues I found:

  • Emscripten patching fails, as recent Emscripten no longer write ~/.emscripten. Instead, they expect you to source emsdk_env.sh which sets the PATH, etc.
    So this needs an update:
    def get_emsdk_root():
    # Shamelessly copied from Godot's detect.py
    em_config_file = os.getenv('EM_CONFIG') or os.path.expanduser('~/.emscripten')
    if not os.path.exists(em_config_file):
    raise BuildError("Emscripten configuration file '%s' does not exist" % em_config_file)
    with open(em_config_file) as f:
    em_config = {}
    try:
    # Emscripten configuration file is a Python file with simple assignments.
    exec(f.read(), em_config)
    except StandardError as e:
    raise BuildError("Emscripten configuration file '%s' is invalid:\n%s" % (em_config_file, e))
    if 'BINARYEN_ROOT' in em_config and os.path.isdir(os.path.join(em_config.get('BINARYEN_ROOT'), 'emscripten')):
    # New style, emscripten path as a subfolder of BINARYEN_ROOT
    return os.path.join(em_config.get('BINARYEN_ROOT'), 'emscripten')
    elif 'EMSCRIPTEN_ROOT' in em_config:
    # Old style (but can be there as a result from previous activation, so do last)
    return em_config.get('EMSCRIPTEN_ROOT')
    else:
    raise BuildError("'BINARYEN_ROOT' or 'EMSCRIPTEN_ROOT' missing in Emscripten configuration file '%s'" % em_config_file)

CI deprecation notices from GitHub Actions to fix

The latest build I did shows a number of warnings / deprecation notices about some of the actions we're using:

Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/create-release@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/upload-release-asset@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

Seems like those two should be replaced by https://github.com/softprops/action-gh-release.

And about the set-output command:

The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Android: Port to NDK r23

To be able to use NDK r23 for Godot 3.5, we need to change android.py as the location/names of some binaries have changed.

godotengine/godot#61691 is doing that port for Godot's SCons files, and we need to do similar changes here.

By trial and error so far I got to this:

diff --git a/android.py b/android.py
index 68917e9..4673bcc 100755
--- a/android.py
+++ b/android.py
@@ -76,7 +76,7 @@ class AndroidTargetTable:
     }
 
     host_triples = {
-        'armeabi-v7a': 'armv5-linux-androideabi',
+        'armeabi-v7a': 'armv7a-linux-androideabi',
         'arm64-v8a': 'aarch64-linux-android',
         'x86': 'i686-linux-android',
         'x86_64': 'x86_64-linux-android'
@@ -118,14 +118,14 @@ def setup_android_target_template(env: dict, opts: AndroidOpts, target: str):
     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')
+    AR = path_join(tools_path, 'llvm-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++')
     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')
+    RANLIB = path_join(tools_path, 'llvm-ar -s')
     CMAKE = path_join(sdk_cmake_dir, 'bin', 'cmake')
     STRIP = path_join(tools_path, name_fmt % 'strip')
 
@@ -181,7 +181,7 @@ def setup_android_target_template(env: dict, opts: AndroidOpts, target: str):
 
     LDFLAGS += [
         '-z', 'now', '-z', 'relro', '-z', 'noexecstack',
-        '-ldl', '-lm', '-llog', '-lc', '-lgcc',
+        '-ldl', '-lm', '-llog', '-lc',
         '-Wl,-rpath-link=%s,-dynamic-linker=/system/bin/linker' % path_link,
         '-L' + path_link
     ]
@@ -303,7 +303,7 @@ def setup_android_cross_template(env: dict, opts: AndroidOpts, target: str, host
     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_RANLIB' % target] = 'ar -s'
     env['_android-%s_STRIP' % target] = 'strip'
 
     is_darwin = sys.platform == 'darwin'
@@ -356,12 +356,12 @@ def setup_android_cross_mxe_template(env: dict, opts: AndroidOpts, target: str,
 
     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_CC' % target] = path_join(mxe_bin, name_fmt % 'clang')
     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_RANLIB' % target] = path_join(mxe_bin, name_fmt % 'ar -s')
     env['_android-%s_STRIP' % target] = path_join(mxe_bin, name_fmt % 'strip')
 
     mingw_zlib_prefix = '%s/opt/mingw-zlib/usr' % opts.mxe_prefix

Which works for a bit but now I'm down to this error:

make[3]: Entering directory '/root/mono-configs/android-armeabi-v7a-release/mono/mini'
 /usr/bin/mkdir -p '/root/mono-installs/android-armeabi-v7a-release/lib'
 ../../doltlibtool   --mode=install /usr/bin/install -c   libmonosgen-2.0.la libmono-ee-interp.la '/root/mono-installs/android-armeabi-v7a-release/lib'
libtool: install: /usr/bin/install -c .libs/libmonosgen-2.0.so /root/mono-installs/android-armeabi-v7a-release/lib/libmonosgen-2.0.so
/usr/bin/install: cannot stat '.libs/libmonosgen-2.0.so': No such file or directory
make[3]: *** [Makefile:1681: install-libLTLIBRARIES] Error 1

And indeed //root/mono-installs/android-armeabi-v7a-release/mono/mini/.libs only has libmonosgen-2.0.a and not .so, so something must have changed that makes it default to static instead of shared.

If you're interested/have time, your help would be welcome too @madmiraal to make sure we can build the Mono toolchain for Android. This repo pretty much needs similar changes as done in godotengine/godot#61691 I suppose.

Here's my current build-containers WIP update: godotengine/build-containers#109
And for this repo we'll want to build CI once ported too:

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 528bb5b..3bc2d90 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -35,7 +35,7 @@ env:
   # platform/android/java/app/config.gradle
   ANDROID_PLATFORM: android-32
   ANDROID_API: 19
-  ANDROID_NDK_VERSION: 21.4.7075529
+  ANDROID_NDK_VERSION: 23.2.8568313
   # platform/iphone/detect.py
   IOS_VERSION_MIN: 10.0
 

I already updated to platform 32 in fcf205c.

Error when building for iOS: error: 'asl_log' is deprecated: first deprecated in iOS 10.0 - os_log(3) has replaced asl(3) [-Werror,-Wdeprecated-declarations]

OS/device including version:
OS: Mac OS X 10.15.7
SDK: iPhoneOS14.0
https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#language-and-runtime

Issue description:
I'm currently trying to build this using GitHub Actions, this mac-os image is with the latest software versions: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/runs/1403642388?check_suite_focus=true

Compiling error when compiling windows

After executing windows.py configure --target=i686 --target=x86_64 --mxe-prefix=/usr

D:\godot-mono-builds-master\godot-mono-builds-master>windows.py make --target=i686 --target=x86_64 --mxe-prefix=/usr
Traceback (most recent call last):
  File "D:\godot-mono-builds-master\godot-mono-builds-master\windows.py", line 8, in <module>
    run_main(argv[1:], target_platform='windows')
  File "D:\godot-mono-builds-master\godot-mono-builds-master\desktop.py", line 208, in run_main
    cmd_utils.add_runtime_arguments(parser, default_help)
  File "D:\godot-mono-builds-master\godot-mono-builds-master\cmd_utils.py", line 59, in add_runtime_arguments
    add_base_arguments(parser, default_help)
  File "D:\godot-mono-builds-master\godot-mono-builds-master\cmd_utils.py", line 47, in add_base_arguments
    parser.add_argument('--configure-dir', default=path_join(home, 'mono-configs'), help=default_help)
  File "C:\New folder\lib\ntpath.py", line 78, in join
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Configure fails with `C compiler cannot create executables`

OS/device including version:

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

Issue description:
Running the following command:

`./linux.py configure --mono-sources ../mono/  --target=x86 --target=x86_64`

Results in:

configure:5283: $? = 0
configure:5272: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
configure:5283: $? = 0
configure:5272: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:5283: $? = 1
configure:5272: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:5283: $? = 1
configure:5303: checking whether the C compiler works
configure:5325: gcc -O2 -g -m32 -O2 -g -m32 -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP  conftest.c  >&5
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/9/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/9/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
configure:5329: $? = 1
configure:5367: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "mono"
| #define PACKAGE_TARNAME "mono"
| #define PACKAGE_VERSION "6.12.0"
| #define PACKAGE_STRING "mono 6.12.0"
| #define PACKAGE_BUGREPORT "https://github.com/mono/mono/issues/new"
| #define PACKAGE_URL ""
| #define PACKAGE "mono"
| #define VERSION "6.12.0"
| #define MONO_CORLIB_VERSION "1A5E0066-58DC-428A-B21C-0AD6CDAE2789"
| #define HAVE_CLASSIC_WINAPI_SUPPORT 1
| #define HAVE_UWP_WINAPI_SUPPORT 0
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:5372: error: in `/home/timothy/mono-configs/desktop-linux-x86-release':
configure:5374: error: C compiler cannot create executables
See `config.log' for more details

I suppose the important part here is /usr/bin/ld: cannot find -lgcc

make[4]: execvp: mono: Permission denied

OS/device including version:

ubuntu 18.04

Issue description:

execute the command
./bcl.py make --product=wasm
Then the error is as follows
make[4]: execvp: mono: Permission denied
I'm sure I followed this tutorial step by step, but I don't know why I get this error
Screenshots of issue:

image

Include "How To Use" in Readme

I downloaded the release and dropped it into "/home/sam/bin/Godot Mono/3.5.1/GodotSharp/Tools/aot-compilers/" then removed the "-release" from the folder... and I still can't build my project with AOT.

I don't know what I'm doing wrong, but I also don't know what I was supported to actually do in the first place.

.wasm script fails to build with readme versions of Emscripten and Mono

OS/device including version:
debian-11 x64
nvidia 2080
intel i9-139000k

Issue description:
The README.md specifies these versions:

Mono: 6.12.0.182.
Emscripten: 1.39.9.

My system matches these requirements:
my system:

dev_user:~/Desktop/git_repos/third_party/mono$ git branch
* (HEAD detached at mono-6.12.0.182)
dev_user:~/Desktop/git_repos/owned/local_code_tests/test_c$ emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.39.9

Running these commands work until I end up attempting to use the make command:

./patch_mono.py --mono-sources $HOME/Desktop/git_repos/third_party/mono
./patch_emscripten.py --mono-sources $HOME/Desktop/git_repos/third_party/mono
./wasm.py configure --target=runtime --mono-sources $HOME/Desktop/git_repos/third_party/mono
./wasm.py make --target=runtime --mono-sources $HOME/Desktop/git_repos/third_party/mono

error during compiling mono with emscripten

/home/dev_user/Desktop/git_repos/third_party/mono/mono/utils/mono-rand.c:39:10: fatal error: 'sys/random.h' file not found
#include <sys/random.h>
         ^~~~~~~~~~~~~~
1 error generated.

I sandboxed this and it appears the emscripten compiler specified does not have the sys/random headers that were added to glibc (libc6 debian).
I believe it is a newer feature of C because of the answer on this question:
https://stackoverflow.com/questions/30800331/getrandom-syscall-in-c-not-found
Sandboxing this away from godot, I have same issue with versions of mono/emscripten:

#include <stdio.h>
#include "sys/random.h"

int main()
{
    printf("Hello World");

    getentropy(NULL, 0); //from sys/random.h
    return 0;
}

debian's gcc:

dev_user@dbn139i9:~/Desktop/git_repos/owned/local_code_tests/test_c$ gcc hello_world.c 
dev_user@dbn139i9:~/Desktop/git_repos/owned/local_code_tests/test_c$ ls
a.out  hello_world.c*

emscripten:

dev_user@dbn139i9:~/Desktop/git_repos/owned/local_code_tests/test_c$ emcc hello_world.c 
cache:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/home/dev_user/.emsdk/upstream/emscripten/cache/is_vanilla.txt" for subsequent builds)
cache:INFO:  - ok
hello_world.c:2:10: fatal error: 'sys/random.h' file not found
#include "sys/random.h"
         ^~~~~~~~~~~~~~

So, it seems this newer feature of C is not in the emscripten compiler listed.

So, this communicates to me that the version of emscripten in the readme is incompatible with the version of mono specified.
I have different compile issues using latest emscripten.

I believe the README.md is specifying either the wrong version of mono, or the wrong version of emscripten. I imagine it is the wrong veresion of emscripten, since this file does not seem to have changed in a while in the mono code base (at a quick glance).

Can the README.md to specify the correct versions to use to compile mono for webassembly?

Thanks.

Expected: be able to compile mono for webassmbly
Result: compile errors with versions listed.

My attempts to fix:
modify mono/utils/mono-rand.c to not use #include "sys/random.h", but using

#include <sys/syscall.h>

did not work

 error: implicit declaration of function 'getentropy' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                gint const err = getentropy (buffer, len);

(#include <linux/random.h> fails to find file)

edit: perhaps there is a way to see the versions produced by the official build machines for the mono binaries? I'm not familiar with where to look for that.

Issues with enabling BTLS on Windows

OS/device including version:
Windows, cross-compiling from Fedora with MinGW

Issue description:
PR #49 introduced build issues that affect both macOS ARM64 builds and the Windows 64-bit builds (at least cross-compiled from Fedora with MinGW).

See godotengine/build-containers#95 for the macOS ARM64 build.

For several months I had this PR reverted locally in build-containers to solve it (godotengine/build-containers@d8d17c5), and then in #64 and #65 we decided to improve it to make it Windows-only to prevent the macOS ARM64 issue.

And I've used that in 3.5 RC 1 builds based on c865201, but it seems that it's still broken on Windows 64-bit now: godotengine/godot#61176

So for now I've reverted #65 and #49 with 20368d7 and aaee521.

This can be looked into further to figure out how to actually make BTLS support work on Windows with MinGW, and possibly finally fix godotengine/godot#54758 (ref #47 too for context). Until we're sure that it's working, keeping these WIP patches seem to do more harm than good.

Latest windows mono release throws error when building on Ubuntu.

OS/device including version:

Ubuntu 20.04 (Github actions runner)

Issue description:

When I build godot mono with the latest windows mono release from this repository, I get the following error:

/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmini_la-mini-windows.o):(.text+0x2dc): undefined reference to `__imp_timeGetDevCaps'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmini_la-mini-windows.o):(.text+0x334): undefined reference to `__imp_timeSetEvent'

I've installed mingw-w64, and I've switched the threading model to posix before building.

Note that when I build without mono, everything works. Given that the error points directly to the mono-release, I feel like it's the culprit.

Here the link to the github actions for reference:
https://github.com/Fractural/SGPhysics2D/actions

Windows release doesn't include MSVC-compatible Mono libraries

OS/device including version:
Related to the windows release

Issue description:
The release of the desktop for windows windows-x86_64.zip has the dll files ending with .a or .o, making them not usable when building godot on windows. I've tried just renaming them but that doesn't fix it.

Screenshots of issue:
broken_dll

Errors when building godot 3.x mono windows on ubuntu 20.04

OS/device including version:

Latest 3.x branch of godot.
Ubuntu 20.04 (On Github Actions runner machine)

Issue description:

I get these errors while building windows mono using the prebuilt mono libraries provided by this repo:

/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmini_la-mini-windows.o):(.text+0x2dc): undefined reference to `__imp_timeGetDevCaps'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmini_la-mini-windows.o):(.text+0x334): undefined reference to `__imp_timeSetEvent'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmini_la-mini-windows.o):(.text+0x39a): undefined reference to `__imp_timeKillEvent'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmono_dbg_la-debugger-agent.o):(.text+0x1d7f): undefined reference to `__imp_shutdown'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmono_dbg_la-debugger-agent.o):(.text+0x1d98): undefined reference to `__imp_shutdown'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x1e0): undefined reference to `__imp_SafeArrayPutElement'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x2d5): undefined reference to `__imp_SafeArrayCreate'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x32d): undefined reference to `__imp_SafeArrayDestroy'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x35e): undefined reference to `__imp_SafeArrayGetDim'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x37c): undefined reference to `__imp_SafeArrayGetUBound'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x383): undefined reference to `__imp_SafeArrayGetLBound'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x435): undefined reference to `__imp_SafeArrayPtrOfIndex'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x4c4): undefined reference to `__imp_SafeArrayGetDim'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x569): undefined reference to `__imp_SafeArrayGetUBound'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x5ce): undefined reference to `__imp_SafeArrayGetLBound'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0xf18): undefined reference to `__imp_SysFreeString'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x2280): undefined reference to `__imp_SysStringLen'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x3c74): undefined reference to `__imp_CoCreateFreeThreadedMarshaler'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x3d9a): undefined reference to `__imp_SysAllocStringLen'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x7143): undefined reference to `__imp_SysAllocStringLen'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x7e13): undefined reference to `__imp_SysAllocStringLen'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-cominterop.o):(.text+0x7e28): undefined reference to `__imp_SysFreeString'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-marshal-windows.o):(.text+0x33): undefined reference to `__imp_CoTaskMemAlloc'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-marshal-windows.o):(.text+0x53): undefined reference to `__imp_CoTaskMemRealloc'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-marshal-windows.o):(.text+0x147): undefined reference to `__imp_CoTaskMemAlloc'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-marshal-windows.o):(.text+0x1e0): undefined reference to `__imp_CoTaskMemAlloc'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-threads.o):(.text+0x64f5): undefined reference to `__imp_CoInitializeEx'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-threads.o):(.text+0x6563): undefined reference to `__imp_CoUninitialize'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32process.o):(.text+0x2ae): undefined reference to `GetFileVersionInfoSizeW'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32process.o):(.text+0x303): undefined reference to `GetFileVersionInfoW'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32process.o):(.text+0x348): undefined reference to `VerQueryValueW'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32process.o):(.text+0x399): undefined reference to `VerQueryValueW'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32process.o):(.text+0x4ab): undefined reference to `VerQueryValueW'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket.o):(.text+0xb2): undefined reference to `__imp_getpeername'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket.o):(.text+0x566): undefined reference to `__imp_getsockopt'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket.o):(.text+0x1288): undefined reference to `__imp_WSASocketW'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket.o):(.text+0x2be7): undefined reference to `__imp_shutdown'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket.o):(.text+0x2d50): undefined reference to `__imp_WSAIoctl'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket.o):(.text+0x2e87): undefined reference to `__imp_gethostname'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket.o):(.text+0x30e0): undefined reference to `__imp_gethostname'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoutils_la-mono-os-wait-win32.o):(.text+0x6fb): undefined reference to `__imp_WSAWaitForMultipleEvents'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoutils_la-mono-os-wait-win32.o):(.text+0x806): undefined reference to `__imp_WSAWaitForMultipleEvents'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoutils_la-networking-posix.o):(.text+0x239): undefined reference to `__imp_getprotobyname'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoutils_la-networking-posix.o):(.text+0x2a1): undefined reference to `__imp_getprotobyname'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoutils_la-networking-posix.o):(.text+0x2f9): undefined reference to `__imp_getprotobyname'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x8d): undefined reference to `__imp_WSAIoctl'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x17b): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x247): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x3ff): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x42e): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x587): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x5ad): more undefined references to `__imp_WSASetLastError' follow
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x9a8): undefined reference to `__imp_WSARecv'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xa71): undefined reference to `__imp_WSARecv'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xab7): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xadd): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xc3f): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xc6d): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xe07): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xe2d): more undefined references to `__imp_WSASetLastError' follow
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xed6): undefined reference to `__imp_WSASend'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xf9f): undefined reference to `__imp_WSASend'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0xfdf): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x100d): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x10b4): undefined reference to `__imp_WSAIoctl'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x11d7): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x121b): undefined reference to `__imp_WSASetLastError'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmonoruntimesgen_la-w32socket-win32.o):(.text+0x1363): undefined reference to `__imp_WSASetLastError'
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.windows.opt.64.mono.exe] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:19:15.640]

I've already installed MinGW and switched to the posix threading model before hand:

          sudo apt-get install mingw-w64
          echo "1" | sudo update-alternatives --config x86_64-w64-mingw32-gcc
          echo "1" | sudo update-alternatives --config x86_64-w64-mingw32-g++

Missing btls-shared library for macOS arm64 (desktop-osx-arm64-release)

OS/device including version:
Fedora, cross-compiling to macOS with osxcross (official build server)
With build scripts from https://github.com/godotengine/build-containers/tree/3.x

Issue description:
As reported by @rohanrhu, macOS arm64 mono builds are missing the libmono-btls-shared.dylib library for arm64.
We only include the x86_64 one.
godotengine/godot#61364 (comment)

Indeed, the current build artifacts only have it for x86_64:

$ file desktop-osx-x86_64-release/lib/libmono-btls-shared.dylib 
desktop-osx-x86_64-release/lib/libmono-btls-shared.dylib: Mach-O 64-bit x86_64 dynamically linked shared library, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|NO_REEXPORTED_DYLIBS>

$ file desktop-osx-arm64-release/lib/libmono-btls-shared.dylib 
desktop-osx-arm64-release/lib/libmono-btls-shared.dylib: cannot open `desktop-osx-arm64-release/lib/libmono-btls-shared.dylib' (No such file or directory)

The upstream configure seems to have support for building btls for darwin/aarch64, so something must be off either in our scripts, or in our usage of them in build-containers.

Make fails bits/c++config.h no such file or directory

Probably related to #23

OS/device including version:

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

Issue description:

After installing gcc-multilib:

./linux.py make --target=x86 --target=x86_64

results in:

In file included from /usr/include/c++/9/stdlib.h:36,
                 from /Documents/Projects/mono/mono/eglib/test/../glib.h:21,
                 from /Documents/Projects/mono/mono/eglib/test/enum.cpp:2:
/usr/include/c++/9/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory
   41 | #include <bits/c++config.h>
      |          ^~~~~~~~~~~~~~~~~~

Does this require q specific version of gcc-multilib or is there something else going on?

Errors when building AOT compilers for Android

My aim is to build the AOT compilers for Android.

I was able to build (but was it needed after all for my purpose :) ?):

./android.py configure --target=all-runtime
./android.py make --target=all-runtime

Getting errors on the next step:

./android.py configure --target=all-cross
./android.py make --target=all-cross

Log:

~/Documents/mono_custom/godot-mono-builds(master) » python3 ./android.py configure --target=all-cross                            1 ↵ ksvslk@ksvslks-MacBook-Pro
WARNING: Cannot find CMake. Required by the llvm Makefile.
Running command 'make': make -j1 -C /Users/ksvslk/mono/llvm -f build.mk install-llvm LLVM_BUILD=/Users/ksvslk/mono-configs/llvm-llvm64 LLVM_PREFIX=/Users/ksvslk/mono-installs/llvm-llvm64 LLVM_CMAKE_ARGS=
mkdir -p /Users/ksvslk/mono-configs/llvm-llvm64 /Users/ksvslk/mono-installs/llvm-llvm64
cd /Users/ksvslk/mono-configs/llvm-llvm64 &&  \
		 \
		-DCMAKE_INSTALL_PREFIX="/Users/ksvslk/mono-installs/llvm-llvm64" \
		-DCMAKE_BUILD_TYPE=Release \
		-DLLVM_BUILD_TESTS=Off \
		-DLLVM_INCLUDE_TESTS=Off \
		-DLLVM_BUILD_EXAMPLES=Off \
		-DLLVM_INCLUDE_EXAMPLES=Off \
		-DLLVM_TOOLS_TO_BUILD="opt;llc;llvm-config;llvm-dis" \
		-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \
		 	\
		-DLLVM_ENABLE_ASSERTIONS= \
		-DLLVM_ENABLE_LIBXML2=Off \
		-DHAVE_FUTIMENS=0 \
		 \
		/Users/ksvslk/mono/external/llvm-project/llvm/
/bin/sh: -DCMAKE_INSTALL_PREFIX=/Users/ksvslk/mono-installs/llvm-llvm64: No such file or directory
make: *** [/Users/ksvslk/mono-configs/llvm-llvm64/Makefile] Error 127
'make' exited with error code: 2

My paths are set:

ANDROID_SDK_ROOT=/Users/ksvslk/Library/Android/sdk
ANDROID_NDK_ROOT=/Users/ksvslk/Library/Android/sdk/ndk/21.3.6528147
MONO_SOURCE_ROOT=/Users/ksvslk/mono

And cmake is installed in ANDROID_SDK_ROOT/cmake/3.10.2.4988404 (also placed the content of 3.10.... directly to cmake folder but that did not make any difference)

error: the following arguments are required: --mono-sources

I've got an error when I try to pass "--mono-sources", "--install-dir" or "--configure-dir" argument to the desktop.py script.

This is the command I've tested in a terminal:
./desktop.py linux configure --mono-sources="/mnt/R/Apps_Sources/mono" --target=i686 --target=x86_64
OR
./desktop.py linux make --mono-sources="/mnt/R/Apps_Sources/mono" --target=i686 --target=x86_64
and it produces the following error:

desktop.py: error: the following arguments are required: --mono-sources

The error is thrown by the line #215 of the desktop.py file

I've tried to debug the script by myself, without success:

To check the arguments, I've added, the following line:
print(raw_args)
at line #214

This is the output of the print command:

['linux', 'configure', '--mono-sources=/mnt/R/Apps_Sources/mono', '--target=i686', '--target=x86_64']

so the argument "--mono-sources" seems to be well transmitted, but it's not detected.

note that the command:
export MONO_SOURCE_ROOT=/mnt/R/Apps_Sources/mono;./desktop.py linux configure --target=i686 --target=x86_64
runs well,but
export MONO_SOURCE_ROOT=/mnt/R/Apps_Sources/mono;./desktop.py linux configure --target=i686 --target=x86_64 --install-dir=/tmp
fails with the similar error:

desktop.py: error: unrecognized arguments: --install-dir=/tmp

Perhaps it's an issue due to the argument containing an "-" ?

I use Python 3.8.1 on Arch linux x64

Thanks for your work and your help

Error when running ./patch_mono.py and ./patch_emscripten.py Any suggestions?

python3 ./patch_mono.py
error:
Running: patch -N -p1 < /home/sa/godot-mono-builds/files/patches/fix-mono-android-tkill.diff
patching file mono/metadata/threads.c
Hunk #1 FAILED at 77.
1 out of 1 hunk FAILED -- saving rejects to file mono/metadata/threads.c.rej
patching file mono/utils/mono-threads-posix.c
Hunk #1 FAILED at 31.
1 out of 1 hunk FAILED -- saving rejects to file mono/utils/mono-threads-posix.c.rej
patch exited with error code: 1

python3 ./patch_emscripten.py
error:
Running: patch -N -p1 < /home/sa/mono/sdks/builds/fix-emscripten-8511.diff
bash: /home/sa/mono/sdks/builds/fix-emscripten-8511.diff: No such file or directory
patch exited with error code: 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.