[LLVMdev] building cross llvm-gcc for new target

james woodyatt jhwoodyatt at mac.com
Thu May 1 08:38:35 PDT 2008


On Apr 30, 2008, at 23:19, james woodyatt wrote:
>
> I'm trying to build LLVM-GCC as a cross-compiler for a new target.
> [...]
> I get errors trying to build from crtbegin.o, and they look like this
> (replacing the long temporary filename with crtstuff.s):
>
>> crtstuff.s: Assembler messages:
>> crtstuff.s:66: Error: internal_relocation (type: OFFSET_IMM) not  
>> fixed up
[...]
>> make[3]: *** [crtbegin.o] Error 1
>> make[2]: *** [extra] Error 2
>> make[1]: *** [stmp-multilib] Error 2
>> make: *** [all-gcc] Error 2

The first of these errors above happens on the line in the excerpt  
below with the ldr instruction.

> 	.align	2
> call___do_global_dtors_aux:
> 	stmfd sp!, {r4, lr}
> 	@ InlineAsm Start
> 		.section	.fini
> 	@ InlineAsm End
> 	ldr r3, .LCPI2_0

I'm trying not to get distracted by what seems to be the oddness of  
changing the section in the middle of a function block, because it  
looks like this is precisely how CRT_CALL_STATIC_FUNCTION is designed  
to work.  Okay, I can roll with that, but I think this is a clue.

> # define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC)	\
> static void __attribute__((__used__))			\
> call_ ## FUNC (void)					\
> {							\
> asm (SECTION_OP);					\
> FUNC ();						\
> FORCE_CODE_SECTION_ALIGN				\
> asm (TEXT_SECTION_ASM_OP);				\
> }


Hmmm.  That is one *cryptic* error message the assembler is  
generating, isn't it?


—
j h woodyatt <jhw at conjury.org>
http://jhw.vox.com/

-- 
j h woodyatt <jhw at conjury.org>






More information about the llvm-dev mailing list