Recent nightlies give the following linker error when trying to compile with the x86_64-unknown-uefi target:
error: linking with `rust-lld` failed: exit code: 1
|
= note: "rust-lld" "-flavor" "link" "/NOLOGO" "/NXCOMPAT" "/nodefaultlib" "/entry:efi_main" "/subsystem:efi_applic
ation" "/LIBPATH:/home/isaac/Documents/pebble/bootloader/target/sysroot/lib/rustlib/x86_64-unknown-uefi/lib" "/home/
isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/bootloader-cb388c983ab7c215.bootloader.17p
m2976-cgu.0.rcgu.o" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/bootloader-cb38
8c983ab7c215.bootloader.17pm2976-cgu.1.rcgu.o" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/r
elease/deps/bootloader-cb388c983ab7c215.bootloader.17pm2976-cgu.10.rcgu.o" "/home/isaac/Documents/pebble/bootloader/
target/x86_64-unknown-uefi/release/deps/bootloader-cb388c983ab7c215.bootloader.17pm2976-cgu.11.rcgu.o" "/home/isaac/
Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/bootloader-cb388c983ab7c215.bootloader.17pm2976-
cgu.12.rcgu.o" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/bootloader-cb388c983
ab7c215.bootloader.17pm2976-cgu.13.rcgu.o" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/relea
se/deps/bootloader-cb388c983ab7c215.bootloader.17pm2976-cgu.14.rcgu.o" "/home/isaac/Documents/pebble/bootloader/targ
et/x86_64-unknown-uefi/release/deps/bootloader-cb388c983ab7c215.bootloader.17pm2976-cgu.15.rcgu.o" "/home/isaac/Docu
ments/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/bootloader-cb388c983ab7c215.bootloader.17pm2976-cgu.
2.rcgu.o" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/bootloader-cb388c983ab7c2
15.bootloader.17pm2976-cgu.3.rcgu.o" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/dep
s/bootloader-cb388c983ab7c215.bootloader.17pm2976-cgu.4.rcgu.o" "/home/isaac/Documents/pebble/bootloader/target/x86_
64-unknown-uefi/release/deps/bootloader-cb388c983ab7c215.bootloader.17pm2976-cgu.5.rcgu.o" "/home/isaac/Documents/pe
bble/bootloader/target/x86_64-unknown-uefi/release/deps/bootloader-cb388c983ab7c215.bootloader.17pm2976-cgu.6.rcgu.o
" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/bootloader-cb388c983ab7c215.bootl
oader.17pm2976-cgu.7.rcgu.o" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/bootlo
ader-cb388c983ab7c215.bootloader.17pm2976-cgu.8.rcgu.o" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unkno
wn-uefi/release/deps/bootloader-cb388c983ab7c215.bootloader.17pm2976-cgu.9.rcgu.o" "/OUT:/home/isaac/Documents/pebbl
e/bootloader/target/x86_64-unknown-uefi/release/deps/bootloader-cb388c983ab7c215.efi" "/OPT:REF,ICF" "/DEBUG" "/LIBP
ATH:/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps" "/LIBPATH:/home/isaac/Documents
/pebble/bootloader/target/release/deps" "/LIBPATH:/home/isaac/Documents/pebble/bootloader/target/sysroot/lib/rustlib
/x86_64-unknown-uefi/lib" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/libx86_64
-e73f78284a1860d7.rlib" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/libbitflags
-094ae181fdaa32fd.rlib" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/libmer-507c
9f2f8b4d808b.rlib" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/libscroll-363628
fffd45fc02.rlib" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/libbit_field-0de0b
ae1c29c3197.rlib" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/liblog-7dddffb9af
6bf12e.rlib" "/home/isaac/Documents/pebble/bootloader/target/x86_64-unknown-uefi/release/deps/libcfg_if-6874da1a7a9e
b04a.rlib" "/home/isaac/Documents/pebble/bootloader/target/sysroot/lib/rustlib/x86_64-unknown-uefi/lib/librustc_std_
workspace_core-34dfaa25be8aa12b.rlib" "/home/isaac/Documents/pebble/bootloader/target/sysroot/lib/rustlib/x86_64-unk
nown-uefi/lib/libcore-6847ba0a79455c40.rlib" "/home/isaac/Documents/pebble/bootloader/target/sysroot/lib/rustlib/x86
_64-unknown-uefi/lib/libcompiler_builtins-0eac2e6da53df529.rlib"
= note: rust-lld: error: undefined symbol: _fltused
>>> referenced by libcore-6847ba0a79455c40.rlib(core-6847ba0a79455c40.core.e2k58cht-cgu.12.rcgu.o)
>>> referenced by libcore-6847ba0a79455c40.rlib(core-6847ba0a79455c40.core.e2k58cht-cgu.15.rcgu.o)
>>> referenced by libcore-6847ba0a79455c40.rlib(core-6847ba0a79455c40.core.e2k58cht-cgu.5.rcgu.o)
>>> referenced by libcore-6847ba0a79455c40.rlib(core-6847ba0a79455c40.core.e2k58cht-cgu.6.rcgu.o)
>>> referenced by libcore-6847ba0a79455c40.rlib(core-6847ba0a79455c40.core.e2k58cht-cgu.3.rcgu.o)
>>> referenced by libcore-6847ba0a79455c40.rlib(core-6847ba0a79455c40.core.e2k58cht-cgu.10.rcgu.o)
>>> referenced by libcompiler_builtins-0eac2e6da53df529.rlib(compiler_builtins-0eac2e6da53df529.compiler_b
uiltins.6cufwy9q-cgu.0.rcgu.o)
My guess at likely causes is this commit to compiler-builtins. The project itself does not use any floating-point operations so I'm surprised that any code that refers to this symbol is included in the final executable.
I'm not sure what the best fix for this would be (assuming this isn't intended behaviour), but adding this somewhere in the project works in the meantime:
#[used]
#[no_mangle]
pub static _fltused: i32 = 0;
Recent nightlies give the following linker error when trying to compile with the
x86_64-unknown-uefitarget:My guess at likely causes is this commit to
compiler-builtins. The project itself does not use any floating-point operations so I'm surprised that any code that refers to this symbol is included in the final executable.I'm not sure what the best fix for this would be (assuming this isn't intended behaviour), but adding this somewhere in the project works in the meantime: