Skip to content

Code compiled with -Ofast fails to find math symbols. (eg `__expf_finite') #44379

@XapaJIaMnu

Description

@XapaJIaMnu
Bugzilla Link 45034
Resolution FIXED
Resolved on Feb 28, 2020 07:02
Version 9.0
OS Linux
Blocks #43900
Attachments simple testcase.
CC @DougGregor,@efriedma-quic,@zmodem,@zygoloid,@serge-sans-paille,@tstellar
Fixed by commit(s) 6d15c4d

Extended Description

Hey,

After some recent changes, various projects fail to compile with clang when using -Ofast ( or -O2 -ffast-math ). Example bugs from the web:

cms-sw/cmssw#24935
dpiparo/vdt#11

https://bugs.archlinux.org/task/65541

I have attached a sample file that triggers the bug, taken from the Arch bugtracker:

clang++ bug.cpp works
clang++ bug.cpp -Ofast fails with:

/usr/bin/ld: /tmp/bug-6a1f7c.o: in function main': bug.cpp:(.text+0xd): undefined reference to __expf_finite'
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

According to the arch user, this is likely related to https://reviews.llvm.org/D74712

Cheers,

Nick

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions