Sven Tennie pushed to branch wip/supersven/correctly_propagate_host-build-target at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cpp.hs
    ... ... @@ -61,7 +61,7 @@ findHsCpp progOpt cc = checking "for Haskell C preprocessor" $ do
    61 61
       let rawHsCppProgram = addFlagIfNew "-E" foundHsCppProg
    
    62 62
       -- Always try to add the Haskell-specific CPP flags, regardless of the user options
    
    63 63
       hppArgs <- findHsCppArgs rawHsCppProgram
    
    64
    -  let hsCppProgram = over _prgFlags (++hppArgs) rawHsCppProgram
    
    64
    +  let hsCppProgram = foldr addFlagIfNew rawHsCppProgram (reverse hppArgs)
    
    65 65
       return HsCpp{hsCppProgram}
    
    66 66
     
    
    67 67
     -- | Given a C preprocessor, figure out how it should be invoked to preprocess
    

  • utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs
    ... ... @@ -383,7 +383,7 @@ addOSMinGW32CcFlags archOs cc link
    383 383
     -- See Note [Windows stack allocations].
    
    384 384
     checkFStackCheck :: Cc -> Program -> M Program
    
    385 385
     checkFStackCheck cc link = checking "that -fstack-check works" $ do
    
    386
    -      let link' = link & _prgFlags %++ "-fstack-check"
    
    386
    +      let link' = addFlagIfNew "-fstack-check" link
    
    387 387
           checkLinkWorks cc link'
    
    388 388
           return link'
    
    389 389
     
    
    ... ... @@ -393,7 +393,7 @@ addNoAsNeeded archOs cc ccLink
    393 393
       | os <- archOS_OS archOs
    
    394 394
       , osElfTarget os
    
    395 395
       = checking "that --no-as-needed works" $ do
    
    396
    -      let ccLink' = over _prgFlags (++["-Wl,--no-as-needed"]) ccLink
    
    396
    +      let ccLink' = addFlagIfNew "-Wl,--no-as-needed" ccLink
    
    397 397
           checkLinkWorks cc ccLink'
    
    398 398
           return ccLink'
    
    399 399
       | otherwise = return ccLink