]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #30776 - antonblanchard:powerpc64_merge, r=alexcrichton
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 15 Jan 2016 11:58:28 +0000 (17:28 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Fri, 15 Jan 2016 11:58:28 +0000 (17:28 +0530)
This adds support for big endian and little endian PowerPC64.
make check runs clean apart from one big endian backtrace issue.

1  2 
src/doc/reference.md
src/libstd/rand/os.rs

diff --combined src/doc/reference.md
index 87104b4526f72b670ec916aec08ce7c6627dc57b,fad1ce591849bd66c5226b913e6fe9d2cb9d0fb3..b786b59ec986de641ccd7b88d89d7a6ed1ad69b9
@@@ -2044,7 -2044,7 +2044,7 @@@ The following configurations must be de
    production.  For example, it controls the behavior of the standard library's
    `debug_assert!` macro.
  * `target_arch = "..."` - Target CPU architecture, such as `"x86"`, `"x86_64"`
-   `"mips"`, `"powerpc"`, `"arm"`, or `"aarch64"`.
+   `"mips"`, `"powerpc"`, `"powerpc64"`, `"powerpc64le"`, `"arm"`, or `"aarch64"`.
  * `target_endian = "..."` - Endianness of the target CPU, either `"little"` or
    `"big"`.
  * `target_env = ".."` - An option provided by the compiler by default
@@@ -3677,10 -3677,10 +3677,10 @@@ sites are
  
  * `let` statements where an explicit type is given.
  
 -   For example, `128` is coerced to have type `i8` in the following:
 +   For example, `42` is coerced to have type `i8` in the following:
  
     ```rust
 -   let _: i8 = 128;
 +   let _: i8 = 42;
     ```
  
  * `static` and `const` statements (similar to `let` statements).
    The value being coerced is the actual parameter, and it is coerced to
    the type of the formal parameter.
  
 -  For example, `128` is coerced to have type `i8` in the following:
 +  For example, `42` is coerced to have type `i8` in the following:
  
    ```rust
    fn bar(_: i8) { }
  
    fn main() {
 -      bar(128);
 +      bar(42);
    }
    ```
  
  * Instantiations of struct or variant fields
  
 -  For example, `128` is coerced to have type `i8` in the following:
 +  For example, `42` is coerced to have type `i8` in the following:
  
    ```rust
    struct Foo { x: i8 }
  
    fn main() {
 -      Foo { x: 128 };
 +      Foo { x: 42 };
    }
    ```
  
  * Function results, either the final line of a block if it is not
    semicolon-terminated or any expression in a `return` statement
  
 -  For example, `128` is coerced to have type `i8` in the following:
 +  For example, `42` is coerced to have type `i8` in the following:
  
    ```rust
    fn foo() -> i8 {
 -      128
 +      42
    }
    ```
  
diff --combined src/libstd/rand/os.rs
index 23a368a30a52bc4cfb67f4d8bfd81cbfb8406289,a75a0094b65a7bbb41ce154e8729f4bc087ac689..619f100f1a137ad9092498d19a68306915742c04
@@@ -30,14 -30,19 +30,19 @@@ mod imp 
                    target_arch = "x86",
                    target_arch = "arm",
                    target_arch = "aarch64",
-                   target_arch = "powerpc")))]
+                   target_arch = "powerpc",
+                   target_arch = "powerpc64",
+                   target_arch = "powerpc64le")))]
      fn getrandom(buf: &mut [u8]) -> libc::c_long {
          #[cfg(target_arch = "x86_64")]
          const NR_GETRANDOM: libc::c_long = 318;
          #[cfg(target_arch = "x86")]
          const NR_GETRANDOM: libc::c_long = 355;
-         #[cfg(any(target_arch = "arm", target_arch = "powerpc"))]
+         #[cfg(target_arch = "arm")]
          const NR_GETRANDOM: libc::c_long = 384;
+         #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64",
+                   target_arch = "powerpc64le"))]
+         const NR_GETRANDOM: libc::c_long = 359;
          #[cfg(target_arch = "aarch64")]
          const NR_GETRANDOM: libc::c_long = 278;
  
@@@ -51,7 -56,9 +56,9 @@@
                        target_arch = "x86",
                        target_arch = "arm",
                        target_arch = "aarch64",
-                       target_arch = "powerpc"))))]
+                       target_arch = "powerpc",
+                       target_arch = "powerpc64",
+                       target_arch = "powerpc64le"))))]
      fn getrandom(_buf: &mut [u8]) -> libc::c_long { -1 }
  
      fn getrandom_fill_bytes(v: &mut [u8]) {
@@@ -88,7 -95,9 +95,9 @@@
                    target_arch = "x86",
                    target_arch = "arm",
                    target_arch = "aarch64",
-                   target_arch = "powerpc")))]
+                   target_arch = "powerpc",
+                   target_arch = "powerpc64",
+                   target_arch = "powerpc64le")))]
      fn is_getrandom_available() -> bool {
          use sync::atomic::{AtomicBool, Ordering};
          use sync::Once;
                        target_arch = "x86",
                        target_arch = "arm",
                        target_arch = "aarch64",
-                       target_arch = "powerpc"))))]
+                       target_arch = "powerpc",
+                       target_arch = "powerpc64",
+                       target_arch = "powerpc64le"))))]
      fn is_getrandom_available() -> bool { false }
  
      /// A random number generator that retrieves randomness straight from
@@@ -222,7 -233,7 +233,7 @@@ mod imp 
              // getentropy(2) permits a maximum buffer size of 256 bytes
              for s in v.chunks_mut(256) {
                  let ret = unsafe {
 -                    libc::syscall(libc::NR_GETENTROPY, s.as_mut_ptr(), s.len())
 +                    libc::getentropy(s.as_mut_ptr() as *mut libc::c_void, s.len())
                  };
                  if ret == -1 {
                      panic!("unexpected getentropy error: {}", errno());