summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Gardas <karel.gardas@centrum.cz>2014-08-04 08:10:11 -0500
committerAustin Seipp <austin@well-typed.com>2014-08-04 08:10:12 -0500
commit65e5dbcd3971cb3ef5b9073096e5d063034b90c1 (patch)
tree11adfa067c349c8319f0eefd167783d8a72f6652
parent637978fa8a7dae97ff67551cb9d5c8fc3ac0fa9d (diff)
downloadhaskell-65e5dbcd3971cb3ef5b9073096e5d063034b90c1.tar.gz
fix linker_unload test on Solaris/i386 platform
Summary: This patch set fixes two issues in linker_unload test case on Solaris/i386 platform. First there is an issue in linker_unload.c which causes warning to be emitted about _FILE_OFFSET_BITS redefined. This is solved by including ghcconfig.h as a first header file. Another issue is that on Solaris and its builders we use to configure ghc with --with-gmp-libraries=/usr/lib and this causes issue with test case Makefile's logic. 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. In case of Solaris this is /usr/lib. The testcase then fails on unloading integer-gmp/build directory thinking that this is a library to unload. This issue is solved by cuting the first library name from the list and using this for unloading the HSinteger-gmp library. Test Plan: validate Reviewers: ezyang, austin Reviewed By: ezyang, austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D110
-rw-r--r--testsuite/tests/rts/Makefile4
-rw-r--r--testsuite/tests/rts/linker_unload.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile
index 180fe9b5ee..8833d45743 100644
--- a/testsuite/tests/rts/Makefile
+++ b/testsuite/tests/rts/Makefile
@@ -108,7 +108,9 @@ 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/^.*: *//')
+# need to cut 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/^.*: *//' | cut -d ' ' -f -1)
INTEGER_GMP_LIB = $(shell $(LOCAL_GHC_PKG) field integer-gmp hs-libraries | sed 's/^.*: *//')
BASE = $(BASE_DIR)/lib$(BASE_LIB).a
diff --git a/testsuite/tests/rts/linker_unload.c b/testsuite/tests/rts/linker_unload.c
index 55870c348f..f1cc891df1 100644
--- a/testsuite/tests/rts/linker_unload.c
+++ b/testsuite/tests/rts/linker_unload.c
@@ -1,3 +1,4 @@
+#include "ghcconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include "Rts.h"