-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add NR_GETRANDOM syscall numbers #111
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
Conversation
Pulled directly from src/libstd/rand/os.rs in the main rust repo. We can delete them from there once this commit is added in rust's liblibc submodule.
@alexcrichton What am I misunderstanding? I can't tell why the Linux builds are failing with NR_GETRANDOM undefined, despite the fact that they have supported architectures. |
The testsuite searchs for So you need either use the proper name (and change rustc calls after that) or define exceptions in |
NR_GETRANDOM should be |
I'll probably commit that to make sure it passes the build. However, I think @alexcrichton should confirm that that weird mixed-case naming scheme is acceptable here. I don't see it elsewhere in liblibc, so (as someone mentioned on IRC) it may be preferable to make an alias. |
This way it matches the #define in the system header sys/syscall.h, which allows liblibc's test code to verify its value. We may make an alias if people find this naming scheme too ugly or irregular.
Only one nightly build on Linux - ARM, specifically - succeeded. And now, I remember that So, we can either leave things the way they are and wait for the API to mature, or we can add an exception to make liblibc take these values on faith. |
Thanks @mmcco! Could this also split out the definitions into appropriate files instead of using |
Does anyone want to adopt this? The complexity of adding the definitions to libc compared with the current solution, combined with the fact that I'm not much of a Linux person, makes me lean toward leaving things as-is. |
@kamalmarhubi Sounds good to me. Thanks! |
☔ The latest upstream changes (presumably #246) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing due to inactivity, but feel free to resubmit with comments addressed! |
* Add _mm_cmp*_ps variant (SSE) * Add _mm_comi{eq,lt,le,gt,ge,neq}_ss instructions (sse) * Add _mm_ucomi*_ss instructions SSE They all compile down to the same x86 instruction, UCOMISS, whereas the _mm_comi*_ss instructions compile down to COMISS. The outputs of both sets of instructions are exactly the same. The only difference is in exception handling. I therefore added a single test case which tests their different effect on the MXCSR register (_mm_getcsr) of _mm_comieq_ss vs. _mm_ucomieq_ss. Together with the tests about emitting the right instruction, no tests further tests are needed for the other variants. * Avoid constant-folding test case
Pulled directly from src/libstd/rand/os.rs in the main rust repo. We can
delete them from there once this commit is added in rust's liblibc
submodule.