Repository navigation
PR: Linking failures #88 - #246
Merged
Merged
Conversation
rzezeski
force-pushed
the
opte-88-linker-failures
branch
from
August 30, 2022 17:25
2eaab0f to
b420211
Compare
The crux of the problem was that illumos-ddi-dki was exposing all symbols, all the time. This meant that even when compiled for the purposes of testing it was exposing kernel-only symbols, resulting in ld failing to find them. This was always a problem, but it wasn't exposed until rustc made it's "synthetic object" change: commit 773f533eae25129cea7241b74e54f26ce5eebb62 Author: Gary Guo <[email protected]> Date: Sat Apr 2 22:54:51 2022 +0100 Synthesis object file for `#[used]` and exported symbols This commit contains the following changes: - Update rust toolchain to nightly 2022-07-14. I tried using newer nightly but it resulted in compiler asserts. - Move all illumos-ddi-dki bits into ilumos-sys-hdrs. If you look at the illumos `uts/common/sys` headers, you'll see they contain the DDI types and API; so moving everything under one crate made more sense (and in fact my reason for separating them in the past was a naive attempt at trying to tease apart the types/symbols visible in userspace vs. those only in the kernel -- but clearly I failed at that). - Add a `kernel` feature to illumos-sys-hdrs. This feature enables the exposure of kernel-only types and symbols, and maps to the `_KERNEL` define found in illumos. With that in place it's a matter of wiring up the `kernel` feature in opte as well as xde, so that only the xde crate enables this feature, whereas running `cargo test` in opte should not enable it. - Update the various imports to map to `illumos_sys_hdrs` (that's the reason for the big churn in `ip.rs`, a purely mechanical change).
rzezeski
force-pushed
the
opte-88-linker-failures
branch
from
August 30, 2022 17:39
b420211 to
365cfd6
Compare
bnaecker
approved these changes
Aug 30, 2022
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.
The crux of the problem was that illumos-ddi-dki was exposing all
symbols, all the time. This meant that even when compiled for the
purposes of testing it was exposing kernel-only symbols, resulting in
ld failing to find them. This was always a problem, but it wasn't
exposed until rustc made it's "synthetic object" change:
commit 773f533eae25129cea7241b74e54f26ce5eebb62
Author: Gary Guo [email protected]
Date: Sat Apr 2 22:54:51 2022 +0100
This commit contains the following changes:
Update rust toolchain to nightly 2022-07-14. I tried using newer
nightly but it resulted in compiler asserts.
Move all illumos-ddi-dki bits into ilumos-sys-hdrs. If you look at
the illumos
uts/common/sysheaders, you'll see they contain theDDI types and API; so moving everything under one crate made more
sense (and in fact my reason for separating them in the past was a
naive attempt at trying to tease apart the types/symbols visible in
userspace vs. those only in the kernel -- but clearly I failed at
that).
Add a
kernelfeature to illumos-sys-hdrs. This feature enables theexposure of kernel-only types and symbols, and maps to the
_KERNELdefine found in illumos. With that in place it's a matter of wiring
up the
kernelfeature in opte as well as xde, so that only the xdecrate enables this feature, whereas running
cargo testin opteshould not enable it.
Update the various imports to map to
illumos_sys_hdrs(that's thereason for the big churn in
ip.rs, a purely mechanical change).