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

Keep last redundant linker flag, not first #57018

Merged
merged 7 commits into from
Mar 20, 2019

Commits on Dec 20, 2018

  1. Keep last redundant linker flag, not first

    When a library (L1) is passed to the linker multiple times, this is
    sometimes purposeful: there might be several other libraries in the
    linker command (L2 and L3) that all depend on L1.  You'd end up with a
    (simplified) linker command that looks like:
    
        -l2 -l1 -l3 -l1
    
    With the previous behavior, when rustc encountered a redundant library,
    it would keep the first instance, and remove the later ones, resulting
    in:
    
        -l2 -l1 -l3
    
    This can cause a linker error, because on some platforms (e.g. Linux),
    the linker will only include symbols from L1 that are needed *at the
    point it's referenced in the command line*.  So if L3 depends on
    additional symbols from L1, which aren't needed by L2, the linker won't
    know to include them, and you'll end up with "undefined symbols" errors.
    
    A better behavior is to keep the *last* instance of the library:
    
        -l2 -l3 -l1
    
    This ensures that all "downstream" libraries have been included in the
    linker command before the "upstream" library is referenced.
    
    Fixes rust-lang#47989
    dcreager committed Dec 20, 2018
    Configuration menu
    Copy the full SHA
    d445e1c View commit details
    Browse the repository at this point in the history
  2. Fix typo in comment

    dcreager committed Dec 20, 2018
    Configuration menu
    Copy the full SHA
    c56f128 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2019

  1. Configuration menu
    Copy the full SHA
    c641a8c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    32969e9 View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2019

  1. Remove copyright notices

    dcreager committed Mar 15, 2019
    Configuration menu
    Copy the full SHA
    8b6c566 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2019

  1. Configuration menu
    Copy the full SHA
    b58e19d View commit details
    Browse the repository at this point in the history
  2. Ignore test on Windows

    dcreager committed Mar 19, 2019
    Configuration menu
    Copy the full SHA
    32d99ef View commit details
    Browse the repository at this point in the history