Skip to content

LLVM 19.1.0 clang-cl x86 target, /fp:fast, acosf breaks link #109599

@Nick-Kooij

Description

@Nick-Kooij

The following program prints π and exits:

#include <cmath>
#include <cstdio>

int main( int argc, char** argv ) {
    printf( "%f\n", acosf( 0.0f ) * 2 );
    return 0;
}

Compiling the above single-module program with LLVM 19.1.0 through the clang-cl driver, targeting x86, with the fast math (/fp:fast) switch fails to link:

lld-link : error : undefined symbol: _acosf

Steps to reproduce:

  • Obtained LLVM-19.1.0-win64.exe from the official Assests.
  • Install on Windows 11 with Visual Studio 2022 17.11.4
  • Must build a x86 target
    • x64 targets link and run properly
  • Must use the /fp:fast fast math mode compiler switch

This issue was introduced with LLVM 19.1.0, and is not a result of changes to Visual Studio. Prior versions, such as LLVM 18.1.8, link properly, using the aforementioned version Visual Studio.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions