Skip to content
  • Nathan Froyd's avatar
    44e56a41
    Bug 1329737 - part 3 - use an alternate linker for Cargo invocations; r=rillian · 44e56a41
    Nathan Froyd authored
    For linking static libraries, rustc will use whatever `cc` it finds (or
    the equivalent on Windows).  For our purposes, however, `cc` is not what
    we use to link and we may have additional options we would like to pass
    to the linker.
    
    To do this, we need to tell Cargo about our alternate linker (currently
    only used for target compilations, on the theory that the host compiler
    rustc finds is probably good enough) and we also need to pass our linker
    options into the process.  We do this with environment variables, which
    is not a great solution, but works surprisingly well.
    
    This alternate linker is disabled for ASan builds due to peculiar
    crashes when running Rust build scripts and for Windows, because we
    don't do any interesting cross-compiling there.
    44e56a41
    Bug 1329737 - part 3 - use an alternate linker for Cargo invocations; r=rillian
    Nathan Froyd authored
    For linking static libraries, rustc will use whatever `cc` it finds (or
    the equivalent on Windows).  For our purposes, however, `cc` is not what
    we use to link and we may have additional options we would like to pass
    to the linker.
    
    To do this, we need to tell Cargo about our alternate linker (currently
    only used for target compilations, on the theory that the host compiler
    rustc finds is probably good enough) and we also need to pass our linker
    options into the process.  We do this with environment variables, which
    is not a great solution, but works surprisingly well.
    
    This alternate linker is disabled for ASan builds due to peculiar
    crashes when running Rust build scripts and for Windows, because we
    don't do any interesting cross-compiling there.
Loading