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

msvc: Enable unwinding, improve finding link.exe #26741

Merged
merged 7 commits into from
Jul 6, 2015

Commits on Jul 1, 2015

  1. msvc: Enable landing pads by default

    This commit turns on landing pads for MSVC by default, which means that we'll
    now be running cleanups for values on the stack when an exception is thrown.
    This commit "fixes" the previously seen LLVM abort by attaching the `noinline`
    attribute to all generated drop glue to prevent landing pads from being inlined
    into other landing pads.
    
    The performance of MSVC is highly likely to decrease from this commit, but there
    are various routes we can taken in the future if this ends up staying for quite
    a while, such as generating a shim function only called from landing pads which
    calls the actual drop glue, and this shim is marked noinline.
    
    For now, however, this patch enables MSVC to successfully bootstrap itself!
    alexcrichton committed Jul 1, 2015
    Configuration menu
    Copy the full SHA
    f9de964 View commit details
    Browse the repository at this point in the history
  2. msvc: Lookup linker in windows registry

    This commit alters the compiler to no longer "just run link.exe" but instead
    probe the system's registry to find where the linker is located. The default
    library search path (normally found through LIB) is also found through the
    registry. This also brings us in line with the default behavior of Clang, and
    much of the logic of where to look for information is copied over from Clang as
    well. Finally, this commit removes the makefile logic for updating the
    environment variables for the compiler, except for stage0 where it's still
    necessary.
    
    The motivation for this change is rooted in two positions:
    
    * Not having to set up these environment variables is much less hassle both for
      the bootstrap and for running the compiler itself. This means that the
      compiler can be run outside of VS shells and be run inside of cmd.exe or a
      MSYS shell.
    
    * When dealing with cross compilation, there's not actually a set of environment
      variables that can be set for the compiler. This means, for example, if a
      Cargo compilation is targeting 32-bit from 64-bit you can't actually set up
      one set of environment variables. Having the compiler deal with the logic
      instead is generally much more convenient!
    alexcrichton committed Jul 1, 2015
    Configuration menu
    Copy the full SHA
    91c22b6 View commit details
    Browse the repository at this point in the history
  3. msvc: Fix TLS destructors

    Just like the original article our Windows TLS support is based on predicted,
    this symbol must be linked in on MSVC to pull in the necessary support for TLS
    variables. This commit fixes a number of unit tests which require that TLS
    destructors are run.
    alexcrichton committed Jul 1, 2015
    Configuration menu
    Copy the full SHA
    ae0eb67 View commit details
    Browse the repository at this point in the history
  4. msvc: Ignore extern-pass-empty on MSVC

    The MSVC compiler doesn't like empty structs, so this test won't link on MSVC,
    so it's ignored.
    alexcrichton committed Jul 1, 2015
    Configuration menu
    Copy the full SHA
    407fb29 View commit details
    Browse the repository at this point in the history
  5. msvc: Fix the link name for the lgamma

    The function is apparently just called lgamma on MSVC
    alexcrichton committed Jul 1, 2015
    Configuration menu
    Copy the full SHA
    18c39e1 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2015

  1. windows: Don't link rust_builtin

    This library has no shims which are actually needed on Windows now, so translate
    that last easy one into Rust and then don't link it at all on Windows.
    alexcrichton committed Jul 2, 2015
    Configuration menu
    Copy the full SHA
    83ee47b View commit details
    Browse the repository at this point in the history
  2. rustc_trans: Disable landing pads on 32-bit MSVC

    This is currently quite buggy in LLVM from what I can tell, so just disable it
    entirely. This commit also adds preliminary support, however, to actually
    target 32-bit MSVC by making sure the `rust_try_msvc_32.ll` file exists and
    wiring up exceptions to `_except_handler3` instead of `__C_specific_handler`
    (which doesn't exist on 32-bit).
    alexcrichton committed Jul 2, 2015
    Configuration menu
    Copy the full SHA
    3e26e56 View commit details
    Browse the repository at this point in the history