-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Untitled #289
Merged
Merged
Untitled #289
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
floats. However, if someone writes a literal that can't be represented precisely in 64 bits, the front-end will accept it while the back-end will (presumably) complain.
Integrated |
oli-obk
pushed a commit
to oli-obk/rust
that referenced
this pull request
Sep 19, 2017
Update for Rust nightly
keeperofdakeys
pushed a commit
to keeperofdakeys/rust
that referenced
this pull request
Dec 12, 2017
…xcrichton Fix ioctl constants for musl target envs. Heya! I ran across this issue today while trying to build a portable static binary using the `x86_64-unknown-linux-musl` target. Took a bit of digging to make sure I understood what was going on, and while I may still be off the mark, I believe this is a fix to my issue. Thanks!! ---- According to musl's source, the `ioctl` [function signature][musl-ioctl-h] takes an `int` as the request argument (i.e. an `i32`) which is reflected in this crate's [ioctl binding][musl-ioctl-rs]. It looks like when the ioctl constants were added that [glibc's default][glibc-ioctl-h] of a `c_ulong` type was used for the musl values as well, rather than a `c_int` type. This change updates these constants to a `c_int` so that they match the expected function call type. Here is a minimal reproduction of the issue. Given this Rust program: ```rust extern crate libc; use libc::{ioctl, winsize, STDOUT_FILENO, TIOCGWINSZ}; fn main() { let mut wsize = winsize { ws_row: 0, ws_col: 0, ws_xpixel: 0, ws_ypixel: 0, }; unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); } println!("Sizes: {{ rows: {}, cols: {}, xpixel: {}, ypixel: {} }}", wsize.ws_row, wsize.ws_col, wsize.ws_xpixel, wsize.ws_ypixel); } ``` When run against the `x86_64-unknwon-linux-gnu` and `x86_64-unknown-linux-musl` targets, we see the difference in behavior: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) src/main.rs:13:30: 13:40 error: mismatched types: expected `i32`, found `u64` [E0308] src/main.rs:13 ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); ^~~~~~~~~~ src/main.rs:13:30: 13:40 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error Could not compile `libc-musl-ioctl`. To learn more, run the command again with --verbose. ``` Working against this fix: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Updating git repository `https://github.com/fnichol/rust-lang-libc.git` Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-musl/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } ``` [musl-ioctl-rs]: https://doc.rust-lang.org/libc/x86_64-unknown-linux-musl/libc/fn.ioctl.html [musl-ioctl-h]: https://git.musl-libc.org/cgit/musl/tree/include/sys/ioctl.h [glibc-ioctl-h]: http://bazaar.launchpad.net/~vcs-imports/glibc/master/view/head:/include/sys/ioctl.h
keeperofdakeys
pushed a commit
to keeperofdakeys/rust
that referenced
this pull request
Dec 12, 2017
Fix ioctl types for non-x86 musl This fixes up rust-lang#289 by changing the type for other platforms as well.
kazcw
pushed a commit
to kazcw/rust
that referenced
this pull request
Oct 23, 2018
This commit provides insurance that intrinsics are only introduced with known canonical types (`__m128i` and such) instead of also allowing `u8x16` for example.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.