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

__int128 is not available on all platforms #634

Closed
atsampson opened this issue Jan 28, 2023 · 3 comments · Fixed by #638
Closed

__int128 is not available on all platforms #634

atsampson opened this issue Jan 28, 2023 · 3 comments · Fixed by #638

Comments

@atsampson
Copy link
Contributor

Commit 1a0e13f ("Optimize csrand_uniform()") makes shadow unconditionally use GCC's __int128 extension type. However, this doesn't exist on all platforms - armv7, ia32 and m68k at least don't have it, so shadow now fails to build on those platforms:

csrand.c: In function 'csrand_uniform':
csrand.c:81:18: error: '__int128' is not supported on this target
@ikerexxe
Copy link
Collaborator

@alejandro-colomar can you take a look at this one? I think you already suggested a method to avoid this problem?

@alejandro-colomar
Copy link
Collaborator

Yup, I'll take it :)

alejandro-colomar added a commit to alejandro-colomar/shadow that referenced this issue Jan 30, 2023
__int128, which is needed for optimizing that part of the range, is not
always available.  We need the unoptimized version for portability
reasons.

Closes: <shadow-maint#634>
Fixes: 1a0e13f ("Optimize csrand_uniform()")
Reported-by: Adam Sampson <ats@offog.org>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
ikerexxe pushed a commit that referenced this issue Jan 30, 2023
__int128, which is needed for optimizing that part of the range, is not
always available.  We need the unoptimized version for portability
reasons.

Closes: <#634>
Fixes: 1a0e13f ("Optimize csrand_uniform()")
Reported-by: Adam Sampson <ats@offog.org>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
@atsampson
Copy link
Contributor Author

Great - that builds again on all my platforms. Thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants