Skip to content

ghc-7.8-rc1/HEAD: --enable-unregisterised fails to build and run with threaded RTS, profiling mode

Steps to reproduce:

0. Pick any platform. I've performed it on amd64, but seen real failures on unreg arches: ia64, ppc64
1. pull sources
2. ./boot
3. ./configure --enable-unregisterised
# right, no build.mk
4. make

Here we see 2 kinds of bugs at once:

  1. threaded RTS misses -DNOSMP define. Looks like ghc always needs

to carry that define (what is the mechanism for it BTW?), it

doesn't:

  HC [stage 1] compiler/stage2/build/ExtsCompat46.o

In file included from /home/slyfox/dev/git/ghc/includes/Stg.h:232:0:
    0,
                     from /tmp/ghc6527_0/ghc6527_2.hc:3:

/home/slyfox/dev/git/ghc/includes/stg/Regs.h:443:2:
     error: #error BaseReg must be in a register for THREADED_RTS
     #error BaseReg must be in a register for THREADED_RTS
      ^

The implicit declarations are scary as well:

/tmp/ghc1420_0/ghc1420_2.hc: In function 'c7WZ_entry':

/tmp/ghc1420_0/ghc1420_2.hc:43:1:
     warning: implicit declaration of function 'hs_bswap64' [-Wimplicit-function-declaration]
     _c7X5 = hs_bswap64(*((P_)(R1.w+7)));
     ^

I naively tried naive approach:

mk/config.mk.in:

+# Unregisterised build calls c compiler for every
+# .hs file. thus pass it everywhere.
+ifneq "$(GhcWithSMP)" "YES"
+SRC_HC_OPTS += -optc-DNOSMP
+endif

but got stage2, which always SIGSEGVs. Thus it's either incorrect fix or UNREG is broken.

  1. profiling builds (all files with -prof) miss enterFunCCS declaration:
/tmp/ghc7183_0/ghc7183_1.p_hc: In function 's6Y_entry':

/tmp/ghc7183_0/ghc7183_1.p_hc:79:40:
     error: 'enterFunCCS' undeclared (first use in this function)
     ghcFunPtr = ((void (*)(void *, void *))enterFunCCS);
                                            ^
Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited by Sergei Trofimovich
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information