-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[loongarch*-linux] -Crelocation-model=static
should not access external data directly
#118053
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@rustbot label O-loongarch |
This is the same issue as llvm/llvm-project#71645. For the linux kernel, we need to access external data directly when the relocation model is static to avoid GOT. It would better to add the |
From https://doc.rust-lang.org/rustc/codegen-options/index.html:
So in the kernel it just should not be used for arch/loongarch: at least when CONFIG_RELOCATABLE=y we expect vmlinux to be a PIE, so non-relocatable code should not be allowed. arch/um already has:
Can we have the same? |
Oops, it will create GOT in vmlinux because we don't have |
Another issue is we don't have a differentiate between KBUILD_RUSTFLAGS_MODULE and KBUILD_RUSTFLAGS_KERNEL yet. With either |
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Makefile?h=next-20231120#n568 |
Updated: heiher/linux@a590c2f#diff-0e1f2cb4db0de17a95f13ee71d503167892fb028b00507977fcf9568066b33ecR88 |
In clang, Update: Function doesn't support direct access in PIE mode. |
…, r=petrochenkov Add unstable `-Z direct-access-external-data` cmdline flag for `rustc` The new flag has been described in the Major Change Proposal at rust-lang/compiler-team#707 Fixes rust-lang#118053
…, r=petrochenkov Add unstable `-Z direct-access-external-data` cmdline flag for `rustc` The new flag has been described in the Major Change Proposal at rust-lang/compiler-team#707 Fixes rust-lang#118053
Rollup merge of rust-lang#119162 - heiher:direct-access-external-data, r=petrochenkov Add unstable `-Z direct-access-external-data` cmdline flag for `rustc` The new flag has been described in the Major Change Proposal at rust-lang/compiler-team#707 Fixes rust-lang#118053
…sl,ohos} In issue rust-lang#118053, the `loongarch64-unknown-linux-gnu` target needs indirection to access external data, and so do the `loongarch64-unknown-linux-musl` and `loongarch64-unknown-linux-ohos` targets.
…sl,ohos} In issue rust-lang#118053, the `loongarch64-unknown-linux-gnu` target needs indirection to access external data, and so do the `loongarch64-unknown-linux-musl` and `loongarch64-unknown-linux-ohos` targets.
Setting up indirect access to external data for loongarch64-linux-{musl,ohos} In issue rust-lang#118053, the `loongarch64-unknown-linux-gnu` target needs indirection to access external data, and so do the `loongarch64-unknown-linux-musl` and `loongarch64-unknown-linux-ohos` targets.
Rollup merge of rust-lang#131583 - heiher:loong-issue-118053, r=jieyouxu Setting up indirect access to external data for loongarch64-linux-{musl,ohos} In issue rust-lang#118053, the `loongarch64-unknown-linux-gnu` target needs indirection to access external data, and so do the `loongarch64-unknown-linux-musl` and `loongarch64-unknown-linux-ohos` targets.
I tried this code:
I expected to see the environments variables printed.
Instead, this happened:
Aborted (core dumped)
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: