[Git][ghc/ghc][wip/hadrian-windows-bindist-cross] hadrian: Don't pass LDFLAGS as a --configure-arg to cabal configure

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Fri Aug 25 15:13:05 UTC 2023



Matthew Pickering pushed to branch wip/hadrian-windows-bindist-cross at Glasgow Haskell Compiler / GHC


Commits:
2df5ff1a by Matthew Pickering at 2023-08-25T16:12:53+01:00
hadrian: Don't pass LDFLAGS as a --configure-arg to cabal configure

We don't have anything sensible to set LDFLAGS to because the "linker"
flags we have are actually flags we pass to the C compiler when it's
used as a linker.

Likewise stop passing -gcc-options which mixed together linker flags and
non-linker flags. There's no guarantee the C compiler will accept both
of these in each mode.

- - - - -


1 changed file:

- hadrian/src/Settings/Builders/Cabal.hs


Changes:

=====================================
hadrian/src/Settings/Builders/Cabal.hs
=====================================
@@ -167,14 +167,13 @@ libraryArgs = do
 configureStageArgs :: Args
 configureStageArgs = do
   let cFlags  = getStagedCCFlags
-      linkFlags = prgFlags . ccLinkProgram . tgtCCompilerLink <$> getStagedTarget
-  mconcat [ configureArgs cFlags linkFlags
+  mconcat [ configureArgs cFlags
           , notStage0 ? arg "--ghc-option=-ghcversion-file=rts/include/ghcversion.h"
           ]
 
 
-configureArgs :: Args -> Args -> Args
-configureArgs cFlags' ldFlags' = do
+configureArgs :: Args -> Args
+configureArgs cFlags' = do
 
     top  <- expr topDirectory
     pkg  <- getPackage
@@ -190,12 +189,8 @@ configureArgs cFlags' ldFlags' = do
                            , arg $ top -/- pkgPath pkg
                            , cFlags'
                            ]
-        ldFlags  = ldArgs <> ldFlags'
-    cldFlags <- unwords <$> (cFlags <> ldFlags)
     mconcat
         [ conf "CFLAGS"   cFlags
-        , conf "LDFLAGS"  ldFlags
-        , not (null cldFlags) ? arg ("--gcc-options=" ++ cldFlags)
         , conf "--with-iconv-includes"    $ arg =<< getSetting IconvIncludeDir
         , conf "--with-iconv-libraries"   $ arg =<< getSetting IconvLibDir
         , conf "--with-gmp-includes"      $ arg =<< getSetting GmpIncludeDir



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2df5ff1a39796f559f3a37965ab9f38e698b0546

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2df5ff1a39796f559f3a37965ab9f38e698b0546
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230825/8a3bbef4/attachment-0001.html>


More information about the ghc-commits mailing list