Open
Description
Hi,
I'm creating a UEFI application on ARM64. My target .json file is as follows and it works well for a simple hello_world application.
{
"llvm-target": "aarch64-pc-windows-msvc",
"target-endian": "little",
"target-pointer-width": "64",
"target-c-int-width": "32",
"os": "uefi",
"arch": "aarch64",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"linker": "rust-lld",
"linker-flavor": "lld-link",
"pre-link-args": {
"lld-link": [
"/Subsystem:EFI_Application",
"/Entry:wenqiu_entry",
"/Machine:arm64"
]
},
"panic-strategy": "abort",
"default-hidden-visibility": true,
"executables": true,
"exe-suffix": ".efi",
"is-like-windows": true,
"emit-debug-gdb-scripts": false,
}
However, when I create a static Once object
pub static MY_OBJECT: Once<MutexIrqSafe<MyStruct>> = Once::new();
and initialize it with
MY_OBJECT.call_once(|| {MutexIrqSafe::new( myobj ) });
,
an error occurs
note: rust-lld: error: undefined symbol: __chkstk
I found this link #56913 and it says this error is caused by a large local variable. According to the corresponding commitment 0b00db, I add
"stack_probes": true,
in the target.json file, but the problem is still there. The toolchain I use is nightly-2019-01-02.
Does anyone know how to solve the problem?