Code: Select all
println!("{:?}", "abc" == "abc");
Code: Select all
false
Code: Select all
println!("{:?}", "abc" == "abc");
Code: Select all
false
Code: Select all
println!("{:?}", "abc" == "abc");
Code: Select all
false
Code: Select all
true
It wouldn't link without 'memcpy', 'memcmp' or 'memset'. These have to be provided. Even 'core' crate documentation mentions it. It may be that if I used 'cargo' to somehow build my kernel, these could be provided by LLVM but I am doing this with Makefiles. First, I compile my kernel as static (.a) library and then link it with my multiboot startup code and few extra object files.Ethin wrote: I'm not sure how your doing things, but you should not need to write implementations of memcmp, memmove or anything else like that. The Rust core library already defines these and the compiler should be automatically generating calls to them.
Code: Select all
{
"llvm-target": "x86_64-kernel-none",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"target-endian": "little",
"target-pointer-width": "64",
"target-c-int-width": "32",
"os": "none",
"executables": true,
"linker-flavor": "ld.lld",
"linker": "rust-lld",
"panic-strategy": "abort",
"disable-redzone": true,
"features": "-mmx,-sse,+soft-float"
}
Code: Select all
{
"llvm-target": "x86_64-unknown-none-gnu",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"linker-flavor": "ld.lld",
"linker": "rust-lld",
"pre-link-args": {
"ld.lld": [
"--script=linker.ld"
]
},
"target-endian": "little",
"target-pointer-width": "64",
"target-c-int-width": "32",
"arch": "x86_64",
"os": "none",
"features": "-mmx,-sse,+soft-float",
"disable-redzone": true,
"panic-strategy": "abort",
"executables": true,
"relocation_model": "static"
}
Code: Select all
[unstable]
build-std = ["core", "compiler_builtins", "alloc"]
[build]
# Replace this target string with your custom JSON file
target = "x86_64-kernel-none.json"