1. 12 11月, 2018 1 次提交
    • A
      rustc: Clean up allocator injection logic · d3939322
      Alex Crichton 提交于
      This commit cleans up allocator injection logic found in the compiler
      around selecting the global allocator. It turns out that now that
      jemalloc is gone the compiler never actually injects anything! This
      means that basically everything around loading crates here and there can
      be easily pruned.
      
      This also removes the `exe_allocation_crate` option from custom target
      specs as it's no longer used by the compiler anywhere.
      d3939322
  2. 26 4月, 2018 2 次提交
  3. 06 12月, 2017 1 次提交
  4. 30 9月, 2017 1 次提交
  5. 06 7月, 2017 1 次提交
    • A
      rustc: Implement the #[global_allocator] attribute · 695dee06
      Alex Crichton 提交于
      This PR is an implementation of [RFC 1974] which specifies a new method of
      defining a global allocator for a program. This obsoletes the old
      `#![allocator]` attribute and also removes support for it.
      
      [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197
      
      The new `#[global_allocator]` attribute solves many issues encountered with the
      `#![allocator]` attribute such as composition and restrictions on the crate
      graph itself. The compiler now has much more control over the ABI of the
      allocator and how it's implemented, allowing much more freedom in terms of how
      this feature is implemented.
      
      cc #27389
      695dee06
  6. 07 4月, 2017 1 次提交
    • J
      -Z linker-flavor · 9d11b089
      Jorge Aparicio 提交于
      This patch adds a `-Z linker-flavor` flag to rustc which can be used to invoke
      the linker using a different interface.
      
      For example, by default rustc assumes that all the Linux targets will be linked
      using GCC. This makes it impossible to use LLD as a linker using just `-C
      linker=ld.lld` because that will invoke LLD with invalid command line
      arguments. (e.g. rustc will pass -Wl,--gc-sections to LLD but LLD doesn't
      understand that; --gc-sections would be the right argument)
      
      With this patch one can pass `-Z linker-flavor=ld` to rustc to invoke the linker
      using a LD-like interface. This way, `rustc -C linker=ld.lld -Z
      linker-flavor=ld` will invoke LLD with the right arguments.
      
      `-Z linker-flavor` accepts 4 different arguments: `em` (emcc), `ld`,
      `gcc`, `msvc` (link.exe). `em`, `gnu` and `msvc` cover all the existing linker
      interfaces. `ld` is a new flavor for interfacing GNU's ld and LLD.
      
      This patch also changes target specifications. `linker-flavor` is now a
      mandatory field that specifies the *default* linker flavor that the target will
      use. This change also makes the linker interface *explicit*; before, it used to
      be derived from other fields like linker-is-gnu, is-like-msvc,
      is-like-emscripten, etc.
      
      Another change to target specifications is that the fields `pre-link-args`,
      `post-link-args` and `late-link-args` now expect a map from flavor to linker
      arguments.
      
      ``` diff
      -    "pre-link-args": ["-Wl,--as-needed", "-Wl,-z,-noexecstack"],
      +    "pre-link-args": {
      +        "gcc": ["-Wl,--as-needed", "-Wl,-z,-noexecstack"],
      +        "ld": ["--as-needed", "-z,-noexecstack"],
      +    },
      ```
      
      [breaking-change]  for users of custom targets specifications
      9d11b089
  7. 27 10月, 2016 1 次提交
    • A
      Disable jemalloc on aarch64/powerpc · de80670f
      Alex Crichton 提交于
      Sounds like jemalloc is broken on systems which differ in page size than the
      host it was compiled on (unless an option was passed). This unfortunately
      reduces the portability of binaries created and can often make Rust segfault by
      default. For now let's patch over this by disabling jemalloc until we can figure
      out a better solution.
      
      Closes #36994
      Closes #37320
      cc jemalloc/jemalloc#467
      de80670f
  8. 24 10月, 2016 1 次提交
  9. 04 10月, 2016 1 次提交
  10. 29 7月, 2016 1 次提交
  11. 28 7月, 2016 1 次提交
    • D
      librustc_back: convert fn target() to return Result · eafecbf8
      Doug Goldstein 提交于
      Change all the target generation functions to return a Result<Target,
      String> so that targets that are unable to be instantiated can be
      expressed as an Err instead of a panic!(). This should improve #33497 as
      well.
      eafecbf8
  12. 09 5月, 2016 1 次提交
  13. 19 4月, 2016 1 次提交
  14. 11 1月, 2016 1 次提交
  15. 22 12月, 2015 1 次提交
    • A
      rustc: Add feature-gated cfg(target_thread_local) · b67b5a8d
      Alex Crichton 提交于
      Currently the standard library has some pretty complicated logic to detect
      whether #[thread_local] should be used or whether it's supported. This is also
      unfortunately not quite true for OSX where not all versions support
      the #[thread_local] attribute (only 10.7+ does). Compiling code for OSX 10.6 is
      typically requested via the MACOSX_DEPLOYMENT_TARGET environment variable (e.g.
      the linker recognizes this), but the standard library unfortunately does not
      respect this.
      
      This commit updates the compiler to add a `target_thread_local` cfg annotation
      if the platform being targeted supports the `#[thread_local]` attribute. This is
      feature gated for now, and it is only true on non-aarch64 Linux and 10.7+ OSX
      (e.g. what the module already does today). Logic has also been added to parse
      the deployment target environment variable.
      b67b5a8d
  16. 24 9月, 2015 1 次提交
    • S
      rustc: Add target_vendor for target triples · af68cdfe
      Sebastian Wicki 提交于
      This adds a new target property, `target_vendor` which can be used as a
      matcher for conditional compilation. The vendor is part of the autoconf
      target triple: <arch><sub>-<vendor>-<os>-<env>
      
      The default value for `target_vendor` is "unknown".
      
      Matching against the `target_vendor` with `#[cfg]` is currently feature
      gated as `cfg_target_vendor`.
      af68cdfe
  17. 17 7月, 2015 1 次提交
    • A
      trans: Clean up handling the LLVM data layout · 958d5638
      Alex Crichton 提交于
      Turns out for OSX our data layout was subtly wrong and the LLVM update must have
      exposed this. Instead of fixing this I've removed all data layouts from the
      compiler to just use the defaults that LLVM provides for all targets. All data
      layouts (and a number of dead modules) are removed from the compiler here.
      Custom target specifications can still provide a custom data layout, but it is
      now an optional key as the default will be used if one isn't specified.
      958d5638
  18. 13 5月, 2015 2 次提交
    • A
      Scale back changes made · 4cc025d8
      Alex Crichton 提交于
      4cc025d8
    • R
      Very hacky MSVC hacks. · 315750ac
      Ricky Taylor 提交于
      Conflicts:
      	mk/platform.mk
      	src/librustc/session/config.rs
      	src/librustc_back/target/aarch64_apple_ios.rs
      	src/librustc_back/target/aarch64_linux_android.rs
      	src/librustc_back/target/arm_linux_androideabi.rs
      	src/librustc_back/target/arm_unknown_linux_gnueabi.rs
      	src/librustc_back/target/arm_unknown_linux_gnueabihf.rs
      	src/librustc_back/target/armv7_apple_ios.rs
      	src/librustc_back/target/armv7s_apple_ios.rs
      	src/librustc_back/target/i386_apple_ios.rs
      	src/librustc_back/target/i686_apple_darwin.rs
      	src/librustc_back/target/i686_pc_windows_gnu.rs
      	src/librustc_back/target/i686_unknown_dragonfly.rs
      	src/librustc_back/target/i686_unknown_linux_gnu.rs
      	src/librustc_back/target/mips_unknown_linux_gnu.rs
      	src/librustc_back/target/mipsel_unknown_linux_gnu.rs
      	src/librustc_back/target/mod.rs
      	src/librustc_back/target/powerpc_unknown_linux_gnu.rs
      	src/librustc_back/target/x86_64_apple_darwin.rs
      	src/librustc_back/target/x86_64_apple_ios.rs
      	src/librustc_back/target/x86_64_pc_windows_gnu.rs
      	src/librustc_back/target/x86_64_unknown_dragonfly.rs
      	src/librustc_back/target/x86_64_unknown_freebsd.rs
      	src/librustc_back/target/x86_64_unknown_linux_gnu.rs
      	src/librustc_back/target/x86_64_unknown_openbsd.rs
      	src/librustc_llvm/lib.rs
      	src/librustc_trans/back/link.rs
      	src/librustc_trans/trans/base.rs
      	src/libstd/os.rs
      	src/rustllvm/RustWrapper.cpp
      315750ac
  19. 28 4月, 2015 1 次提交
    • A
      rustc: Add target_env for triples by default · ba2380d7
      Alex Crichton 提交于
      This adds a new `#[cfg]` matcher against the `target_env` property of the
      destination target triple. For example all windows triples today end with `-gnu`
      but we will also hopefully support non-`gnu` targets for Windows, at which point
      we'll need to differentiate between the two. This new `target_env` matches is
      provided and filled in with the target's environment name.
      
      Currently the only non-empty value of this name is `gnu`, but `musl` will be
      shortly added for the linux triples.
      ba2380d7
  20. 08 1月, 2015 1 次提交
  21. 03 1月, 2015 1 次提交
  22. 28 12月, 2014 1 次提交
  23. 04 11月, 2014 1 次提交
    • C
      Implement flexible target specification · 6b130e3d
      Corey Richardson 提交于
      Removes all target-specific knowledge from rustc. Some targets have changed
      during this, but none of these should be very visible outside of
      cross-compilation. The changes make our targets more consistent.
      
      iX86-unknown-linux-gnu is now only available as i686-unknown-linux-gnu. We
      used to accept any value of X greater than 1. i686 was released in 1995, and
      should encompass the bare minimum of what Rust supports on x86 CPUs.
      
      The only two windows targets are now i686-pc-windows-gnu and
      x86_64-pc-windows-gnu.
      
      The iOS target has been renamed from arm-apple-ios to arm-apple-darwin.
      
      A complete list of the targets we accept now:
      
      arm-apple-darwin
      arm-linux-androideabi
      arm-unknown-linux-gnueabi
      arm-unknown-linux-gnueabihf
      
      i686-apple-darwin
      i686-pc-windows-gnu
      i686-unknown-freebsd
      i686-unknown-linux-gnu
      
      mips-unknown-linux-gnu
      mipsel-unknown-linux-gnu
      
      x86_64-apple-darwin
      x86_64-unknown-freebsd
      x86_64-unknown-linux-gnu
      x86_64-pc-windows-gnu
      
      Closes #16093
      
      [breaking-change]
      6b130e3d