Skip to content
  • Thomas Miedema's avatar
    Build system: don't add ALL_HC_OPTS when linking · 9fc2d777
    Thomas Miedema authored
    Summary:
    The current scheme in rules/distdir-way-opts.mk is something like this:
      GHC_LD_OPTS      = MOST_HC_OPTS + ALL_LD_OPTS
      MOST_DIR_HC_OPTS = MOST_HC_OPTS + -odir,-hidir,-stubdir
      ALL_HC_OPTS      = MOST_DIR_HC_OPTS +
                            -hisuf,-osuf,-hcsuf,-split-objs,-dynamic-too
    
    Notice that both ALL_HC_OPTS and GHC_LD_OPTS include MOST_HC_OPTS, and
    currently both got added when linking. Adding MOST_HC_OPTS twice results
    in overly long and hard to decipher command lines (and build logs). This
    commit fixes that.
    
    Afaik, -odir,-hidir,-stubdir,-hisuf,-osuf,-hcsuf,-spit-objs,-dynamic-too
    are all not needed when linking, so this change should be safe to make.
    GHC_LD_OPTS is for linking, ALL_HC_OPTS is for compiling.
    
    ALL_HC_OPTS was added to the linking commands in
    37a6a52f, to make sure
    -no-user-package-conf would be in the options list. It still is after
    this change.
    
    Reviewers: austin, bgamari
    
    Differential Revision: https://phabricator.haskell.org/D1379
    9fc2d777