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

Comments

Projects
None yet
4 participants
@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 from stb_image.h doesn't compile on Fedora because of a missing intrisic to stb_image.h doesn't compile on Fedora because of a missing intrinsic Feb 11, 2017

@nothings

This comment has been minimized.

Show comment
Hide comment
@nothings

nothings Feb 11, 2017

Owner

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

Owner

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

@nothings nothings added the stb_image label Feb 11, 2017

@zao

This comment has been minimized.

Show comment
Hide comment
@zao

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

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

This comment has been minimized.

Show comment
Hide comment
@nothings

nothings Feb 12, 2017

Owner

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

Owner

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

This comment has been minimized.

Show comment
Hide comment
@ApoorvaJ

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

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

stb_image: Give up trying to runtime-detect SSE2 on GCC.
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 #280.
Fixes issue #410.
@rygorous

This comment has been minimized.

Show comment
Hide comment
@rygorous

rygorous Jun 28, 2017

Collaborator

Should be fixed now.

Collaborator

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