[commit: ghc] ghc-8.0: revert '-Wl' prefixing to *_LD_OPTS (f6e8d45)

git at git.haskell.org git at git.haskell.org
Wed Jan 4 13:45:45 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/f6e8d45d6860996e7db9dcd4b440eabac710fa5e/ghc

>---------------------------------------------------------------

commit f6e8d45d6860996e7db9dcd4b440eabac710fa5e
Author: Sergei Trofimovich <siarheit at google.com>
Date:   Sat Dec 17 13:30:41 2016 +0000

    revert '-Wl' prefixing to *_LD_OPTS
    
    This reverts f48f5a9ebf384e1e157b7b413e1d779f4289ddd2
    
    The prefixing does not work as comma
    is stripped by $(addprefix) macro:
    
    The following call
        $$(addprefix -optl-Wl, $$($1_$2_$3_ALL_LD_OPTS))
    
    prefixes options with "-optl-Wl" not with "-optl-Wl,"
    
    The simplest breakage can be seen by adding
        SRC_LD_OPTS += -O1
    to mk/build.mk:
    
      <no location info>: error:
        Warning: Couldn't figure out linker information!
                 Make sure you're using GNU ld, GNU gold
                 or the built in OS X linker, etc.
      gcc: error: unrecognized command line option '-Wl-O1'
    
    Another problem with original change is loss of ability
    to pass options to gcc as a linker driver, for example:
        SRC_LD_OPTS += -flto
    
    Signed-off-by: Sergei Trofimovich <siarheit at google.com>
    (cherry picked from commit a6657bd0d6b9949098021d89ed3cd8a943bdd3b6)


>---------------------------------------------------------------

f6e8d45d6860996e7db9dcd4b440eabac710fa5e
 rules/distdir-way-opts.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index 61e03ee..7ba6ebc 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -201,7 +201,7 @@ $1_$2_$3_ALL_LD_OPTS = \
 
 # Options for passing to GHC when we use it for linking
 $1_$2_$3_GHC_LD_OPTS = \
- $$(addprefix -optl-Wl, $$($1_$2_$3_ALL_LD_OPTS)) \
+ $$(addprefix -optl, $$($1_$2_$3_ALL_LD_OPTS)) \
  $$($1_$2_$3_MOST_HC_OPTS)
 
 $1_$2_$3_ALL_AS_OPTS = \



More information about the ghc-commits mailing list