Bug#917000: rustc: Please include patch to fix incorrect fnctls on sparc64
On 12/21/18 10:48 AM, John Paul Adrian Glaubitz wrote: > The patch contains a bogus hunk at the bottom, cleaned up patch attached. And this time, I messed up the formatting. *sigh* Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `-GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 Description: Use correct fnctl constants for sparc64 Author: John Paul Adrian Glaubitz Bug: https://github.com/rust-lang/rust/issues/57007 Last-Update: 2018-12-21 Index: rustc-1.31.0+dfsg1/src/librustc_data_structures/flock.rs === --- rustc-1.31.0+dfsg1.orig/src/librustc_data_structures/flock.rs +++ rustc-1.31.0+dfsg1/src/librustc_data_structures/flock.rs @@ -42,11 +42,21 @@ cfg_if! { pub l_sysid: libc::c_int, } -pub const F_RDLCK: libc::c_short = 0; -pub const F_WRLCK: libc::c_short = 1; -pub const F_UNLCK: libc::c_short = 2; -pub const F_SETLK: libc::c_int = 6; -pub const F_SETLKW: libc::c_int = 7; +cfg_if! { +if #[cfg(target_arch = "sparc64")] { + pub const F_RDLCK: libc::c_short = 1; + pub const F_WRLCK: libc::c_short = 2; + pub const F_UNLCK: libc::c_short = 3; + pub const F_SETLK: libc::c_int = 8; + pub const F_SETLKW: libc::c_int = 9; +} else { + pub const F_RDLCK: libc::c_short = 0; + pub const F_WRLCK: libc::c_short = 1; + pub const F_UNLCK: libc::c_short = 2; + pub const F_SETLK: libc::c_int = 6; + pub const F_SETLKW: libc::c_int = 7; +} +} } #[cfg(target_os = "freebsd")]
Bug#917000: rustc: Please include patch to fix incorrect fnctls on sparc64
On 12/21/18 10:48 AM, John Paul Adrian Glaubitz wrote: > On 12/21/18 10:22 AM, John Paul Adrian Glaubitz wrote: >> The attached patch uses the correct fnctl constants for sparc64 to fix >> the problem. I haven't checked the other architectures but it may be >> worth to verify that the other non-x86 architectures are using the correct >> constansts as well. > > The patch contains a bogus hunk at the bottom, cleaned up patch attached. And the patch was still wrong. Attached a new one. Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `-GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 Description: Use correct fnctl constants for sparc64 Author: John Paul Adrian Glaubitz Bug: https://github.com/rust-lang/rust/issues/57007 Last-Update: 2018-12-21 Index: rustc-1.31.0+dfsg1/src/librustc_data_structures/flock.rs === --- rustc-1.31.0+dfsg1.orig/src/librustc_data_structures/flock.rs +++ rustc-1.31.0+dfsg1/src/librustc_data_structures/flock.rs @@ -42,11 +42,22 @@ cfg_if! { pub l_sysid: libc::c_int, } -pub const F_RDLCK: libc::c_short = 0; -pub const F_WRLCK: libc::c_short = 1; -pub const F_UNLCK: libc::c_short = 2; -pub const F_SETLK: libc::c_int = 6; -pub const F_SETLKW: libc::c_int = 7; + cfg_if! { + + if #[cfg(target_arch = "sparc64")] { + pub const F_RDLCK: libc::c_short = 1; + pub const F_WRLCK: libc::c_short = 2; +pub const F_UNLCK: libc::c_short = 3; +pub const F_SETLK: libc::c_int = 8; +pub const F_SETLKW: libc::c_int = 9; + } else { +pub const F_RDLCK: libc::c_short = 0; +pub const F_WRLCK: libc::c_short = 1; +pub const F_UNLCK: libc::c_short = 2; +pub const F_SETLK: libc::c_int = 6; +pub const F_SETLKW: libc::c_int = 7; +} +} } #[cfg(target_os = "freebsd")]
Bug#917000: rustc: Please include patch to fix incorrect fnctls on sparc64
On 12/21/18 10:22 AM, John Paul Adrian Glaubitz wrote: > The attached patch uses the correct fnctl constants for sparc64 to fix > the problem. I haven't checked the other architectures but it may be > worth to verify that the other non-x86 architectures are using the correct > constansts as well. The patch contains a bogus hunk at the bottom, cleaned up patch attached. Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `-GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 Description: Use correct fnctl constants for sparc64 Author: John Paul Adrian Glaubitz Bug: https://github.com/rust-lang/rust/issues/57007 Last-Update: 2018-12-21 --- rustc-1.31.0+dfsg1.orig/src/librustc_data_structures/flock.rs +++ rustc-1.31.0+dfsg1/src/librustc_data_structures/flock.rs @@ -42,11 +42,18 @@ cfg_if! { pub l_sysid: libc::c_int, } + #[cfg(target_arch = "sparc64")] +pub const F_RDLCK: libc::c_short = 1; +pub const F_WRLCK: libc::c_short = 2; +pub const F_UNLCK: libc::c_short = 3; +pub const F_SETLK: libc::c_int = 8; +pub const F_SETLKW: libc::c_int = 9; + #[cfg(not(target_arch = "sparc64"))] pub const F_RDLCK: libc::c_short = 0; pub const F_WRLCK: libc::c_short = 1; pub const F_UNLCK: libc::c_short = 2; pub const F_SETLK: libc::c_int = 6; pub const F_SETLKW: libc::c_int = 7; } #[cfg(target_os = "freebsd")]
Bug#917000: rustc: Please include patch to fix incorrect fnctls on sparc64
Source: rustc Version: 1.31.0+dfsg1-2 Severity: normal Tags: patch upstream User: debian-sp...@lists.debian.org Usertags: sparc64 Hello! The fnctl constants used by the file-locking API are hard-coded in the code instead of using the libc crate. This causes the compiler to emit the wrong fnctl for locking and in turn breaks incremental compilation [1]. The attached patch uses the correct fnctl constants for sparc64 to fix the problem. I haven't checked the other architectures but it may be worth to verify that the other non-x86 architectures are using the correct constansts as well. Once this patch has been integrated into the rustc Debian package, we can remove the workaround in cargo to disable incremental builds on sparc64. Note: I have not tested this patch yet, I am currently doing this but since the logic is simple and obvious, I have no doubt it will work correctly. I will report back later. Thanks, Adrian > [1] https://github.com/rust-lang/rust/issues/57007 -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `-GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 Description: Use correct fnctl constants for sparc64 Author: John Paul Adrian Glaubitz Bug: https://github.com/rust-lang/rust/issues/57007 Last-Update: 2018-12-21 --- rustc-1.31.0+dfsg1.orig/src/librustc_data_structures/flock.rs +++ rustc-1.31.0+dfsg1/src/librustc_data_structures/flock.rs @@ -42,11 +42,18 @@ cfg_if! { pub l_sysid: libc::c_int, } + #[cfg(target_arch = "sparc64")] +pub const F_RDLCK: libc::c_short = 1; +pub const F_WRLCK: libc::c_short = 2; +pub const F_UNLCK: libc::c_short = 3; +pub const F_SETLK: libc::c_int = 8; +pub const F_SETLKW: libc::c_int = 9; + #[cfg(not(target_arch = "sparc64"))] pub const F_RDLCK: libc::c_short = 0; pub const F_WRLCK: libc::c_short = 1; pub const F_UNLCK: libc::c_short = 2; pub const F_SETLK: libc::c_int = 6; -pub const F_SETLKW: libc::c_int = 7; +pub const F_SETLKW: libc::c_int = 7; } #[cfg(target_os = "freebsd")]