summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac12
-rw-r--r--mk/config.mk.in2
-rw-r--r--rts/Linker.c20
-rw-r--r--rts/linker/Elf.c4
-rw-r--r--settings.in1
-rw-r--r--testsuite/config/ghc3
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T3
-rw-r--r--testsuite/tests/rts/all.T4
-rw-r--r--testsuite/tests/th/all.T5
9 files changed, 41 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index 0312aed44c..3ccaf1ef58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -262,6 +262,18 @@ AC_ARG_ENABLE(unregisterised,
)
AC_SUBST(Unregisterised)
+dnl ** Does target have runtime linker support?
+dnl --------------------------------------------------------------
+case "$target" in
+ powerpc64-*|powerpc64le-*|powerpc-ibm-aix*)
+ HaskellHaveRTSLinker=NO
+ ;;
+ *)
+ HaskellHaveRTSLinker=YES
+ ;;
+esac
+AC_SUBST(HaskellHaveRTSLinker)
+
# Requires FPTOOLS_SET_PLATFORM_VARS to be run first.
FP_FIND_ROOT
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 5141ccf724..5f50d87a1d 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -192,7 +192,7 @@ else
ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le aarch64)))
endif
-# The THREADED_RTS requites `BaseReg` to be in a register and the
+# The THREADED_RTS requires `BaseReg` to be in a register and the
# `GhcUnregisterised` mode doesn't allow that.
GhcWithSMP := $(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO))
diff --git a/rts/Linker.c b/rts/Linker.c
index 07d9e6c346..9462bdbbcc 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -78,7 +78,13 @@
#if defined(dragonfly_HOST_OS)
#include <sys/tls.h>
#endif
-
+/*
+ Note [runtime-linker-support]
+ -----------------------------
+ When adding support for a new platform to the runtime linker please
+ update `$TOP/configure.ac` under heading `Does target have runtime
+ linker support?`.
+ */
/* `symhash` is a Hash table mapping symbol names to RtsSymbolInfo.
This hashtable will contain information on all symbols
that we know of, however the .o they are in may not be loaded.
@@ -99,7 +105,7 @@
This is to enable lazy loading of symbols. Eager loading is problematic
as it means that all symbols must be available, even those which we will
- never use. This is especially painful of Windows, where the number of
+ never use. This is especially painful on Windows, where the number of
libraries required to link things like mingwex grows to be quite high.
We proceed through these stages as follows,
@@ -108,12 +114,12 @@
perform a quick scan/indexing of the ObjectCode. All the work
required to actually load the ObjectCode is done.
- All symbols from the ObjectCode is also inserted into
+ All symbols from the ObjectCode are also inserted into
`symhash`, where possible duplicates are handled via the semantics
described in `ghciInsertSymbolTable`.
This phase will produce ObjectCode with status `OBJECT_LOADED` or `OBJECT_NEEDED`
- depending on whether they are an archive members or not.
+ depending on whether they are an archive member or not.
* During initialization we load ObjectCode, perform relocations, execute
static constructors etc. This phase may trigger other ObjectCodes to
@@ -131,10 +137,10 @@
This phase will produce ObjectCode with status `OBJECT_RESOLVED` if
the previous status was `OBJECT_NEEDED`.
- * Lookup symbols is used to lookup any symbols required, both during initial
+ * lookupSymbols is used to lookup any symbols required, both during initial
link and during statement and expression compilations in the REPL.
- Declaration of e.g. an foreign import, will eventually call lookupSymbol
- which will either fail (symbol unknown) or succeed (and possibly triggered a
+ Declaration of e.g. a foreign import, will eventually call lookupSymbol
+ which will either fail (symbol unknown) or succeed (and possibly trigger a
load).
This phase may transition an ObjectCode from `OBJECT_LOADED` to `OBJECT_RESOLVED`
diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c
index 4672a5bc5e..f836912091 100644
--- a/rts/linker/Elf.c
+++ b/rts/linker/Elf.c
@@ -399,6 +399,10 @@ ocVerifyImage_ELF ( ObjectCode* oc )
case EM_IA_64: IF_DEBUG(linker,debugBelch( "ia64" )); break;
#endif
case EM_PPC: IF_DEBUG(linker,debugBelch( "powerpc32" )); break;
+ case EM_PPC64: IF_DEBUG(linker,debugBelch( "powerpc64" ));
+ errorBelch("%s: RTS linker not implemented on PowerPC 64-bit",
+ oc->fileName);
+ return 0;
#ifdef EM_X86_64
case EM_X86_64: IF_DEBUG(linker,debugBelch( "x86_64" )); break;
#elif defined(EM_AMD64)
diff --git a/settings.in b/settings.in
index 7ec1c26028..04b913b86c 100644
--- a/settings.in
+++ b/settings.in
@@ -26,6 +26,7 @@
("target has GNU nonexec stack", "@HaskellHaveGnuNonexecStack@"),
("target has .ident directive", "@HaskellHaveIdentDirective@"),
("target has subsections via symbols", "@HaskellHaveSubsectionsViaSymbols@"),
+ ("target has RTS linker", "@HaskellHaveRTSLinker@"),
("Unregisterised", "@Unregisterised@"),
("LLVM llc command", "@SettingsLlcCommand@"),
("LLVM opt command", "@SettingsOptCommand@")
diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index b9991d7729..b126580863 100644
--- a/testsuite/config/ghc
+++ b/testsuite/config/ghc
@@ -165,6 +165,9 @@ def get_compiler_info():
s = re.sub('[\r\n]', '', s)
rtsInfoDict = dict(eval(s))
+ # external interpreter needs RTS linker support
+ config.have_ext_interp = compilerInfoDict["target has RTS linker"] == "YES"
+
# See Note [Replacing backward slashes in config.libdir].
config.libdir = compilerInfoDict['LibDir'].replace('\\', '/')
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index 08ae3a2e87..d448a12d9f 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -97,7 +97,8 @@ test('ghci056',
test('ghci057', normal, ghci_script, ['ghci057.script'])
test('ghci060', normal, ghci_script, ['ghci060.script'])
test('ghci061', normal, ghci_script, ['ghci061.script'])
-test('ghci062', extra_ways(['ghci-ext']), ghci_script, ['ghci062.script'])
+test('ghci062', when(config.have_ext_interp, extra_ways(['ghci-ext'])),
+ ghci_script, ['ghci062.script'])
test('T2452', normal, ghci_script, ['T2452.script'])
test('T2766', normal, ghci_script, ['T2766.script'])
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index a3b16f07b9..cf8e90419e 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -46,8 +46,8 @@ test('divbyzero',
# do not generate an exception (interrupt) for integer
# division by zero but the result is undefined.
# C programs compiled with gcc exit normally, so do we.
- when(platform('powerpc64-unknown-linux'), exit_code(0)),
- when(platform('powerpc64le-unknown-linux'), exit_code(0)),
+ when(platform('powerpc64-unknown-linux'), [ignore_stdout, exit_code(0)]),
+ when(platform('powerpc64le-unknown-linux'), [ignore_stdout, exit_code(0)]),
when(opsys('mingw32'), exit_code(1)),
# The output under OS X is too unstable to readily compare
when(platform('i386-apple-darwin'), [ignore_stderr, exit_code(136)]),
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 66a7a9fc87..cc9fa4dc96 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -9,8 +9,9 @@ def f(name, opts):
setTestOpts(f)
setTestOpts(req_interp)
# TH should work with -fexternal-interpreter too
-setTestOpts(extra_ways(['ext-interp']))
-setTestOpts(only_ways(['normal','ghci','ext-interp']))
+if config.have_ext_interp :
+ setTestOpts(extra_ways(['ext-interp']))
+ setTestOpts(only_ways(['normal','ghci','ext-interp']))
test('TH_mkName', normal, compile, ['-v0'])
test('TH_1tuple', normal, compile_fail, ['-v0'])