summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-08-05 18:08:22 +0100
committerIan Lynagh <ian@well-typed.com>2012-08-05 18:08:22 +0100
commit2d2650bf65da3aede4e1c1ca4da623092b869dbe (patch)
tree9e99da26009e15aa9ece123ded307d150d37c102
parentecc43c17c87fed9221851ed6c6fa4a8b8967b20e (diff)
downloadhaskell-2d2650bf65da3aede4e1c1ca4da623092b869dbe.tar.gz
Move linker flags into the settings file; fixes #4862
They were getting baked into Config.hs before.
-rw-r--r--aclocal.m45
-rw-r--r--compiler/ghc.mk4
-rw-r--r--compiler/main/DriverPipeline.hs4
-rw-r--r--compiler/main/DynFlags.hs1
-rw-r--r--settings.in1
5 files changed, 5 insertions, 10 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index a43b24ae36..c2eb103010 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -365,7 +365,6 @@ AC_DEFUN([FP_SETTINGS],
then
mingw_bin_prefix=mingw/bin/
SettingsCCompilerCommand="\$topdir/../${mingw_bin_prefix}gcc.exe"
- SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2 $CONF_GCC_LINKER_OPTS_STAGE2"
SettingsArCommand="\$topdir/../${mingw_bin_prefix}ar.exe"
SettingsPerlCommand='$topdir/../perl/perl.exe'
SettingsDllWrapCommand="\$topdir/../${mingw_bin_prefix}dllwrap.exe"
@@ -373,7 +372,6 @@ AC_DEFUN([FP_SETTINGS],
SettingsTouchCommand='$topdir/touchy.exe'
else
SettingsCCompilerCommand="$WhatGccIsCalled"
- SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2 $CONF_GCC_LINKER_OPTS_STAGE2"
SettingsArCommand="$ArCmd"
SettingsPerlCommand="$PerlCmd"
SettingsDllWrapCommand="/bin/false"
@@ -392,8 +390,11 @@ AC_DEFUN([FP_SETTINGS],
SettingsOptCommand="$OptCmd"
fi
fi
+ SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2 $CONF_GCC_LINKER_OPTS_STAGE2"
+ SettingsLdFlags="$CONF_LD_LINKER_OPTS_STAGE2"
AC_SUBST(SettingsCCompilerCommand)
AC_SUBST(SettingsCCompilerFlags)
+ AC_SUBST(SettingsLdFlags)
AC_SUBST(SettingsArCommand)
AC_SUBST(SettingsPerlCommand)
AC_SUBST(SettingsDllWrapCommand)
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 1ea6159812..f5330c0cc4 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -71,10 +71,6 @@ compiler/stage%/build/Config.hs : mk/config.mk mk/project.mk | $$(dir $$@)/.
@echo 'cBooterVersion = "$(GhcVersion)"' >> $@
@echo 'cStage :: String' >> $@
@echo 'cStage = show (STAGE :: Int)' >> $@
- @echo 'cGccLinkerOpts :: [String]' >> $@
- @echo 'cGccLinkerOpts = words "$(CONF_GCC_LINKER_OPTS_STAGE$*)"' >> $@
- @echo 'cLdLinkerOpts :: [String]' >> $@
- @echo 'cLdLinkerOpts = words "$(CONF_LD_LINKER_OPTS_STAGE$*)"' >> $@
@echo 'cIntegerLibrary :: String' >> $@
@echo 'cIntegerLibrary = "$(INTEGER_LIBRARY)"' >> $@
@echo 'cIntegerLibraryType :: IntegerLibrary' >> $@
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 14fff98599..84b7f6aace 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1175,10 +1175,8 @@ runPhase As input_fn dflags
= do
llvmVer <- io $ figureLlvmVersion dflags
return $ case llvmVer of
- -- using cGccLinkerOpts here but not clear if
- -- opt_c isn't a better choice
Just n | n >= 30 ->
- (SysTools.runClang, cGccLinkerOpts)
+ (SysTools.runClang, getOpts dflags opt_c)
_ -> (SysTools.runAs, getOpts dflags opt_a)
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 415fef213c..dcb31880b6 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -2907,7 +2907,6 @@ compilerInfo dflags
("Debug on", show debugIsOn),
("LibDir", topDir dflags),
("Global Package DB", systemPackageConfig dflags),
- ("Gcc Linker flags", show cGccLinkerOpts),
("Ld Linker flags", show cLdLinkerOpts)
]
diff --git a/settings.in b/settings.in
index 80741ab2d3..d6245d6400 100644
--- a/settings.in
+++ b/settings.in
@@ -1,6 +1,7 @@
[("GCC extra via C opts", "@GccExtraViaCOpts@"),
("C compiler command", "@SettingsCCompilerCommand@"),
("C compiler flags", "@SettingsCCompilerFlags@"),
+ ("ld flags", "@SettingsLdFlags@"),
("ar command", "@SettingsArCommand@"),
("ar flags", "@ArArgs@"),
("ar supports at file", "@ArSupportsAtFile@"),