Skip to content

PR: Linking failures #88 - #246

Merged
rzezeski merged 1 commit into
masterfrom
opte-88-linker-failures
Aug 30, 2022
Merged

rzezeski merged 1 commit into
masterfrom
opte-88-linker-failures

Conversation

@rzezeski

Copy link
Copy Markdown
Contributor

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
rzezeski requested a review from bnaecker August 30, 2022 17:14
@rzezeski
rzezeski force-pushed the opte-88-linker-failures branch from 2eaab0f to b420211 Compare August 30, 2022 17:25
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
rzezeski merged commit 365cfd6 into master Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants