[PATCH, IA64] Fix building a bare-metal ia64 compiler

Bernd Edlinger bernd.edlinger@hotmail.de
Wed Dec 16 15:35:00 GMT 2015



On 16.12.2015 05:59, Bernd Edlinger wrote:
> Hi,
>
> On 16.12.2015 00:55 Bernd Schmidt wrote:
>> On 12/15/2015 10:13 PM, Bernd Edlinger wrote:
>>> due to recent discussion on the basic asm, and the special handling
>>> of ASM_INPUT in ia64, I tried to build a bare-metal cross-compiler
>>> for ia64, but that did not work, because it seems to be impossible to
>>> build it without having a stdlib.h.
>>
>> Actually David Howells has complained to me about this as well, it 
>> seems to be a problem when building a toolchain for kernel compilation.
>
> yes.  I am not sure, if this is also problematic, when building a 
> cross-glibc,
> then I need also a cross C compiler first, build glibc, and install .h 
> and objects
> to the sysroot, then I build gcc again, with all languages.
>
>>
>>> With the attached patch, I was finally able to build the cross
>>> compiler, by declaring abort in the way as it is done already in many
>>> other places at libgcc.
>>
>> Can you just use __builtin_abort ()? Ok with that change.
>>
>
> I will try, but ./config/ia64/unwind-ia64.c includes this header,
> and it also uses abort () at many places.  So I'd expect warnings
> there.
>
>

OK, no new warnings, because tsystem.h defines a prototype of abort.

=> checked in as r231697.

But I see that unwind-ia64.c does not only use abort, but also malloc and
free too.

If I see that right, the stack walk will crash if malloc fails. What happens
on this target, if new throws out_of_memory?

I think this function should be rewritten to use alloca instead.
(I have an idea how this could be done, but no way to test a patch :(


Bernd.



More information about the Gcc-patches mailing list