Sven Tennie pushed to branch wip/supersven/correctly_propagate_host-build-target at Glasgow Haskell Compiler / GHC
Commits:
-
b9784bd6
by Sven Tennie at 2026-03-25T14:54:14+01:00
2 changed files:
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cpp.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs
Changes:
| ... | ... | @@ -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
|
| ... | ... | @@ -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
|