[commit: ghc] master, ghc-lwc2, type-nats: Split SettingsCCompilerFlags into non-link and link portions (890f465)
Ian Lynagh
igloo at earth.li
Thu Feb 28 15:20:06 CET 2013
Repository : http://darcs.haskell.org/ghc.git/
On branches: master,ghc-lwc2,type-nats
http://hackage.haskell.org/trac/ghc/changeset/890f4657e0edc9fa945c1e70ddf1bec1f52b7590
>---------------------------------------------------------------
commit 890f4657e0edc9fa945c1e70ddf1bec1f52b7590
Author: Gabor Greif <ggreif at gmail.com>
Date: Mon Feb 25 18:53:31 2013 +0100
Split SettingsCCompilerFlags into non-link and link portions
This fixes certain older GCCs which do not accept link options when assembling or compiling:
ppc_85xx-gcc: --hash-size=31: linker input file unused because linking not done
ppc_85xx-gcc: --reduce-memory-overheads: linker input file unused because linking not done
and diagnose this to stderr.
>---------------------------------------------------------------
aclocal.m4 | 4 +++-
compiler/main/SysTools.lhs | 3 ++-
settings.in | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 11c95ee..268e631 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -461,10 +461,12 @@ AC_DEFUN([FP_SETTINGS],
SettingsOptCommand="$OptCmd"
fi
fi
- SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2 $CONF_GCC_LINKER_OPTS_STAGE2"
+ SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2"
+ SettingsCCompilerLinkFlags="$CONF_GCC_LINKER_OPTS_STAGE2"
SettingsLdFlags="$CONF_LD_LINKER_OPTS_STAGE2"
AC_SUBST(SettingsCCompilerCommand)
AC_SUBST(SettingsCCompilerFlags)
+ AC_SUBST(SettingsCCompilerLinkFlags)
AC_SUBST(SettingsLdCommand)
AC_SUBST(SettingsLdFlags)
AC_SUBST(SettingsArCommand)
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index 40a7a25..79af4f6 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -284,10 +284,11 @@ initSysTools mbMinusB
++ gcc_args
-- Other things being equal, as and ld are simply gcc
+ gcc_link_args_str <- getSetting "C compiler link flags"
let as_prog = gcc_prog
as_args = gcc_args
ld_prog = gcc_prog
- ld_args = gcc_args
+ ld_args = gcc_args ++ map Option (words gcc_link_args_str)
-- We just assume on command line
lc_prog <- getSetting "LLVM llc command"
diff --git a/settings.in b/settings.in
index e7354cd..c749f23 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@"),
+ ("C compiler link flags", "@SettingsCCompilerLinkFlags@"),
("ld command", "@SettingsLdCommand@"),
("ld flags", "@SettingsLdFlags@"),
("ld supports compact unwind", "@LdHasNoCompactUnwind@"),
More information about the ghc-commits
mailing list