microsoft/openvmm
Publicmirrored fromhttps://github.com/microsoft/openvmmAvailable
.cargo/config.toml
123lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # Licensed under the MIT License. |
| 3 | |
| 4 | [alias] |
| 5 | xflowey = "run -p flowey_hvlite -- pipeline run" |
| 6 | xtask = "run -p xtask --profile light --" |
| 7 | |
| 8 | [env] |
| 9 | # Use the packaged openssl libraries on musl targets. |
| 10 | X86_64_UNDERHILL_LINUX_MUSL_OPENSSL_NO_VENDOR = "1" |
| 11 | X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_NO_VENDOR = "1" |
| 12 | AARCH64_UNDERHILL_LINUX_MUSL_OPENSSL_NO_VENDOR = "1" |
| 13 | AARCH64_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. |
| 17 | X86_64_UNDERHILL_LINUX_MUSL_OPENSSL_DIR = { value = ".packages/extracted/x86_64-sysroot", relative = true } |
| 18 | X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR = { value = ".packages/extracted/x86_64-sysroot", relative = true } |
| 19 | X86_64_UNDERHILL_LINUX_MUSL_OPENSSL_STATIC = "1" |
| 20 | X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_STATIC = "1" |
| 21 | AARCH64_UNDERHILL_LINUX_MUSL_OPENSSL_DIR = { value = ".packages/extracted/aarch64-sysroot", relative = true } |
| 22 | AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR = { value = ".packages/extracted/aarch64-sysroot", relative = true } |
| 23 | AARCH64_UNDERHILL_LINUX_MUSL_OPENSSL_STATIC = "1" |
| 24 | AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_STATIC = "1" |
| 25 | |
| 26 | # Tell cc-rs where the Underhill compilers are. |
| 27 | CC_aarch64_underhill_linux_musl = { value = "build_support/underhill_cross/aarch64-underhill-musl-gcc", relative = true } |
| 28 | CC_aarch64_unknown_linux_musl = { value = "build_support/underhill_cross/aarch64-underhill-musl-gcc", relative = true } |
| 29 | CC_x86_64_underhill_linux_musl = { value = "build_support/underhill_cross/x86_64-underhill-musl-gcc", relative = true } |
| 30 | CC_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 |
| 33 | PROTOC = { value = ".packages/Google.Protobuf.Tools/tools/protoc", relative = true } |
| 34 | |
| 35 | # Path to lxutil.dll |
| 36 | X86_64_LXUTIL_DLL_DIR = { value = ".packages/Microsoft.WSL.LxUtil.amd64fre/build/native/bin", relative = true } |
| 37 | AARCH64_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) |
| 40 | X86_64_SYSROOT = { value = ".packages/extracted/x86_64-sysroot", relative = true } |
| 41 | AARCH64_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) |
| 46 | X86_64_OPENVMM_LINUX_DIRECT_KERNEL = { value = ".packages/underhill-deps-private/x64/vmlinux", relative = true } |
| 47 | X86_64_OPENVMM_LINUX_DIRECT_INITRD = { value = ".packages/underhill-deps-private/x64/initrd", relative = true } |
| 48 | AARCH64_OPENVMM_LINUX_DIRECT_KERNEL = { value = ".packages/underhill-deps-private/aarch64/Image", relative = true } |
| 49 | AARCH64_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) |
| 52 | X86_64_OPENVMM_UEFI_FIRMWARE = { value = ".packages/hyperv.uefi.mscoreuefi.x64.RELEASE/MsvmX64/RELEASE_VS2022/FV/MSVM.fd", relative = true } |
| 53 | AARCH64_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"))'] |
| 56 | rustflags = [ |
| 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. |
| 68 | runner = "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] |
| 73 | linker = "build_support/underhill_cross/x86_64-underhill-musl-gcc" |
| 74 | [target.x86_64-underhill-linux-musl] |
| 75 | linker = "build_support/underhill_cross/x86_64-underhill-musl-gcc" |
| 76 | [target.aarch64-unknown-linux-musl] |
| 77 | linker = "build_support/underhill_cross/aarch64-underhill-musl-gcc" |
| 78 | [target.aarch64-underhill-linux-musl] |
| 79 | linker = "build_support/underhill_cross/aarch64-underhill-musl-gcc" |
| 80 | |
| 81 | [target.'cfg(target_arch = "aarch64")'] |
| 82 | rustflags = [ |
| 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")'] |
| 89 | rustflags = [ |
| 90 | # Use the musl from the sysroot, not from the Rust distribution. |
| 91 | "-Clink-self-contained=n", |
| 92 | # Use RELR relocation format, which is considerably smaller. |
| 93 | "-Clink-arg=-Wl,-z,pack-relative-relocs", |
| 94 | ] |
| 95 | |
| 96 | [target.'cfg(all(target_arch = "aarch64", target_env = "musl"))'] |
| 97 | rustflags = [ |
| 98 | # Avoid swapping in and out the hefty SVE state on Underhill/arm64. |
| 99 | # That is not enabled by default in the compiler at the moment, making |
| 100 | # this explicit. |
| 101 | "-Ctarget-feature=-sve,-sve2", |
| 102 | ] |
| 103 | |
| 104 | # Specify a common set of rustflags for all targets. |
| 105 | [target.'cfg(all())'] |
| 106 | rustflags = [ |
| 107 | # Disable FPO to get full call stack as the '--call-graph=dwarf' option |
| 108 | # is not working well. |
| 109 | "-Cforce-frame-pointers=yes", |
| 110 | |
| 111 | # Enable v0 symbols to get better output from `perf` and related tools. |
| 112 | "-Csymbol-mangling-version=v0", |
| 113 | |
| 114 | # Treat warnings as errors in CI. |
| 115 | ### ENABLE_IN_CI "-Dwarnings", |
| 116 | ] |
| 117 | |
| 118 | # Specify a common set of rustdocflags for all targets. |
| 119 | [build] |
| 120 | rustdocflags = [ |
| 121 | # Treat warnings as errors in CI. |
| 122 | ### ENABLE_IN_CI "-Dwarnings", |
| 123 | ] |
| 124 | |