#1343: HEAD build failure with assember errors about "8 byte pc-relative
relocation"
-----------------------+----------------------------------------------------
Reporter: duncan | Owner:
Type: bug | Status: new
Priority: high | Milestone: 6.8
Component: Compiler | Version: 6.7
Severity: normal | Keywords:
Difficulty: Unknown | Os: Linux
Testcase: | Architecture: x86_64 (amd64)
-----------------------+----------------------------------------------------
When building HEAD (7/5/07) on x86-64 Gentoo Linux with binutils-2.16.1 we
get an error when stage1 is compiling the rts:
{{{
../compiler/ghc-inplace -H16m -O -optc-O2 -static -I. -#include
HCIncludes.h -fvia-C -dcmm-lint -c StgMiscClosures.cmm -o
StgMiscClosures.o
/tmp/ghc27655_0/ghc27655_0.s: Assembler messages:
/tmp/ghc27655_0/ghc27655_0.s:434:0:
Error: can not do 8 byte pc-relative relocation
}}}
And 8 more errors of the same form later in the file. Looking at the
generated .s file we see the offending lines are of the form:
{{{
.globl stg_DEAD_WEAK_info
.type stg_DEAD_WEAK_info, @object
.size stg_DEAD_WEAK_info, 24
.quad cv_str - stg_DEAD_WEAK_info // offending line
}}}
cv_str is defined a few lines earlier in the .rodata section, while .globl
stg_DEAD_WEAK_info is defined in the .text section.
In the .hc file it looked like:
{{{
static char cv_str[] = "DEAD_WEAK";
static char cx_str[] = "DEAD_WEAK object entered!";
StgWord stg_DEAD_WEAK_info[] = {
((W_)&cv_str+0), 0x400000000UL, 0x1UL
};
}}}
which became:
{{{
cv_str:
.string "DEAD_WEAK"
.section .rodata
.align 8
.type cx_str, @object
.size cx_str, 26
cx_str:
.string "DEAD_WEAK object entered!"
.text
.align 8
.globl stg_DEAD_WEAK_info
.type stg_DEAD_WEAK_info, @object
.size stg_DEAD_WEAK_info, 24
.quad cv_str - stg_DEAD_WEAK_info
.quad 17179869184
.quad 1
}}}
It's interesting to note that this assembler output was of course
generated by gcc (version 4.1.1).
(Ian asked me to mark this bug as high priorty for 6.8)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1343>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs