Hi there!
I doing a little experiment writing FreeBSD kernel module with Rust. However, I'm stuck with a linking issue..
The project is inspired by https://github.com/tsgates/rust.ko so the approach is similar.
Method:
I build object files from rlibc, core and my simple rust hello world (which is called from the kernel module's c-code).
I have custom target json file, similar to rust.ko.
Problem:
When loading the module into the kernel I get error message:
__floatundisf undefined.
(kernel modules are linked with the command: ld -d -warn-common -r -d -o ${module}.ko ${obj_files}
)
However, if I link the same objects with a simple test executable using clang
, it works.
EDIT: Not really true, adding -nostdlib to clang and it reports same error as ld.
Linking the same executable with ld
and I get a bunch of undefines like
__floatxxx __mulxxxx __udivxxxx
and so on
I have soft-float
enabled and tried no-compile-rt
both true and false in the json..
I'd be grateful for any hints how to proceed..
EDIT:
As suspected, when adding -nostdlib flag, ld
and clang
behaves the same, reporting many undefines.
Post updated to reflect.