[llvm-dev] lld-link fails to link uefi binary because of undefined symbol _fltused

Shi, Steven via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 5 06:12:32 PDT 2019


Hi Rui, Peter,
We meet a problem to use lld-link to generate uefi binary. It is related to the lld-link force to use float point lib symbol: _fltused. Uefi binary doesn't use any external float point lib and we don't know how to tell lld-link not to emit the float point lib symbol. Below is a simplified example to reproduce this issue. Please give me some advice. Thanks!


$ cat main.c
double v=0;
void mainfunction(){
    v+=1;
}
$ ~/llvm-project/releaseinstall/bin/clang -c -Oz -flto -target x86_64-unknown-windows main.c -o main.ir
$ ~/llvm-project/releaseinstall/bin/lld-link /machine:X64 /DLL /ENTRY:mainfunction main.ir /OUT:main.dll
lld-link: error: undefined symbol: _fltused
>>> referenced by lto.tmp

Thanks
Steven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190705/7f4d9e35/attachment.html>


More information about the llvm-dev mailing list