Skip to content

Commit 5033529

Browse files
grendellojonpryor
authored andcommitted
Enable building LLVM cross-compilers on Linux (#760)
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 b75f860 commit 5033529

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
<!-- LLVM -->
2828
<_LlvmNeeded Condition=" '$(AndroidSupportedTargetAotAbis)' != '' ">yes</_LlvmNeeded>
2929
<_LlvmCanBuild64 Condition=" '$(HostBits)' == '64' ">yes</_LlvmCanBuild64>
30+
<_LlvmHaveWindowsAOT Condition=" $(AndroidSupportedTargetAotAbisForConditionalChecks.Contains (':win-armeabi:')) Or $(AndroidSupportedTargetAotAbisForConditionalChecks.Contains (':win-arm64:')) Or $(AndroidSupportedTargetAotAbisForConditionalChecks.Contains (':win-x86:')) Or $(AndroidSupportedTargetAotAbisForConditionalChecks.Contains (':win-x86_64:'))">yes</_LlvmHaveWindowsAOT>
31+
<_LlvmNeededWindows32 Condition=" '$(_LlvmNeeded)' != '' And '$(_LlvmHaveWindowsAOT)' == 'yes' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win32:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':Linux:'))) ">yes</_LlvmNeededWindows32>
32+
<_LlvmNeededWindows64 Condition=" '$(_LlvmNeeded)' != '' And '$(_LlvmHaveWindowsAOT)' == 'yes' And '$(_LlvmCanBuild64)' == 'yes' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win64:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':Linux:'))) ">yes</_LlvmNeededWindows64>
3033
<_LlvmOutputDirTop>$(_CrossOutputDirTop)\llvm</_LlvmOutputDirTop>
3134

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

build-tools/scripts/BuildEverything.mk

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,19 @@ ALL_AOT_ABIS = \
5353
arm64 \
5454
x86 \
5555
x86_64 \
56-
#
57-
# On Linux we now disable building of all the Windows cross-compiler/AOT environments.
58-
# This is because Linux builds don't use mxe and the system-provided mingw environment
59-
# is missing a handful of libraries required by libmonodroid and libzip-windows
60-
#
61-
# When/if CppSharp is fixed to work on Linux we can re-enable the code below
62-
#
56+
6357
ifneq ($(OS),Linux)
6458
ALL_HOST_ABIS += \
6559
mxe-Win32 \
6660
mxe-Win64
67-
endif
61+
6862

6963
ALL_AOT_ABIS += \
7064
win-armeabi \
7165
win-arm64 \
7266
win-x86 \
7367
win-x86_64
68+
endif
7469

7570
ifneq ($(OS),Linux)
7671
MONO_OPTIONS += --arch=64

0 commit comments

Comments
 (0)