File ghc-suse-as-needed.patch of Package ghc

Index: ghc-7.6.3/aclocal.m4
===================================================================
--- ghc-7.6.3.orig/aclocal.m4
+++ ghc-7.6.3/aclocal.m4
@@ -465,6 +465,13 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
         $4="$$4     $LdReduceMemoryOverheads"
     fi
 
+    # Do not add RUNPATH tag whe linking. See trac #7062
+    if test -n "$LdDisableNewDtags"
+    then
+	$3="$$3 -Wl,$LdDisableNewDtags"
+	$4="$$4     $LdDisableNewDtags"
+    fi
+
     rm -f conftest.c conftest.o
     AC_MSG_RESULT([done])
 ])
@@ -894,6 +901,17 @@ FP_PROG_LD_FLAG([--reduce-memory-overhea
 ])# FP_PROG_LD_ReduceMemoryOverheads
 
 
+# FP_PROG_LD_DisableNewDtags
+# ------------
+# Sets the output variable LdDisableNewDtags to
+# --disable-new-dtags if ld supports this flag.
+# Otherwise the variable's value is empty.
+AC_DEFUN([FP_PROG_LD_DisableNewDtags],
+[
+FP_PROG_LD_FLAG([--disable-new-dtags],[LdDisableNewDtags])
+])# FP_PROG_LD_DisableNewDtags
+
+
 # FP_PROG_LD_BUILD_ID
 # ------------
 
Index: ghc-7.6.3/configure.ac
===================================================================
--- ghc-7.6.3.orig/configure.ac
+++ ghc-7.6.3/configure.ac
@@ -597,6 +597,8 @@ FP_CC_LLVM_BACKEND
 
 FP_PROG_LD_HashSize31
 FP_PROG_LD_ReduceMemoryOverheads
+dnl  Check if RUNPATH can be disabled (#7062) 
+FP_PROG_LD_DisableNewDtags
 
 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])
openSUSE Build Service is sponsored by