Commit 65e5dbcd authored by kgardas's avatar kgardas Committed by Austin Seipp
Browse files

fix linker_unload test on Solaris/i386 platform

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:
parent 637978fa
......@@ -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/^.*: *//')
#include "ghcconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include "Rts.h"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment