Skip to content
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

Experimental MUSL target support for the compiler #24777

Merged
merged 10 commits into from
Apr 28, 2015

Commits on Apr 27, 2015

  1. Configuration menu
    Copy the full SHA
    681fc82 View commit details
    Browse the repository at this point in the history
  2. rustc: Add target_env for triples by default

    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.
    alexcrichton committed Apr 27, 2015
    Configuration menu
    Copy the full SHA
    ba2380d View commit details
    Browse the repository at this point in the history
  3. mk: Add support for musl-based builds

    This commit adds support to the makefiles, configuration script, and build
    system to understand MUSL. This is broken up into a few parts:
    
    * Any target of the form `*-musl` requires the `--musl-root` option to
      `./configure` which will indicate the root of the MUSL installation. It is
      also expected that there is a libunwind build inside of that installation
      built against that MUSL.
    
    * Objects from MUSL are copied into the build tree for Rust to be statically
      linked into the appropriate Rust library.
    
    * Objects for binary startup and shutdown are included in each Rust installation
      by default for MUSL. This requires MUSL to only be installed on the machine
      compiling rust. Only a linker will be necessary for compiling against MUSL on
      a target machine.
    
    Eventually a MUSL and/or libunwind build may be integrated by default into the
    build but for now they are just always assumed to exist externally.
    alexcrichton committed Apr 27, 2015
    Configuration menu
    Copy the full SHA
    cd980b3 View commit details
    Browse the repository at this point in the history
  4. rustc_back: Add x86_64-unknown-linux-musl as a target

    This commit adds support for x86_64-unknown-linux-musl as a target of the
    compiler. There's some comments in the commit about some of the more flavorful
    flags passed to the linker as it's not quite as trivial as the normal specs.
    alexcrichton committed Apr 27, 2015
    Configuration menu
    Copy the full SHA
    22da16a View commit details
    Browse the repository at this point in the history
  5. rustc: Add support for linking arbitrary objects

    MUSL for example provides its own start/end objects in place of the standard
    ones shipped by gcc.
    alexcrichton committed Apr 27, 2015
    Configuration menu
    Copy the full SHA
    d098517 View commit details
    Browse the repository at this point in the history
  6. std: Prepare for linking to musl

    This commit modifies the standard library and its dependencies to link correctly
    when built against MUSL. This primarily ensures that the right libraries are
    linked against and when they're linked against they're linked against
    statically.
    alexcrichton committed Apr 27, 2015
    Configuration menu
    Copy the full SHA
    6c04872 View commit details
    Browse the repository at this point in the history
  7. compiletest: Don't force dylibs on musl

    MUSL support is currently only with static builds, so building a dylib will
    always fail.
    alexcrichton committed Apr 27, 2015
    Configuration menu
    Copy the full SHA
    5f518ad View commit details
    Browse the repository at this point in the history
  8. std: Don't assume dlopen() works on yourself

    Statically linked executables do not succeed (aka MUSL-based executables).
    alexcrichton committed Apr 27, 2015
    Configuration menu
    Copy the full SHA
    7dd6215 View commit details
    Browse the repository at this point in the history
  9. compiletest: Add support for // ignore-musl

    Add the ability to ignore a test based on the environment of the triple being
    used.
    alexcrichton committed Apr 27, 2015
    Configuration menu
    Copy the full SHA
    60f8f6b View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2015

  1. test: Fix some tests to run with musl

    There were a few test cases to fix:
    
    * Dynamic libraries are not supported with MUSL right now, so all of those
      related test which force or require dylibs are ignored.
    * Looks like the default stack for MUSL is smaller than glibc, so a few stack
      allocations in benchmarks were boxed up (shouldn't have a perf impact).
    * Some small linkage tweaks here and there
    * Out-of-stack detection does not currently work with MUSL
    alexcrichton committed Apr 28, 2015
    Configuration menu
    Copy the full SHA
    247842b View commit details
    Browse the repository at this point in the history