[commit: ghc] master: fix linker_unload test for ghc configurations with --with-gmp-libraries (2b3c621)

git at git.haskell.org git at git.haskell.org
Thu Aug 7 07:49:10 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2b3c621685ec975e81ce82472f9a774791b14ac1/ghc

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

commit 2b3c621685ec975e81ce82472f9a774791b14ac1
Author: Karel Gardas <karel.gardas at centrum.cz>
Date:   Wed Aug 6 23:29:46 2014 +0200

    fix linker_unload test for ghc configurations with --with-gmp-libraries
    
    The issue is presented in Makefile logic where it attempts to start
    linker_unload and pass it HSinteger-gmp library for unload,
    but the library name is prefixed with two directories names. The first
    is of ghc's integer-gmp/build itself and another is the directory name
    passed to --with-gmp-libraries= configure parameter. The testcase then
    fails on unloading integer-gmp/build directory thinking that this is
    a library to unload. The issue is solved by cuting (head -1) the first
    library name from the list and using this for unloading the HSinteger-gmp
    library. I use head -1 instead of cut -d ' ' here since ghc may be
    installed into the directory with space(s) in its name like in the case
    when running validate.


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

2b3c621685ec975e81ce82472f9a774791b14ac1
 testsuite/tests/rts/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile
index 180fe9b..02a50a4 100644
--- a/testsuite/tests/rts/Makefile
+++ b/testsuite/tests/rts/Makefile
@@ -108,7 +108,11 @@ BASE_DIR = $(shell $(LOCAL_GHC_PKG) field base library-dirs | sed 's/^.*: *//')
 BASE_LIB = $(shell $(LOCAL_GHC_PKG) field base hs-libraries | sed 's/^.*: *//')
 GHC_PRIM_DIR = $(shell $(LOCAL_GHC_PKG) field ghc-prim library-dirs | sed 's/^.*: *//')
 GHC_PRIM_LIB = $(shell $(LOCAL_GHC_PKG) field ghc-prim hs-libraries | sed 's/^.*: *//')
-INTEGER_GMP_DIR = $(shell $(LOCAL_GHC_PKG) field integer-gmp library-dirs | sed 's/^.*: *//')
+# We need to get first library directory here in order to get rid of
+# system gmp library directory installation when ghc is configured
+# with --with-gmp-libraries=<dir> parameter
+INTEGER_GMP_DIR = $(shell $(LOCAL_GHC_PKG) field integer-gmp library-dirs \
+	| sed 's/^.*: *//' | head -1)
 INTEGER_GMP_LIB = $(shell $(LOCAL_GHC_PKG) field integer-gmp hs-libraries | sed 's/^.*: *//')
 
 BASE        = $(BASE_DIR)/lib$(BASE_LIB).a



More information about the ghc-commits mailing list