Fix cross-compilation of build.rs for aarch64 target#607
Open
aford173 wants to merge 1 commit intocontainers:mainfrom
Open
Fix cross-compilation of build.rs for aarch64 target#607aford173 wants to merge 1 commit intocontainers:mainfrom
aford173 wants to merge 1 commit intocontainers:mainfrom
Conversation
Collaborator
|
@aford173 thanks for the PR! please sign the commit to satisfy the DCO test. |
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>
ca4cf4c to
0275772
Compare
Author
|
@slp - Sorry about that. It should be updated now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_PATHnot 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.