Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ApoorvaJ opened this issue Feb 11, 2017 · 5 comments
Closed

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

ApoorvaJ opened this issue Feb 11, 2017 · 5 comments
Labels

Comments

@ApoorvaJ
Copy link

@ApoorvaJ ApoorvaJ commented Feb 11, 2017

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.

@ApoorvaJ ApoorvaJ changed the title stb_image.h doesn't compile on Fedora because of a missing intrisic stb_image.h doesn't compile on Fedora because of a missing intrinsic Feb 11, 2017
@nothings
Copy link
Owner

@nothings nothings commented Feb 11, 2017

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...

@zao
Copy link

@zao zao commented Feb 12, 2017

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.

@nothings
Copy link
Owner

@nothings nothings commented Feb 12, 2017

#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.

@ApoorvaJ
Copy link
Author

@ApoorvaJ ApoorvaJ commented Feb 12, 2017

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.

rygorous added a commit to rygorous/stb that referenced this issue Mar 5, 2017
We tried but it was nothing but trouble. New rule: with
GCC/Clang, if you're compiling with -msse2, you get always-on
SSE2 code, otherwise you don't get any. Trying to ship
anything with proper runtime dispatch requires both working
around certain bugs and some fiddling with build settings,
which runs contrary to the intent of a one-file library,
so bail on it entirely.

Fixes issue nothings#280.
Fixes issue nothings#410.
@rygorous
Copy link
Collaborator

@rygorous rygorous commented Jun 28, 2017

Should be fixed now.

@rygorous rygorous closed this Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.