Skip to content
Snippets Groups Projects
Commit 50df2e69 authored by Matthew Pickering's avatar Matthew Pickering Committed by Marge Bot
Browse files

Add ldOverrideWhitelist to only default to ldOverride on windows/linux

On some platforms - ie darwin, javascript etc we really do not want to
allow the user to use any linker other than the default one as this
leads to all kinds of bugs. Therefore it is a bit more prudant to add a
whitelist which specifies on which platforms it might be possible to use
a different linker.
parent a48ec5f8
No related branches found
No related tags found
No related merge requests found
......@@ -309,6 +309,15 @@ archHasNativeAdjustors = \case
_ -> False
-- | The platforms which we attempt to override ld
ldOverrideWhitelist :: ArchOS -> Bool
ldOverrideWhitelist a =
case archOS_OS a of
OSLinux -> True
OSMinGW32 -> True
_ -> False
mkTarget :: Opts -> M Target
mkTarget opts = do
-- Use Llvm target if specified, otherwise use triple as llvm target
......@@ -320,7 +329,7 @@ mkTarget opts = do
(archOs, tgtVendor) <- parseTriple cc0 (optTriple opts)
cc <- addPlatformDepCcFlags archOs cc0
readelf <- optional $ findReadelf (optReadelf opts)
ccLink <- findCcLink tgtLlvmTarget (optCcLink opts) (fromMaybe True (optLdOverride opts)) archOs cc readelf
ccLink <- findCcLink tgtLlvmTarget (optCcLink opts) (fromMaybe (ldOverrideWhitelist archOs) (optLdOverride opts)) archOs cc readelf
ar <- findAr tgtVendor (optAr opts)
-- TODO: We could have
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment