[commit: ghc] ghc-8.2: Backport D4008 and D4286 to 8.2 (2fc8ce5)

git at git.haskell.org git at git.haskell.org
Wed Jan 17 22:24:08 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/2fc8ce5f0c8c81771c26266ac0b150ca9b75c5f3/ghc

>---------------------------------------------------------------

commit 2fc8ce5f0c8c81771c26266ac0b150ca9b75c5f3
Author: John Ericson <John.Ericson at Obsidian.Systems>
Date:   Wed Jan 17 16:08:11 2018 -0500

    Backport D4008 and D4286 to 8.2
    
    Reviewers: hvr, bgamari, angerman
    
    Subscribers: rwbarton, thomie, erikd, carter
    
    Differential Revision: https://phabricator.haskell.org/D4287


>---------------------------------------------------------------

2fc8ce5f0c8c81771c26266ac0b150ca9b75c5f3
 configure.ac            | 25 ++++++++++++++----------
 distrib/configure.ac.in | 51 ++++++++++++++++++++++++++++---------------------
 mk/config.mk.in         |  2 +-
 3 files changed, 45 insertions(+), 33 deletions(-)

diff --git a/configure.ac b/configure.ac
index 09e5554..846f559 100644
--- a/configure.ac
+++ b/configure.ac
@@ -495,7 +495,7 @@ FP_SET_CFLAGS_C99([CC_STAGE0],[CONF_CC_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
 FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
 FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
 
-dnl ** Choose a linker
+dnl ** Which ld to use
 dnl --------------------------------------------------------------
 FIND_LD([$target],[GccUseLdOpt])
 CONF_GCC_LINKER_OPTS_STAGE1="$CONF_GCC_LINKER_OPTS_STAGE1 $GccUseLdOpt"
@@ -504,6 +504,11 @@ LdCmd="$LD"
 CFLAGS="$CFLAGS $GccUseLdOpt"
 AC_SUBST([LdCmd])
 
+FP_PROG_LD_IS_GNU
+FP_PROG_LD_BUILD_ID
+FP_PROG_LD_NO_COMPACT_UNWIND
+FP_PROG_LD_FILELIST
+
 dnl ** Which nm to use?
 dnl --------------------------------------------------------------
 FP_ARG_WITH_PATH_GNU_PROG([NM], [nm], [nm])
@@ -553,7 +558,13 @@ dnl ** Which ranlib to use?
 dnl --------------------------------------------------------------
 FP_ARG_WITH_PATH_GNU_PROG([RANLIB], [ranlib], [ranlib])
 RanlibCmd="$RANLIB"
-RANLIB="$RanlibCmd"
+AC_SUBST([RanlibCmd])
+
+dnl ** Which strip to use?
+dnl --------------------------------------------------------------
+FP_ARG_WITH_PATH_GNU_PROG([STRIP], [strip], [strip])
+StripCmd="$STRIP"
+AC_SUBST([StripCmd])
 
 
 # Note: we may not have objdump on OS X, and we only need it on Windows (for DLL checks)
@@ -637,24 +648,18 @@ FP_GCC_VERSION
 dnl ** See whether gcc supports -no-pie
 FP_GCC_SUPPORTS_NO_PIE
 
+FP_GCC_EXTRA_FLAGS
+
 dnl ** look to see if we have a C compiler using an llvm back end.
 dnl
 FP_CC_LLVM_BACKEND
 
-FP_PROG_LD_IS_GNU
-FP_PROG_LD_BUILD_ID
-FP_PROG_LD_NO_COMPACT_UNWIND
-FP_PROG_LD_FILELIST
-
-
 FPTOOLS_SET_C_LD_FLAGS([target],[CFLAGS],[LDFLAGS],[IGNORE_LINKER_LD_FLAGS],[CPPFLAGS])
 FPTOOLS_SET_C_LD_FLAGS([build],[CONF_CC_OPTS_STAGE0],[CONF_GCC_LINKER_OPTS_STAGE0],[CONF_LD_LINKER_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
 FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE1],[CONF_GCC_LINKER_OPTS_STAGE1],[CONF_LD_LINKER_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
 FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE2],[CONF_GCC_LINKER_OPTS_STAGE2],[CONF_LD_LINKER_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
 # Stage 3 won't be supported by cross-compilation
 
-FP_GCC_EXTRA_FLAGS
-
 # See rules/distdir-way-opts.mk for details.
 # Flags passed to the C compiler
 AC_SUBST(CONF_CC_OPTS_STAGE0)
diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in
index 1f47ff1..aab9b1d 100644
--- a/distrib/configure.ac.in
+++ b/distrib/configure.ac.in
@@ -75,11 +75,39 @@ dnl ** Which gcc to use?
 dnl --------------------------------------------------------------
 AC_PROG_CC([gcc clang])
 
+dnl ** figure out how to invoke the C preprocessor (i.e. `gcc -E`)
+AC_PROG_CPP
+
 # --with-hs-cpp/--with-hs-cpp-flags
 FP_CPP_CMD_WITH_ARGS(HaskellCPPCmd, HaskellCPPArgs)
 AC_SUBST([HaskellCPPCmd])
 AC_SUBST([HaskellCPPArgs])
 
+FP_SET_CFLAGS_C99([CC],[CFLAGS],[CPPFLAGS])
+dnl FP_SET_CFLAGS_C99([CC_STAGE0],[CONF_CC_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
+FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
+FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
+
+dnl ** Which ld to use?
+dnl --------------------------------------------------------------
+FIND_LD([$target],[GccUseLdOpt])
+CONF_GCC_LINKER_OPTS_STAGE1="$CONF_GCC_LINKER_OPTS_STAGE1 $GccUseLdOpt"
+CONF_GCC_LINKER_OPTS_STAGE2="$CONF_GCC_LINKER_OPTS_STAGE2 $GccUseLdOpt"
+LdCmd="$LD"
+CFLAGS="$CFLAGS $GccUseLdOpt"
+AC_SUBST([LdCmd])
+
+FP_PROG_LD_IS_GNU
+FP_PROG_LD_BUILD_ID
+FP_PROG_LD_NO_COMPACT_UNWIND
+FP_PROG_LD_FILELIST
+
+dnl ** Which strip to use?
+dnl --------------------------------------------------------------
+FP_ARG_WITH_PATH_GNU_PROG([STRIP], [strip], [strip])
+StripCmd="$STRIP"
+AC_SUBST([StripCmd])
+
 # Here is where we re-target which specific version of the LLVM
 # tools we are looking for. In the past, GHC supported a number of
 # versions of LLVM simultaneously, but that stopped working around
@@ -98,18 +126,11 @@ FIND_LLVM_PROG([OPT], [opt], [opt], [$LlvmVersion])
 OptCmd="$OPT"
 AC_SUBST([OptCmd])
 
+dnl ** Check gcc version and flags we need to pass it **
 FP_GCC_VERSION
 FP_GCC_SUPPORTS_NO_PIE
-AC_PROG_CPP
-
-dnl ** Check gcc version and flags we need to pass it **
 FP_GCC_EXTRA_FLAGS
 
-FP_SET_CFLAGS_C99([CC],[CFLAGS],[CPPFLAGS])
-dnl FP_SET_CFLAGS_C99([CC_STAGE0],[CONF_CC_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
-FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
-FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
-
 FPTOOLS_SET_C_LD_FLAGS([target],[CFLAGS],[LDFLAGS],[IGNORE_LINKER_LD_FLAGS],[CPPFLAGS])
 FPTOOLS_SET_C_LD_FLAGS([build],[CONF_CC_OPTS_STAGE0],[CONF_GCC_LINKER_OPTS_STAGE0],[CONF_LD_LINKER_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
 FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE1],[CONF_GCC_LINKER_OPTS_STAGE1],[CONF_LD_LINKER_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
@@ -129,20 +150,6 @@ AC_SUBST(CONF_CPP_OPTS_STAGE0)
 AC_SUBST(CONF_CPP_OPTS_STAGE1)
 AC_SUBST(CONF_CPP_OPTS_STAGE2)
 
-dnl ** Which ld to use?
-dnl --------------------------------------------------------------
-FIND_LD([$target],[GccUseLdOpt])
-CONF_GCC_LINKER_OPTS_STAGE1="$CONF_GCC_LINKER_OPTS_STAGE1 $GccUseLdOpt"
-CONF_GCC_LINKER_OPTS_STAGE2="$CONF_GCC_LINKER_OPTS_STAGE2 $GccUseLdOpt"
-LdCmd="$LD"
-CFLAGS="$CFLAGS $GccUseLdOpt"
-AC_SUBST([LdCmd])
-
-FP_PROG_LD_IS_GNU
-FP_PROG_LD_BUILD_ID
-FP_PROG_LD_NO_COMPACT_UNWIND
-FP_PROG_LD_FILELIST
-
 dnl ** Set up the variables for the platform in the settings file.
 dnl May need to use gcc to find platform details.
 dnl --------------------------------------------------------------
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 4e61eea..fcbc32d 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -785,7 +785,7 @@ else ifeq "$(TARGETPLATFORM)" "arm-unknown-linux"
 # The hack of using `:` to disable stripping is implemented by ghc-cabal.
 STRIP_CMD      = :
 else
-STRIP_CMD      = strip
+STRIP_CMD      = @StripCmd@
 endif
 PATCH_CMD      = @PatchCmd@
 TAR_CMD        = @TarCmd@



More information about the ghc-commits mailing list