Merged
Conversation
On powerpc some symbols end up in the initialized data section, which means they aren't detected by the logic in cmd_export, leading to errors such as: ERROR: modpost: "_RNvNtCsbDqzXfLQacH_6kernel12module_param15PARAM_OPS_USIZE" [drivers/char/rust_example_4.ko] undefined! nm represents the "initialized data section" with "D", so also look for that when exporting symbols. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
powerpc kernel code uses int-ll64.h. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Based on the x86 and arm64 versions, as well as output from: $ rustc +nightly -Z unstable-options --target=powerpc64le-unknown-linux-gnu --print target-spec-json Notably disables altivec, vsx and hard-float. The very cryptic data-layout: "data-layout": "e-m:e-i64:64-n32:64-S128", Has the following meaning: e: little endian m:e ELF name mangling i64:64 64-bit integers 64-bit aligned n32:64 Native integer widths, 32-bit and 64-bit. S128 16-byte stack alignment Those all come from the rustc output, with the exception of the stack alignment. We obviously do have 8-bit & 16-bit integer types, but I'm not sure if there's any need to specify that. ppc64le only for now. We'll eventually need to come up with some way to change the target.json that's used based on more than just $(ARCH). Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
All the pieces are in place now for us to enable building rust support on ppc64le. Only works with clang for now. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
For now only using clang.
Adds -vga none to the qemu command for all targets. But AFAICS that's
safe as both x86 and arm use serial consoles already.
Uses RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C, not RUST_OPT_LEVEL_0 like
other configs. In order to avoid crashes like:
Rust Example (init)
Am I built-in? true
Parameters:
my_bool: true
my_i32: 123321
my_str: 🦀mod
my_usize: 42
my_array: [0, 1]
Value: 10
Value: 10
Large array has length: 514
Kernel panic - not syncing: corrupted stack end detected inside scheduler
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.12.0-rc3+ #1
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Member
|
Oh, I was working on this in parallel on top of your patches. Let me try to compare... |
ojeda
reviewed
Mar 31, 2021
Member
I quickly tested, and level 1 also fails. |
Member
|
Since you took the time to send the PR with added CI, let's merge it and I can send my bits on top! :-) |
ojeda
approved these changes
Mar 31, 2021
Author
Oops sorry, I figured you were busy with other things. Thanks for merging it 👍 |
Member
|
No, thanks to you for the work! :-) In case GitHub does not notify you on mentions: my bits are in #156, can you please take a look? Thanks in advance! |
Open
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.
Here's a pull request with the ppc64le support. Now with CI wired up too.