[Pkg-haskell-commits] darcs: ghc: Pass -fuse-ld=gold to gcc when used as alinker on arm (patches/use-gold-on-arm) and make sure this setting does not affect other parts (patches/saner-linker-opt-handling).

Joachim Breitner mail at joachim-breitner.de
Mon Dec 8 19:05:50 UTC 2014


Mon Dec  8 18:04:18 UTC 2014  Joachim Breitner <mail at joachim-breitner.de>
  * Pass -fuse-ld=gold to gcc when used as alinker on arm (patches/use-gold-on-arm) and make sure this setting does not affect other parts (patches/saner-linker-opt-handling).

    M ./changelog +3
    A ./patches/saner-linker-opt-handling
    M ./patches/series +2
    A ./patches/use-gold-on-arm

Mon Dec  8 18:04:18 UTC 2014  Joachim Breitner <mail at joachim-breitner.de>
  * Pass -fuse-ld=gold to gcc when used as alinker on arm (patches/use-gold-on-arm) and make sure this setting does not affect other parts (patches/saner-linker-opt-handling).
diff -rN -u old-ghc/changelog new-ghc/changelog
--- old-ghc/changelog	2014-12-08 19:05:50.723627442 +0000
+++ new-ghc/changelog	2014-12-08 19:05:50.751627438 +0000
@@ -6,6 +6,9 @@
     - linker-detection-fix
   * Replace patches/Fix-documentation-build-failure-without-GHCi.patch by the
     equivalent patch from GHC HEAD (./patches/TcSplice-no-GHCi-fix)
+  * Pass -fuse-ld=gold to gcc when used as alinker on arm
+    (patches/use-gold-on-arm) and make sure this setting does not affect other
+    parts (patches/saner-linker-opt-handling).
 
  -- Joachim Breitner <nomeata at debian.org>  Mon, 08 Dec 2014 18:46:19 +0100
 
diff -rN -u old-ghc/patches/saner-linker-opt-handling new-ghc/patches/saner-linker-opt-handling
--- old-ghc/patches/saner-linker-opt-handling	1970-01-01 00:00:00.000000000 +0000
+++ new-ghc/patches/saner-linker-opt-handling	2014-12-08 19:05:50.739627437 +0000
@@ -0,0 +1,78 @@
+On ARM, we want to make sure that GHC uses the gold linker.
+
+In order to achieve that, we need to get `-fuse-ld=gold` into
+SettingsCCompilerLinkFlags in the settings.
+
+This field is filled with only CONF_GCC_LINKER_OPTS_STAGE2. So we want that
+flag to show up there.
+
+But this variable is used in a few other cases (LDFLAGS, options to hsc2hs)
+where -fuse-ld=gold caused problems.
+(These problems were not investigated. Maybe _they_ could be solved?)
+
+So as a work-around we remove any other use of CONF_GCC_LINKER_OPTS_STAGE2.
+
+
+Index: ghc-7.8.3.20141119/libffi/ghc.mk
+===================================================================
+--- ghc-7.8.3.20141119.orig/libffi/ghc.mk	2014-04-07 20:26:08.000000000 +0200
++++ ghc-7.8.3.20141119/libffi/ghc.mk	2014-12-08 18:57:03.392339809 +0100
+@@ -88,7 +88,7 @@
+ 	    NM=$(NM) \
+ 	    RANLIB=$(REAL_RANLIB_CMD) \
+         CFLAGS="$(SRC_CC_OPTS) $(CONF_CC_OPTS_STAGE1) -w" \
+-        LDFLAGS="$(SRC_LD_OPTS) $(CONF_GCC_LINKER_OPTS_STAGE1) -w" \
++        LDFLAGS="$(SRC_LD_OPTS) -w" \
+         "$(SHELL)" ./configure \
+ 	          --prefix=$(TOP)/libffi/build/inst \
+ 	          --libdir=$(TOP)/libffi/build/inst/lib \
+Index: ghc-7.8.3.20141119/mk/config.mk.in
+===================================================================
+--- ghc-7.8.3.20141119.orig/mk/config.mk.in	2014-12-08 18:49:28.215171926 +0100
++++ ghc-7.8.3.20141119/mk/config.mk.in	2014-12-08 18:57:20.637055726 +0100
+@@ -570,7 +570,6 @@
+ # $1 = stage
+ SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --cflag=,$$(filter-out -O,$$(SRC_CC_OPTS) $$(CONF_CC_OPTS_STAGE$1)))
+ SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --cflag=,$$(CONF_CPP_OPTS_STAGE$1))
+-SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --lflag=,$$(CONF_GCC_LINKER_OPTS_STAGE$1))
+ endef
+ $(eval $(call set_stage_HSC2HS_OPTS,0))
+ $(eval $(call set_stage_HSC2HS_OPTS,1))
+Index: ghc-7.8.3.20141119/rules/build-package-data.mk
+===================================================================
+--- ghc-7.8.3.20141119.orig/rules/build-package-data.mk	2014-04-14 14:38:12.000000000 +0200
++++ ghc-7.8.3.20141119/rules/build-package-data.mk	2014-12-08 18:57:49.366250332 +0100
+@@ -50,7 +50,7 @@
+ # for a feature it may not generate warning-free C code, and thus may
+ # think that the feature doesn't exist if -Werror is on.
+ $1_$2_CONFIGURE_CFLAGS = $$(filter-out -Werror,$$(SRC_CC_OPTS)) $$(CONF_CC_OPTS_STAGE$3) $$($1_CC_OPTS) $$($1_$2_CC_OPTS) $$(SRC_CC_WARNING_OPTS)
+-$1_$2_CONFIGURE_LDFLAGS = $$(SRC_LD_OPTS) $$(CONF_GCC_LINKER_OPTS_STAGE$3) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)
++$1_$2_CONFIGURE_LDFLAGS = $$(SRC_LD_OPTS) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)
+ $1_$2_CONFIGURE_CPPFLAGS = $$(SRC_CPP_OPTS) $$(CONF_CPP_OPTS_STAGE$3) $$($1_CPP_OPTS) $$($1_$2_CPP_OPTS)
+ 
+ $1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$($1_$2_CONFIGURE_CFLAGS)"
+Index: ghc-7.8.3.20141119/rules/distdir-opts.mk
+===================================================================
+--- ghc-7.8.3.20141119.orig/rules/distdir-opts.mk	2014-04-07 20:26:08.000000000 +0200
++++ ghc-7.8.3.20141119/rules/distdir-opts.mk	2014-12-08 18:58:18.435461083 +0100
+@@ -64,7 +64,6 @@
+ endif
+ 
+ $1_$2_DIST_LD_OPTS = \
+- $$(CONF_GCC_LINKER_OPTS_STAGE$3) \
+  $$(SRC_LD_OPTS) \
+  $$($1_LD_OPTS) \
+  $$($1_$2_LD_OPTS) \
+Index: ghc-7.8.3.20141119/utils/hsc2hs/ghc.mk
+===================================================================
+--- ghc-7.8.3.20141119.orig/utils/hsc2hs/ghc.mk	2014-04-07 20:26:15.000000000 +0200
++++ ghc-7.8.3.20141119/utils/hsc2hs/ghc.mk	2014-12-08 18:57:07.848524715 +0100
+@@ -27,7 +27,7 @@
+ # system uses it for all stages and passes the right options for each stage
+ # on the command line
+ define utils/hsc2hs_dist-install_SHELL_WRAPPER_EXTRA
+-echo 'HSC2HS_EXTRA="$(addprefix --cflag=,$(CONF_CC_OPTS_STAGE1)) $(addprefix --lflag=,$(CONF_GCC_LINKER_OPTS_STAGE1))"' >> "$(WRAPPER)"
++echo 'HSC2HS_EXTRA="$(addprefix --cflag=,$(CONF_CC_OPTS_STAGE1))"' >> "$(WRAPPER)"
+ endef
+ 
+ ifneq "$(BINDIST)" "YES"
diff -rN -u old-ghc/patches/series new-ghc/patches/series
--- old-ghc/patches/series	2014-12-08 19:05:50.723627442 +0000
+++ new-ghc/patches/series	2014-12-08 19:05:50.739627437 +0000
@@ -8,3 +8,5 @@
 linker-detection-fix
 dll-split-fix.patch
 TcSplice-no-GHCi-fix
+saner-linker-opt-handling
+use-gold-on-arm
diff -rN -u old-ghc/patches/use-gold-on-arm new-ghc/patches/use-gold-on-arm
--- old-ghc/patches/use-gold-on-arm	1970-01-01 00:00:00.000000000 +0000
+++ new-ghc/patches/use-gold-on-arm	2014-12-08 19:05:50.743627437 +0000
@@ -0,0 +1,15 @@
+Index: ghc-7.8.3.20141119/aclocal.m4
+===================================================================
+--- ghc-7.8.3.20141119.orig/aclocal.m4	2014-12-08 18:49:28.207171714 +0100
++++ ghc-7.8.3.20141119/aclocal.m4	2014-12-08 19:03:06.815522917 +0100
+@@ -553,6 +553,10 @@
+         $3="$$3 -D_HPUX_SOURCE"
+         $5="$$5 -D_HPUX_SOURCE"
+         ;;
++    arm*)
++        # On arm, link using gold
++        $3="$$3 -fuse-ld=gold"
++        ;;
+     esac
+ 
+     # If gcc knows about the stack protector, turn it off.




More information about the Pkg-haskell-commits mailing list