Description
Zig Version
0.15.0-dev.767+201c0f54a
Steps to Reproduce and Observed Behavior
When compiling a uefi application with hardware floats in the target (generally not ideal practice but still shouldnt error), the following error is returned: error: lld-link: undefined symbol: _fltused
. This is intended llvm behavior, and arises due to the use of floats in compiler_rt
: https://discourse.llvm.org/t/lld-link-fails-to-link-uefi-binary-because-of-undefined-symbol-fltused/52454
The underlying issue is that uefi is fundamentally a windows-like target, and uefi uses the value of the _fltused symbol to trigger enabling hardware floats and the floating point environment in general, similar to how it is used on windows (for which a conditional export in compiler_rt already exists).
(With softfloats in use, no reference is made to the symbol as hardware float initialization is not required, and ideally no export should be made when softfloats are on.)
Expected Behavior
Compilation to succeed