microsoft/openvmm

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
ba9061579f864488ad242d332864176ff2b3b8ac

Branches

Tags

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

Clone

HTTPS

Download ZIP

.cargo/config.toml

134lines · modecode

1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3
4[alias]
5xflowey = "run -p flowey_hvlite -- pipeline run"
6xtask = "run -p xtask --profile light --"
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# and tell symcrypt-sys exactly where to get symcrypt.
27X86_64_UNDERHILL_LINUX_MUSL_SYMCRYPT_LIB_PATH = { value = ".packages/extracted/x86_64-sysroot/lib", relative = true }
28X86_64_UNKNOWN_LINUX_MUSL_SYMCRYPT_LIB_PATH = { value = ".packages/extracted/x86_64-sysroot/lib", relative = true }
29X86_64_UNDERHILL_LINUX_MUSL_SYMCRYPT_STATIC = "1"
30X86_64_UNKNOWN_LINUX_MUSL_SYMCRYPT_STATIC = "1"
31AARCH64_UNDERHILL_LINUX_MUSL_SYMCRYPT_LIB_PATH = { value = ".packages/extracted/aarch64-sysroot/lib", relative = true }
32AARCH64_UNKNOWN_LINUX_MUSL_SYMCRYPT_LIB_PATH = { value = ".packages/extracted/aarch64-sysroot/lib", relative = true }
33AARCH64_UNDERHILL_LINUX_MUSL_SYMCRYPT_STATIC = "1"
34AARCH64_UNKNOWN_LINUX_MUSL_SYMCRYPT_STATIC = "1"
35
36# Tell cc-rs where the Underhill compilers are.
37CC_aarch64_underhill_linux_musl = { value = "build_support/underhill_cross/aarch64-underhill-musl-gcc", relative = true }
38CC_aarch64_unknown_linux_musl = { value = "build_support/underhill_cross/aarch64-underhill-musl-gcc", relative = true }
39CC_x86_64_underhill_linux_musl = { value = "build_support/underhill_cross/x86_64-underhill-musl-gcc", relative = true }
40CC_x86_64_unknown_linux_musl = { value = "build_support/underhill_cross/x86_64-underhill-musl-gcc", relative = true }
41
42# Use the packaged verison of protoc, symlinked by repo setup tooling
43PROTOC = { value = ".packages/Google.Protobuf.Tools/tools/protoc", relative = true }
44
45# Path to sysroot (used by build_support/underhill_cross)
46X86_64_SYSROOT = { value = ".packages/extracted/x86_64-sysroot", relative = true }
47AARCH64_SYSROOT = { value = ".packages/extracted/aarch64-sysroot", relative = true }
48
49# Streamline the OpenVMM `cargo run` experience by setting a sane-default for
50# what kernel and initrd to use when booting via Linux direct (i.e: use the
51# sample kernel packaged alongside openvmm-deps)
52X86_64_OPENVMM_LINUX_DIRECT_KERNEL = { value = ".packages/underhill-deps-private/x64/vmlinux", relative = true }
53X86_64_OPENVMM_LINUX_DIRECT_INITRD = { value = ".packages/underhill-deps-private/x64/initrd", relative = true }
54AARCH64_OPENVMM_LINUX_DIRECT_KERNEL = { value = ".packages/underhill-deps-private/aarch64/Image", relative = true }
55AARCH64_OPENVMM_LINUX_DIRECT_INITRD = { value = ".packages/underhill-deps-private/aarch64/initrd", relative = true }
56# Streamline the OpenVMM `cargo run` experience by setting a sane-default for
57# what UEFI firmware to use (i.e: use the Microsoft MSVM firmware)
58X86_64_OPENVMM_UEFI_FIRMWARE = { value = ".packages/hyperv.uefi.mscoreuefi.x64.RELEASE/MsvmX64/RELEASE_VS2022/FV/MSVM.fd", relative = true }
59AARCH64_OPENVMM_UEFI_FIRMWARE = { value = ".packages/hyperv.uefi.mscoreuefi.AARCH64.RELEASE/MsvmAARCH64/RELEASE_CLANGPDB/FV/MSVM.fd", relative = true }
60
61[target.'cfg(all(windows, target_env = "msvc"))']
62rustflags = [
63 # Set up delayloads.
64 "-C", "link-args=dloadhelper.lib /delayload:ws2_32.dll /delayload:virtdisk.dll /delayload:user32.dll /delayload:winhvplatform.dll /delayload:bcrypt.dll /delayload:crypt32.dll",
65 # Set up the CRT: use ucrtbase.dll but statically link the VC runtime.
66 "-C", "link-args=/nodefaultlib onecore_apiset.lib ucrt.lib libvcruntime.lib libcmt.lib",
67 # Enable CFG
68 "-Ccontrol-flow-guard"
69]
70
71[target.aarch64-apple-darwin]
72# At least some of our macos binaries need to have entitlements for running
73# hypervisor code, so they must be signed.
74runner = "build_support/macos/sign_and_run.sh"
75
76# Use the internal gcc to invoke link so that we can use our spec file that
77# points to our version of musl.
78[target.x86_64-unknown-linux-musl]
79linker = "build_support/underhill_cross/x86_64-underhill-musl-gcc"
80[target.x86_64-underhill-linux-musl]
81linker = "build_support/underhill_cross/x86_64-underhill-musl-gcc"
82[target.aarch64-unknown-linux-musl]
83linker = "build_support/underhill_cross/aarch64-underhill-musl-gcc"
84[target.aarch64-underhill-linux-musl]
85linker = "build_support/underhill_cross/aarch64-underhill-musl-gcc"
86
87[target.'cfg(target_arch = "aarch64")']
88rustflags = [
89 # This enables efficient atomics via LSE and SIMD via Neon.
90 # The machines like DevKit and CC have these.
91 "-Ctarget-feature=+lse,+neon",
92]
93
94[target.'cfg(target_env = "musl")']
95rustflags = [
96 # Use the musl from the sysroot, not from the Rust distribution.
97 "-Clink-self-contained=n",
98 # Force musl to be statically linked in
99 "-Ctarget-feature=+crt-static",
100 # Use RELR relocation format, which is considerably smaller.
101 "-Clink-arg=-Wl,-z,pack-relative-relocs",
102 # Disable unwind tables to reduce binary size.
103 # TODO: It would be nice to have this enabled for debug builds
104 "-Cforce-unwind-tables=no",
105]
106
107[target.'cfg(all(target_arch = "aarch64", target_env = "musl"))']
108rustflags = [
109 # Avoid swapping in and out the hefty SVE state on Underhill/arm64.
110 # That is not enabled by default in the compiler at the moment, making
111 # this explicit.
112 "-Ctarget-feature=-sve,-sve2",
113]
114
115# Specify a common set of rustflags for all targets.
116[target.'cfg(all())']
117rustflags = [
118 # Disable FPO to get full call stack as the '--call-graph=dwarf' option
119 # is not working well.
120 "-Cforce-frame-pointers=yes",
121
122 # Enable v0 symbols to get better output from `perf` and related tools.
123 "-Csymbol-mangling-version=v0",
124
125 # Treat warnings as errors in CI.
126### ENABLE_IN_CI "-Dwarnings",
127]
128
129# Specify a common set of rustdocflags for all targets.
130[build]
131rustdocflags = [
132 # Treat warnings as errors in CI.
133### ENABLE_IN_CI "-Dwarnings",
134]
135