Commit 4dec7d19 authored by Peter Trommler's avatar Peter Trommler 🥁 Committed by Ben Gamari

Testsuite: Skip failing tests on PowerPC 64-bit

The Power ISA says the result of a division by zero is undefined.  So
ignore stdout on PowerPC 64-bit systems.

Disable ext-interp tests on 64-bit PowerPC.  We don't have support for
PowerPC 64-bit ELF in the RTS linker, which is needed for the external

Test Plan: ./validate

Reviewers: austin, simonmar, hvr, erikd, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:
parent 88f5add0
......@@ -262,6 +262,18 @@ AC_ARG_ENABLE(unregisterised,
dnl ** Does target have runtime linker support?
dnl --------------------------------------------------------------
case "$target" in
# Requires FPTOOLS_SET_PLATFORM_VARS to be run first.
......@@ -192,7 +192,7 @@ else
ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le aarch64)))
# 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))
......@@ -78,7 +78,13 @@
#if defined(dragonfly_HOST_OS)
#include <sys/tls.h>
Note [runtime-linker-support]
When adding support for a new platform to the runtime linker please
update `$TOP/` 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
This phase may transition an ObjectCode from `OBJECT_LOADED` to `OBJECT_RESOLVED`
......@@ -399,6 +399,10 @@ ocVerifyImage_ELF ( ObjectCode* oc )
case EM_IA_64: IF_DEBUG(linker,debugBelch( "ia64" )); break;
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",
return 0;
#ifdef EM_X86_64
case EM_X86_64: IF_DEBUG(linker,debugBelch( "x86_64" )); break;
#elif defined(EM_AMD64)
......@@ -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@")
......@@ -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('\\', '/')
......@@ -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'])
......@@ -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)]),
......@@ -9,8 +9,9 @@ def f(name, opts):
# TH should work with -fexternal-interpreter too
if config.have_ext_interp :
test('TH_mkName', normal, compile, ['-v0'])
test('TH_1tuple', normal, compile_fail, ['-v0'])
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