Commit 7c5292c
Fix cross-compilation of build.rs for aarch64 target
Build scripts may run on the host architecture, not the target. When
cross-compiling from x86_64 to aarch64, #[cfg(target_arch = "aarch64")]
evaluates to false in the build script, causing KRUN_EDK2_BINARY_PATH
to not be set at compile time:
error: environment variable `KRUN_EDK2_BINARY_PATH` not defined at compile time
--> src/vmm/src/builder.rs:104:44
|
104 | static EDK2_BINARY: &[u8] = include_bytes!(env!("KRUN_EDK2_BINARY_PATH"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use CARGO_CFG_TARGET_ARCH environment variable instead, which reflects
the actual target architecture regardless of the host.
Signed-off-by: Adam Ford <adam.ford@anodize.com>1 parent 3fc7d1c commit 7c5292c
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
0 commit comments