HEAD bootstrap error macOS

Gabor Greif ggreif at gmail.com
Mon Dec 23 22:38:02 UTC 2019


This is a clean tree. Modulo
```
$ diff -u mk/build.mk.sample mk/build.mk
--- mk/build.mk.sample	2019-12-07 20:44:48.850209944 +0100
+++ mk/build.mk	2019-11-27 14:18:57.052582066 +0100
@@ -20,7 +20,7 @@
 #BuildFlavour = perf-cross-ncg

 # Fast build with optimised libraries, no profiling (RECOMMENDED):
-#BuildFlavour = quick
+BuildFlavour = quick
```

I see
```
$ grep CC_LLVM_BACKEND config*
config.log:| #define CC_LLVM_BACKEND 1
```

Yes this is with clang-9, but it also happened with clang-7.

I'll try to track this down. The TLS tip is good.

Thanks,

     Gabor

On 12/23/19, Ben Gamari <ben at smart-cactus.org> wrote:
> Gabor Greif <ggreif at gmail.com> writes:
>
>> Recently I started getting following error:
>> ```
>> [nix-shell:~/ghc]$ "inplace/bin/ghc-stage1" -optc-Wall -optc-Wall
>> -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes
>> -optc-Wmissing-declarations -optc-Winline -optc-Wpointer-arith
>> -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls
>> -optc-Wno-aggregate-return -optc-Iincludes -optc-Iincludes/dist
>> -optc-Iincludes/dist-derivedconstants/header
>> -optc-Iincludes/dist-ghcconstants/header
>> -optc-Iincludes/dist-install/build -optc-Irts -optc-Irts/dist/build
>> -optc-DCOMPILING_RTS -optc-DFS_NAMESPACE=rts -optc-fno-strict-aliasing
>> -optc-fno-common -optc-DDTRACE -optc-Irts/dist/build/./autogen
>> -optc-Wno-unknown-pragmas -optc-O2 -optc-fomit-frame-pointer -optc-g
>> -optc-DRtsWay=\"rts_thr\" -static -optc-DTHREADED_RTS  -O0 -H64m -Wall
>>   -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header
>> -Iincludes/dist-ghcconstants/header -Iincludes/dist-install/build
>> -Irts -Irts/dist/build -DCOMPILING_RTS -DFS_NAMESPACE=rts
>> -this-unit-id rts -dcmm-lint  -DDTRACE     -i -irts -irts/dist/build
>> -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen
>>            -O2 -Wcpp-undef    -Wnoncanonical-monad-instances  -c
>> rts/sm/Scav_thr.c -o rts/dist/build/sm/Scav_thr.thr_o -v
>> Glasgow Haskell Compiler, Version 8.11.0.20191222, stage 1 booted by
>> GHC version 8.6.5
>> *** initializing package database:
>> Using binary package database:
>> /Users/ggreif/ghc/inplace/lib/package.conf.d/package.cache
>> package flags []
>> loading package database /Users/ggreif/ghc/inplace/lib/package.conf.d
>> wired-in package ghc-prim mapped to ghc-prim-0.6.1
>> wired-in package integer-wired-in mapped to integer-gmp-1.0.2.0
>> wired-in package base mapped to base-4.14.0.0
>> wired-in package rts mapped to rts
>> wired-in package template-haskell mapped to template-haskell-2.16.0.0
>> wired-in package ghc mapped to ghc-8.11.0.20191222
>> !!! initializing package database: finished in 8.51 milliseconds,
>> allocated 8.770 megabytes
>> Created temporary directory:
>> /var/folders/39/lr50t0q96tx5qp0mzht34r240000gn/T/ghc55616_0
>> *** systool:cc:
>> *** C Compiler:
>> /nix/store/mq8dqgqf2qqkp77pzf3jwc05px8rkbny-clang-wrapper-9.0.0/bin/cc
>> -x c rts/sm/Scav_thr.c -o
>> /var/folders/39/lr50t0q96tx5qp0mzht34r240000gn/T/ghc55616_0/ghc_1.s
>> -fno-common -U__PIC__ -D__PIC__ -Wimplicit -S -O2 -include
>> /Users/ggreif/ghc/includes/ghcversion.h -Iincludes -Iincludes/dist
>> -Iincludes/dist-derivedconstants/header
>> -Iincludes/dist-ghcconstants/header -Iincludes/dist-install/build
>> -Irts -Irts/dist/build -Irts/dist/build -Irts/dist/build/./autogen
>> -I/Users/ggreif/ghc/libraries/base/include
>> -I/Users/ggreif/ghc/libraries/base/dist-install/build/include
>> -I/Users/ggreif/ghc/libraries/base/dist-install/build/dist-install/build/include
>> -I/Users/ggreif/ghc/libraries/integer-gmp/include
>> -I/Users/ggreif/ghc/libraries/integer-gmp/dist-install/build/include
>> -I/Users/ggreif/ghc/libraries/integer-gmp/dist-install/build/dist-install/build/include
>> -I/Users/ggreif/ghc/rts/dist/build -I/Users/ggreif/ghc/includes
>> -I/Users/ggreif/ghc/includes/dist-derivedconstants/header
>> -I/Users/ggreif/ghc/includes/dist-install/build -Xpreprocessor
>> -DCOMPILING_RTS -Xpreprocessor '-DFS_NAMESPACE=rts' -Xpreprocessor
>> -DDTRACE -Wall -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes
>> -Wmissing-declarations -Winline -Wpointer-arith -Wmissing-noreturn
>> -Wnested-externs -Wredundant-decls -Wno-aggregate-return -Iincludes
>> -Iincludes/dist -Iincludes/dist-derivedconstants/header
>> -Iincludes/dist-ghcconstants/header -Iincludes/dist-install/build
>> -Irts -Irts/dist/build -DCOMPILING_RTS '-DFS_NAMESPACE=rts'
>> -fno-strict-aliasing -fno-common -DDTRACE -Irts/dist/build/./autogen
>> -Wno-unknown-pragmas -O2 -fomit-frame-pointer -g '-DRtsWay="rts_thr"'
>> -DTHREADED_RTS
>>
>> In file included from rts/sm/Scav_thr.c:3:0: error:
>>
>> In file included from rts/sm/Scav.c:51:0: error:
>>
>> In file included from rts/sm/GCUtils.h:18:0: error:
>>
>> rts/sm/GCTDecl.h:113:1: error:
>>      error: register '%r13' unsuitable for global register variables
>> on this target
>>     |
>> 113 | GCT_REG_DECL(gc_thread*, gct, REG_Base);
>>     | ^
>> GCT_REG_DECL(gc_thread*, gct, REG_Base);
>> ^
> Hmmm, this is quite odd. Is this a clean tree? Have you pulled without
> re-./booting and ./configure'ing recently? Are you using Apple's Clang?
>
> In short, we shouldn't be using a register variable at all on OS X
> (since Apple's Clang doesn't support register variables, as this error
> suggests). Rather, we use TLS. This is implemented here [1]. Perhaps
> check what value configure computed for CC_LLVM_BACKEND?
>
> Cheers,
>
> - Ben
>
>
> [1] https://gitlab.haskell.org/ghc/ghc/blob/master/rts/sm/GCTDecl.h#L69
>


More information about the ghc-devs mailing list