Skip to content
  • Peter Trommler's avatar
    Link temporary shared objects with `--no-as-needed` · 1b7f5976
    Peter Trommler authored and Herbert Valerio Riedel's avatar Herbert Valerio Riedel committed
    Some ELF link editors default to `--as-needed` and record only
    those libraries in DT_NEEDED tags that are needed to resolve
    undefined symbols in the shared object to be created.
    
    In Template Haskell we rely on all symbols that were defined
    in modules compiled so far to be available in the current
    temporary shared object. To prevent the link editor from
    dropping the DT_NEEDED tag for the previously linked temporary
    shared object we need to override the link editors default and
    specify `--no-as-needed` on the command line. This is for GNU ld
    and GOLD ld.
    
    This addresses #10110
    
    TODO: regression test
    
    Reviewed By: hvr
    
    Differential Revision: https://phabricator.haskell.org/D731
    1b7f5976