hermit-os / hermit-os/kernel

linker warning when building without `hermit-entry` feature

Open
#2,684 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.5k
Forks
132
Avg merge
1d 14h
Merged PRs (30d)
39

Description

In contrast to the last release `v0.13.2`, the current `main` branch (e.g. c7a6d42ac314f23bc38653e2e906c1b69daf24d4) can't be built (when disabling default features, e.g. to get rid of DHCP, as is done for the uhyve tests) in a form that can be passed to a bootloader or uhyve without supplying either the `loader` or `uhyve` feature to the `hermit` wrapper crate (which doesn't expose the `hermit-entry` feature).

The error this causes on omission looks e.g. like this:
```
Compiling uhyve-interface v0.3.0 (/home/fogti/devel/uhyve/uhyve-interface)
Compiling uhyve-test-kernels v0.1.0 (/home/fogti/devel/uhyve/tests/test-kernels)
warning: linker stderr: rust-lld: cannot find entry symbol _start; not setting start address
|
= note: `#[warn(linker_messages)]` on by default

warning: `uhyve-test-kernels` (bin "hello_world") generated 1 warning
warning: `uhyve-test-kernels` (bin "gdb") generated 1 warning (1 duplicate)
warning: `uhyve-test-kernels` (bin "panic") generated 1 warning (1 duplicate)
warning: `uhyve-test-kernels` (bin "env") generated 1 warning (1 duplicate)
warning: `uhyve-test-kernels` (bin "serial") generated 1 warning (1 duplicate)
warning: `uhyve-test-kernels` (bin "multi-thread") generated 1 warning (1 duplicate)
warning: `uhyve-test-kernels` (bin "network_test") generated 1 warning (1 duplicate)
warning: `uhyve-test-kernels` (bin "fs_tests") generated 1 warning (1 duplicate)
```

this is especially bad because the previous kernels can't be built with the `uhyve` feature because it didn't exist yet.

It might be a good idea to backport that, and create a "re-release" of the last kernel, but with dummy `uhyve` and `loader` features to make it easier to compare the next hermit kernel release with the previous one without having to constantly tweak the feature flags of the `hermit` crate.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the build of the uhyve test kernels with default features disabled and without the loader or uhyve features. Then inspect the hermit wrapper crate's feature definitions and compare main with v0.13.2, focusing on hermit-entry and the linker warning. Done means the relevant kernels can be passed to a bootloader or uhyve without the missing _start warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.