Skip to content

Commit 0231327

Browse files
committed
Enable building LLVM cross-compilers on Linux
Linux doesn't need to build MXE since the distributions we support at this point have mingw packaged and we rely on the packages to provide cross-compilation environment for Windows. Neither does Linux build require the Mono Windows environments to be built. Previously, when one enable the Windows LLVM build the Mono Windows runtime was attempted to build as well. The attempt would fail since some Windows-only libraries required by Mono/libmonodroid aren't available as packages on Linux. This commit disables building of Mono Windows runtimes while making it possible to build the LLVM Windows cross compiler.
1 parent d891a86 commit 0231327

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

build-tools/mono-runtimes/mono-runtimes.projitems

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
<InstallPath Condition="$(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':Linux:'))">Linux/</InstallPath>
277277
</_LlvmRuntime>
278278

279-
<_LlvmRuntime Include="llvmwin32" Condition=" '$(_LlvmNeeded)' != '' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win32:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':linux-Win32:'))) ">
279+
<_LlvmRuntime Include="llvmwin32" Condition=" '$(_LlvmNeededWindows32)' != '' ">
280280
<BuildDir>build-win32</BuildDir>
281281
<Prefix>$(_LlvmPrefixWin32)</Prefix>
282282
<ConfigureFlags>$(_LlvmConfigureFlagsWin32)</ConfigureFlags>
@@ -287,7 +287,7 @@
287287
<InstallPath></InstallPath>
288288
</_LlvmRuntime>
289289

290-
<_LlvmRuntime Include="llvmwin64" Condition=" '$(_LlvmNeeded)' != '' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win64:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':linux-Win64:'))) ">
290+
<_LlvmRuntime Include="llvmwin64" Condition=" '$(_LlvmNeededWindows64)' != '' ">
291291
<BuildDir>build-win64</BuildDir>
292292
<Prefix>$(_LlvmPrefixWin64)</Prefix>
293293
<ConfigureFlags>$(_LlvmConfigureFlagsWin64)</ConfigureFlags>

build-tools/mono-runtimes/mono-runtimes.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
<!-- LLVM -->
2828
<_LlvmNeeded Condition=" '$(AndroidSupportedTargetAotAbis)' != '' ">yes</_LlvmNeeded>
2929
<_LlvmCanBuild64 Condition=" '$(HostBits)' == '64' ">yes</_LlvmCanBuild64>
30+
<_LlvmNeededWindows32></_LlvmNeededWindows32>
31+
<_LlvmNeededWindows64></_LlvmNeededWindows64>
32+
<_LlvmHaveWindowsAOT></_LlvmHaveWindowsAOT>
33+
<_LlvmHaveWindowsAOT Condition=" $(AndroidSupportedTargetAotAbisForConditionalChecks.Contains (':win-armeabi:')) Or $(AndroidSupportedTargetAotAbisForConditionalChecks.Contains (':win-arm64:')) Or $(AndroidSupportedTargetAotAbisForConditionalChecks.Contains (':win-x86:')) Or $(AndroidSupportedTargetAotAbisForConditionalChecks.Contains (':win-x86_64:'))">yes</_LlvmHaveWindowsAOT>
34+
<_LlvmNeededWindows32 Condition=" '$(_LlvmNeeded)' != '' And '$(_LlvmHaveWindowsAOT)' == 'yes' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win32:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':Linux:'))) ">yes</_LlvmNeededWindows32>
35+
<_LlvmNeededWindows64 Condition=" '$(_LlvmNeeded)' != '' And '$(_LlvmHaveWindowsAOT)' == 'yes' And '$(_LlvmCanBuild64And)' == 'yes' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win64:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':Linux:'))) ">yes</_LlvmNeededWindows64>
3036
<_LlvmOutputDirTop>$(_CrossOutputDirTop)\llvm</_LlvmOutputDirTop>
3137

3238
<_LlvmBuildDir32>$(_LlvmOutputDirTop)\build-32</_LlvmBuildDir32>

build-tools/scripts/BuildEverything.mk

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,19 @@ ALL_AOT_ABIS = \
4747
arm64 \
4848
x86 \
4949
x86_64 \
50-
#
51-
# On Linux we now disable building of all the Windows cross-compiler/AOT environments.
52-
# This is because Linux builds don't use mxe and the system-provided mingw environment
53-
# is missing a handful of libraries required by libmonodroid and libzip-windows
54-
#
55-
# When/if CppSharp is fixed to work on Linux we can re-enable the code below
56-
#
50+
5751
ifneq ($(OS),Linux)
5852
ALL_HOST_ABIS += \
5953
mxe-Win32 \
6054
mxe-Win64
61-
endif
55+
6256

6357
ALL_AOT_ABIS += \
6458
win-armeabi \
6559
win-arm64 \
6660
win-x86 \
6761
win-x86_64
62+
endif
6863

6964
ifneq ($(OS),Linux)
7065
MONO_OPTIONS += --arch=64

0 commit comments

Comments
 (0)