nothings / stb

stb single-file public domain libraries for C/C++

Home Page:https://twitter.com/nothings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stb_image.h doesn't compile on Fedora because of a missing intrinsic

ApoorvaJ opened this issue · comments

While compiling stb_image's implementation on Fedora, the compiler cannot find the __builtin_cpu_supports intrinsic and gives a compilation error in the function stbi__sse2_available(). The workaround to this is to just remove the intrinsic call and return a 0.

Unfortunately, I won't be able to tell you the exact version of Fedora or gcc or libc, since the machine isn't available to me any more. I was compiling in 64 bit mode.

This is potentially related to issue #280.

That's gonna be pretty impossible to do anything about without more info. I mean, it's good to let us know and maybe somebody else can duplicate it, but until then...

As a bit of ancillary information gathering, the problem with shared libraries built with g++ vs. gcc described in #280 exists on Fedora 25, gcc version 6.3.1 20161221 (Red Hat 6.3.1-1) (GCC).
I didn't manage to break builds involving stb_image.h implementation in any other way.

#280 describes how to fix it by adding to the link line. The bug here is a compile-time bug which has no known workaround. So if the issue you describe is fixable with the link option in #280, it belongs there not here.

Yes, this issue was a compiler error, not a linker error. Sorry for all the vagueness. I only had access to the machine for a very small time period. Mainly logged the bug for posterity.

Should be fixed now.