microsoft/openvmm
Publicmirrored fromhttps://github.com/microsoft/openvmmAvailable
.cargo/config.toml
134lines · 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 | # and tell symcrypt-sys exactly where to get symcrypt. |
| 27 | X86_64_UNDERHILL_LINUX_MUSL_SYMCRYPT_LIB_PATH = { value = ".packages/extracted/x86_64-sysroot/lib", relative = true } |
| 28 | X86_64_UNKNOWN_LINUX_MUSL_SYMCRYPT_LIB_PATH = { value = ".packages/extracted/x86_64-sysroot/lib", relative = true } |
| 29 | X86_64_UNDERHILL_LINUX_MUSL_SYMCRYPT_STATIC = "1" |
| 30 | X86_64_UNKNOWN_LINUX_MUSL_SYMCRYPT_STATIC = "1" |
| 31 | AARCH64_UNDERHILL_LINUX_MUSL_SYMCRYPT_LIB_PATH = { value = ".packages/extracted/aarch64-sysroot/lib", relative = true } |
| 32 | AARCH64_UNKNOWN_LINUX_MUSL_SYMCRYPT_LIB_PATH = { value = ".packages/extracted/aarch64-sysroot/lib", relative = true } |
| 33 | AARCH64_UNDERHILL_LINUX_MUSL_SYMCRYPT_STATIC = "1" |
| 34 | AARCH64_UNKNOWN_LINUX_MUSL_SYMCRYPT_STATIC = "1" |
| 35 | |
| 36 | # Tell cc-rs where the Underhill compilers are. |
| 37 | CC_aarch64_underhill_linux_musl = { value = "build_support/underhill_cross/aarch64-underhill-musl-gcc", relative = true } |
| 38 | CC_aarch64_unknown_linux_musl = { value = "build_support/underhill_cross/aarch64-underhill-musl-gcc", relative = true } |
| 39 | CC_x86_64_underhill_linux_musl = { value = "build_support/underhill_cross/x86_64-underhill-musl-gcc", relative = true } |
| 40 | CC_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 |
| 43 | PROTOC = { value = ".packages/Google.Protobuf.Tools/tools/protoc", relative = true } |
| 44 | |
| 45 | # Path to sysroot (used by build_support/underhill_cross) |
| 46 | X86_64_SYSROOT = { value = ".packages/extracted/x86_64-sysroot", relative = true } |
| 47 | AARCH64_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) |
| 52 | X86_64_OPENVMM_LINUX_DIRECT_KERNEL = { value = ".packages/underhill-deps-private/x64/vmlinux", relative = true } |
| 53 | X86_64_OPENVMM_LINUX_DIRECT_INITRD = { value = ".packages/underhill-deps-private/x64/initrd", relative = true } |
| 54 | AARCH64_OPENVMM_LINUX_DIRECT_KERNEL = { value = ".packages/underhill-deps-private/aarch64/Image", relative = true } |
| 55 | AARCH64_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) |
| 58 | X86_64_OPENVMM_UEFI_FIRMWARE = { value = ".packages/hyperv.uefi.mscoreuefi.x64.RELEASE/MsvmX64/RELEASE_VS2022/FV/MSVM.fd", relative = true } |
| 59 | AARCH64_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"))'] |
| 62 | rustflags = [ |
| 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. |
| 74 | runner = "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] |
| 79 | linker = "build_support/underhill_cross/x86_64-underhill-musl-gcc" |
| 80 | [target.x86_64-underhill-linux-musl] |
| 81 | linker = "build_support/underhill_cross/x86_64-underhill-musl-gcc" |
| 82 | [target.aarch64-unknown-linux-musl] |
| 83 | linker = "build_support/underhill_cross/aarch64-underhill-musl-gcc" |
| 84 | [target.aarch64-underhill-linux-musl] |
| 85 | linker = "build_support/underhill_cross/aarch64-underhill-musl-gcc" |
| 86 | |
| 87 | [target.'cfg(target_arch = "aarch64")'] |
| 88 | rustflags = [ |
| 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")'] |
| 95 | rustflags = [ |
| 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"))'] |
| 108 | rustflags = [ |
| 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())'] |
| 117 | rustflags = [ |
| 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] |
| 131 | rustdocflags = [ |
| 132 | # Treat warnings as errors in CI. |
| 133 | ### ENABLE_IN_CI "-Dwarnings", |
| 134 | ] |
| 135 | |