diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2018-05-04 14:39:16 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-05-05 13:09:18 -0400 |
commit | cb1ee7e10e50b11b4a24e56b425e8f3485d298d5 (patch) | |
tree | 73a60c833a9442824da963457530050d6ba0884d /compiler | |
parent | 0f046aae5c9552771e489dac8531744034f37cde (diff) | |
download | haskell-cb1ee7e10e50b11b4a24e56b425e8f3485d298d5.tar.gz |
Do not supply `-mcpu` if `-optlc` provides `-mcpu` already.
Reviewers: bgamari
Subscribers: thomie, carter
GHC Trac Issues: #14982
Differential Revision: https://phabricator.haskell.org/D4548
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/DriverPipeline.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 2789ee4eb2..1d78bee14a 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -70,7 +70,7 @@ import System.Directory import System.FilePath import System.IO import Control.Monad -import Data.List ( isSuffixOf, intercalate ) +import Data.List ( isInfixOf, isSuffixOf, intercalate ) import Data.Maybe import Data.Version import Data.Either ( partitionEithers ) @@ -823,7 +823,8 @@ llvmOptions dflags = ++ [("", "-filetype=obj") | fastLlvmPipeline dflags ] -- Additional llc flags - ++ [("", "-mcpu=" ++ mcpu) | not (null mcpu) ] + ++ [("", "-mcpu=" ++ mcpu) | not (null mcpu) + , not (any (isInfixOf "-mcpu") (getOpts dflags opt_lc)) ] ++ [("", "-mattr=" ++ attrs) | not (null attrs) ] where target = LLVM_TARGET |