Opened 2 years ago

Closed 2 years ago

#5634 closed bug (fixed)

compilation error (Mac OS X Lion, Xcode 4.2): LLVM cannot handle register variable ‘R1’

Reported by: guest Owned by:
Priority: normal Milestone: 7.4.1
Component: Runtime System Version: 7.3
Keywords: StgCRun.c LLVM Lion Xcode-4.2 Cc: coreyoconnor@…
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: Building GHC failed Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo)

I tried building ghc-7.2.2 on Mac OS X 10.7.2 (Lion) x86_64-apple-darwin with Xcode 4.2.
gcc is version 4.2.1; bootstrapping with ghc-7.0.4.

The configure script default /usr/bin/gcc-4.2 failed configure. (It is actually broken on my system, now that I check.) So I explicitly tried the LLVM-backended gcc, which is the usual default gcc on this system, and got an LLVM-related error compiling StgCRun.c that said "report me":

$ CC=/usr/bin/llvm-gcc-4.2 ./configure
...
$ make
...
"inplace/bin/ghc-stage1" -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -optc-Irts -optc-DCOMPILING_RTS -optc-fno-strict-aliasing -optc-fno-common -optc-Ilibffi/build/include -optc-DDTRACE -optc-fomit-frame-pointer -optc-DRtsWay=\"rts_v\" -optc-w   -H32m -O -Iincludes -Irts -DCOMPILING_RTS -package-name rts  -dcmm-lint  -Ilibffi/build/include -DDTRACE     -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen           -optc-O2   -c rts/StgCRun.c -o rts/dist/build/StgCRun.o
In file included from includes/Stg.h:230,

                 from rts/StgCRun.c:70:0:

includes/stg/Regs.h:177:0:
     sorry, unimplemented: LLVM cannot handle register variable ‘R1’, report a bug
make[1]: *** [rts/dist/build/StgCRun.o] Error 1
make: *** [all] Error 2

Change History (5)

comment:1 Changed 2 years ago by CoreyOConnor

  • Cc coreyoconnor@… added
  • Summary changed from ghc-7.2.2 compilation error (Mac OS X Lion, Xcode 4.2): LLVM cannot handle register variable ‘R1’ to compilation error (Mac OS X Lion, Xcode 4.2): LLVM cannot handle register variable ‘R1’
  • Version changed from 7.2.1 to 7.3

reproduced with HEAD.

comment:2 Changed 2 years ago by CoreyOConnor

compiler version info:

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

comment:3 Changed 2 years ago by igloo

  • Description modified (diff)

comment:4 Changed 2 years ago by igloo

  • Milestone set to 7.6.1

comment:5 Changed 2 years ago by simonmar

  • Milestone changed from 7.6.1 to 7.4.1
  • Resolution set to fixed
  • Status changed from new to closed

I pulled in David Piexotto's patches recently which should fix this. However, you really don't want to use llvm-gcc for now if you can help it, because the performance of the GC is much worse than when compiled with gcc. Commits:

dba7254566b121408e7167200d0223a531b66e8b
6247b59e5d31de58ee51273916bc44ac2118240a

Note: See TracTickets for help on using tickets.