build system: Include CONF_LD_LINKER_OPTS in ALL_LD_OPTS
authorBen Gamari <bgamari.foss@gmail.com>
Fri, 4 Nov 2016 19:03:44 +0000 (15:03 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 10 Nov 2016 18:16:03 +0000 (13:16 -0500)
This ensures that artifacts built with build-prog see these options.
Also spruce up comments.

Test Plan: Carefully read it.

Reviewers: austin, hvr, erikd

Reviewed By: erikd

Subscribers: thomie, erikd

Differential Revision: https://phabricator.haskell.org/D2673

configure.ac
rules/distdir-way-opts.mk

index 5decd24..9b0b549 100644 (file)
@@ -626,15 +626,20 @@ FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE2],[CONF_GCC_LINKER_OPTS_STAG
 
 FP_GCC_EXTRA_FLAGS
 
+# See rules/distdir-way-opts.mk for details.
+# Flags passed to the C compiler
 AC_SUBST(CONF_CC_OPTS_STAGE0)
 AC_SUBST(CONF_CC_OPTS_STAGE1)
 AC_SUBST(CONF_CC_OPTS_STAGE2)
+# Flags passed to the C compiler when we ask it to link
 AC_SUBST(CONF_GCC_LINKER_OPTS_STAGE0)
 AC_SUBST(CONF_GCC_LINKER_OPTS_STAGE1)
 AC_SUBST(CONF_GCC_LINKER_OPTS_STAGE2)
+# Flags passed to the linker when we ask it to link
 AC_SUBST(CONF_LD_LINKER_OPTS_STAGE0)
 AC_SUBST(CONF_LD_LINKER_OPTS_STAGE1)
 AC_SUBST(CONF_LD_LINKER_OPTS_STAGE2)
+# Flags passed to the C preprocessor
 AC_SUBST(CONF_CPP_OPTS_STAGE0)
 AC_SUBST(CONF_CPP_OPTS_STAGE1)
 AC_SUBST(CONF_CPP_OPTS_STAGE2)
index 31329f5..6ae9807 100644 (file)
@@ -30,13 +30,22 @@ define distdir-way-opts # args: $1 = dir, $2 = distdir, $3 = way, $4 = stage
 #  Variable              Purpose                           Defined by
 #  --------------        ------------------------------    --------------
 #  $1_PACKAGE            Package name for this dir,        $1/$2/ghc.mk
-#                        if it is a package   
-#   
+#                        if it is a package
+#
 #  CONF_HC_OPTS          GHC options from ./configure      mk/config.mk.in
-#   
+#
+#  CONF_CPP_OPTS_STAGE$4 CPP options from ./configure      mk/config.mk.in
+#
+#  CONF_CC_OPTS_STAGE$4  C compiler options from           mk/config.mk.in
+#                        ./configure
+#
 #  CONF_HC_OPTS_STAGE$4  GHC options from ./configure      mk/config.mk.in
-#                        specific to stage $4   
-#   
+#                        specific to stage $4
+#
+#  CONF_LD_LINKER_OPTS_STAGE$4
+#                        GHC options from ./configure      mk/config.mk.in
+#                        specific to stage $4
+#
 #  WAY_$3_HC_OPTS        GHC options specific to way $3    mk/ways.mk
 #   
 #  SRC_HC_OPTS           source-tree-wide GHC options      mk/config.mk.in
@@ -82,7 +91,7 @@ define distdir-way-opts # args: $1 = dir, $2 = distdir, $3 = way, $4 = stage
 #                        source files   
 #   
 #  $1_$2_CPP_OPTS        CPP options                       $1/$2/package-data.mk
-#  
+#
 #  <file>_HC_OPTS        GHC options for this source       $1/$2/ghc.mk
 #                        file (without the extension)
 
@@ -193,7 +202,8 @@ $1_$2_$3_ALL_LD_OPTS = \
  $$($1_$2_DIST_LD_OPTS) \
  $$($1_$2_$3_LD_OPTS) \
  $$($1_$2_EXTRA_LD_OPTS) \
- $$(EXTRA_LD_OPTS)
+ $$(EXTRA_LD_OPTS) \
+ $$(CONF_LD_LINKER_OPTS_STAGE$4)
 
 # Options for passing to GHC when we use it for linking
 $1_$2_$3_GHC_LD_OPTS = \