New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 45034 - Code compiled with -Ofast fails to find math symbols. (eg `__expf_finite')
Summary: Code compiled with -Ofast fails to find math symbols. (eg `__expf_finite')
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: 9.0
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks: release-10.0.0
  Show dependency tree
 
Reported: 2020-02-26 10:12 PST by Nick
Modified: 2020-02-28 07:02 PST (History)
10 users (show)

See Also:
Fixed By Commit(s): 6d15c4deab51498b70825fb6cefbbfe8f3d9bdcf


Attachments
simple testcase. (113 bytes, text/x-c++src)
2020-02-26 10:12 PST, Nick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick 2020-02-26 10:12:40 PST
Created attachment 23175 [details]
simple testcase.

Hey,

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

https://github.com/cms-sw/cmssw/issues/24935
https://github.com/dpiparo/vdt/issues/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
Comment 1 Eli Friedman 2020-02-26 10:15:30 PST
Yes, probably the same thing.

If it's starting to break code already, probably should be a release blocker.
Comment 2 Hans Wennborg 2020-02-27 04:06:25 PST
Since it's not really an llvm regression, but a glibc change, I'm not sure I want to block on this. It may have to wait until 10.0.1...
Comment 3 sguelton 2020-02-27 06:11:45 PST
https://reviews.llvm.org/D74712 fixes the issue.
Comment 4 sguelton 2020-02-28 01:14:28 PST
Fixed by 6d15c4deab51498b70825fb6cefbbfe8f3d9bdcf
Comment 5 Hans Wennborg 2020-02-28 03:02:50 PST
(In reply to sguelton from comment #4)
> Fixed by 6d15c4deab51498b70825fb6cefbbfe8f3d9bdcf

And pushed to 10.x as cd0926d087a85c5ee1222ca80980b4440214a822. Please let me know if there are any follow-ups.
Comment 6 Nick 2020-02-28 06:29:23 PST
(In reply to Hans Wennborg from comment #5)
> (In reply to sguelton from comment #4)
> > Fixed by 6d15c4deab51498b70825fb6cefbbfe8f3d9bdcf
> 
> And pushed to 10.x as cd0926d087a85c5ee1222ca80980b4440214a822. Please let
> me know if there are any follow-ups.


Is this going to be backported to the older point releases?

Cheers,

Nick
Comment 7 Hans Wennborg 2020-02-28 06:49:59 PST
(In reply to Nick from comment #6)
> (In reply to Hans Wennborg from comment #5)
> > (In reply to sguelton from comment #4)
> > > Fixed by 6d15c4deab51498b70825fb6cefbbfe8f3d9bdcf
> > 
> > And pushed to 10.x as cd0926d087a85c5ee1222ca80980b4440214a822. Please let
> > me know if there are any follow-ups.
> 
> 
> Is this going to be backported to the older point releases?

That's a question for Tom if he wants to consider it, but in general I don't think there are any more point releases planned for 9.x and before.
Comment 8 Tom Stellard 2020-02-28 07:02:21 PST
(In reply to Nick from comment #6)
> (In reply to Hans Wennborg from comment #5)
> > (In reply to sguelton from comment #4)
> > > Fixed by 6d15c4deab51498b70825fb6cefbbfe8f3d9bdcf
> > 
> > And pushed to 10.x as cd0926d087a85c5ee1222ca80980b4440214a822. Please let
> > me know if there are any follow-ups.
> 
> 
> Is this going to be backported to the older point releases?
> 

No, we aren't planning any more 9.x releases.

-Tom

> Cheers,
> 
> Nick