microsoft/openvmm

Public

mirrored fromhttps://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
88225af467100fc2c9e11606924509b93592a254

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.cargo/config.toml

121lines · modecode

1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3
4[alias]
5xflowey = "run --quiet -p flowey_trampoline -- run -p flowey_hvlite --profile flowey -- pipeline run"
6xtask = "run -p xtask --profile xtask --"
7
8[env]
9# Use the packaged openssl libraries on musl targets.
10X86_64_UNDERHILL_LINUX_MUSL_OPENSSL_NO_VENDOR = "1"
11X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_NO_VENDOR = "1"
12AARCH64_UNDERHILL_LINUX_MUSL_OPENSSL_NO_VENDOR = "1"
13AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_NO_VENDOR = "1"
14
15# pkg-config-rs has all sorts of sharp edges, so just tell openssl-sys exactly
16# where to get openssl.
17X86_64_UNDERHILL_LINUX_MUSL_OPENSSL_DIR = { value = ".packages/extracted/x86_64-sysroot", relative = true }
18X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR = { value = ".packages/extracted/x86_64-sysroot", relative = true }
19X86_64_UNDERHILL_LINUX_MUSL_OPENSSL_STATIC = "1"
20X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_STATIC = "1"
21AARCH64_UNDERHILL_LINUX_MUSL_OPENSSL_DIR = { value = ".packages/extracted/aarch64-sysroot", relative = true }
22AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR = { value = ".packages/extracted/aarch64-sysroot", relative = true }
23AARCH64_UNDERHILL_LINUX_MUSL_OPENSSL_STATIC = "1"
24AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_STATIC = "1"
25
26# Tell cc-rs where the Underhill compilers are.
27CC_aarch64_underhill_linux_musl = { value = "build_support/underhill_cross/aarch64-underhill-musl-gcc", relative = true }
28CC_aarch64_unknown_linux_musl = { value = "build_support/underhill_cross/aarch64-underhill-musl-gcc", relative = true }
29CC_x86_64_underhill_linux_musl = { value = "build_support/underhill_cross/x86_64-underhill-musl-gcc", relative = true }
30CC_x86_64_unknown_linux_musl = { value = "build_support/underhill_cross/x86_64-underhill-musl-gcc", relative = true }
31
32# Use the packaged verison of protoc, symlinked by repo setup tooling
33PROTOC = { value = ".packages/Google.Protobuf.Tools/tools/protoc", relative = true }
34
35# Path to lxutil.dll
36X86_64_LXUTIL_DLL_DIR = { value = ".packages/Microsoft.WSL.LxUtil.amd64fre/build/native/bin", relative = true }
37AARCH64_LXUTIL_DLL_DIR = { value = ".packages/Microsoft.WSL.LxUtil.arm64fre/build/native/bin", relative = true }
38
39# Path to sysroot (used by build_support/underhill_cross)
40X86_64_SYSROOT = { value = ".packages/extracted/x86_64-sysroot", relative = true }
41AARCH64_SYSROOT = { value = ".packages/extracted/aarch64-sysroot", relative = true }
42
43# Streamline the OpenVMM `cargo run` experience by setting a sane-default for
44# what kernel and initrd to use when booting via Linux direct (i.e: use the
45# sample kernel packaged alongside openvmm-deps)
46X86_64_OPENVMM_LINUX_DIRECT_KERNEL = { value = ".packages/underhill-deps-private/x64/vmlinux", relative = true }
47X86_64_OPENVMM_LINUX_DIRECT_INITRD = { value = ".packages/underhill-deps-private/x64/initrd", relative = true }
48AARCH64_OPENVMM_LINUX_DIRECT_KERNEL = { value = ".packages/underhill-deps-private/aarch64/Image", relative = true }
49AARCH64_OPENVMM_LINUX_DIRECT_INITRD = { value = ".packages/underhill-deps-private/aarch64/initrd", relative = true }
50# Streamline the OpenVMM `cargo run` experience by setting a sane-default for
51# what UEFI firmware to use (i.e: use the Microsoft MSVM firmware)
52X86_64_OPENVMM_UEFI_FIRMWARE = { value = ".packages/hyperv.uefi.mscoreuefi.x64.RELEASE/MsvmX64/RELEASE_VS2022/FV/MSVM.fd", relative = true }
53AARCH64_OPENVMM_UEFI_FIRMWARE = { value = ".packages/hyperv.uefi.mscoreuefi.AARCH64.RELEASE/MsvmAARCH64/RELEASE_VS2022/FV/MSVM.fd", relative = true }
54
55[target.'cfg(all(windows, target_env = "msvc"))']
56rustflags = [
57 # Set up delayloads.
58 "-C", "link-args=dloadhelper.lib /delayload:ws2_32.dll /delayload:virtdisk.dll /delayload:user32.dll /delayload:winhvplatform.dll",
59 # Set up the CRT: use ucrtbase.dll but statically link the VC runtime.
60 "-C", "link-args=/nodefaultlib onecore_apiset.lib ucrt.lib libvcruntime.lib libcmt.lib",
61 # Enable CFG
62 "-Ccontrol-flow-guard"
63]
64
65[target.aarch64-apple-darwin]
66# At least some of our macos binaries need to have entitlements for running
67# hypervisor code, so they must be signed.
68runner = "build_support/macos/sign_and_run.sh"
69
70# Use the internal gcc to invoke link so that we can use our spec file that
71# points to our version of musl.
72[target.x86_64-unknown-linux-musl]
73linker = "build_support/underhill_cross/x86_64-underhill-musl-gcc"
74[target.x86_64-underhill-linux-musl]
75linker = "build_support/underhill_cross/x86_64-underhill-musl-gcc"
76[target.aarch64-unknown-linux-musl]
77linker = "build_support/underhill_cross/aarch64-underhill-musl-gcc"
78[target.aarch64-underhill-linux-musl]
79linker = "build_support/underhill_cross/aarch64-underhill-musl-gcc"
80
81[target.'cfg(target_arch = "aarch64")']
82rustflags = [
83 # This enables efficient atomics via LSE and SIMD via Neon.
84 # The machines like DevKit and CC have these.
85 "-Ctarget-feature=+lse,+neon",
86]
87
88[target.'cfg(target_env = "musl")']
89rustflags = [
90 # Use the musl from the sysroot, not from the Rust distribution.
91 "-Clink-self-contained=n",
92]
93
94[target.'cfg(all(target_arch = "aarch64", target_env = "musl"))']
95rustflags = [
96 # Avoid swapping in and out the hefty SVE state on Underhill/arm64.
97 # That is not enabled by default in the compiler at the moment, making
98 # this explicit.
99 "-Ctarget-feature=-sve,-sve2",
100]
101
102# Specify a common set of rustflags for all targets.
103[target.'cfg(all())']
104rustflags = [
105 # Disable FPO to get full call stack as the '--call-graph=dwarf' option
106 # is not working well.
107 "-Cforce-frame-pointers=yes",
108
109 # Enable v0 symbols to get better output from `perf` and related tools.
110 "-Csymbol-mangling-version=v0",
111
112 # Treat warnings as errors in CI.
113### ENABLE_IN_CI "-Dwarnings",
114]
115
116# Specify a common set of rustdocflags for all targets.
117[build]
118rustdocflags = [
119 # Treat warnings as errors in CI.
120### ENABLE_IN_CI "-Dwarnings",
121]
122