libm's use of _sse_hw is wrong and unnecessary (in that order)
libm looks at the _sse_hw symbol provided by libc to tell whether it is running on an i386 system capable of SSE.
Unfortunately, it's defined thusly
int _sse_hw = 0; #pragma weak _sse_hw
Notice how _sse_hw isn't extern, and that it has a value. This is going to screw up the logic later (which checks whether it's been bound), and generally it makes things really confused.
This is wrong.
It's weak because libm used to get shipped by devpro onto multiple releases (in its guise as libsunmath, or libmopt), and not all those releases wouldn't have that symbol in libc.
This is unnecessary.
It should just be a regular external reference to a private symbol, not weak, not defined, just extern.
Updated by Electric Monk over 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 80 to 100
commit f665a76fbe5ccb01d21f7917a7d764c98ed42344 Author: Richard Lowe <firstname.lastname@example.org> Date: 2015-02-26T19:19:36.000Z 5632 libm's use of _sse_hw is wrong and unnecessary (in that order) Reviewed by: Josef 'Jeff' Sipek <email@example.com> Reviewed by: Robert Mustacchi <firstname.lastname@example.org> Approved by: Gordon Ross <email@example.com>