[coreboot] [PATCH] libgcc regparm workaround

Stefan Reinauer stepan at coresystems.de
Sat Sep 26 17:43:06 CEST 2009


Segher Boessenkool wrote:
>> programs that are compiled with non-default regparm values are
>> miscompiled if they use libgcc.
>> This patch works around the problem for coreboot.
>
> Please mention the GCC bugreport # in the source near every workaround;
> that way, you can one day get rid of it.  This is PR41055.
>
>>  makerule coreboot_ram.o
>>      depends    "src/arch/$(CONFIG_ARCH)/lib/c_start.o $(DRIVER)
>> coreboot.a $(LIBGCC_FILE_NAME)"
>> -    action    "$(CC) $(DISTRO_LFLAGS) -nostdlib -r -o $@
>> src/arch/$(CONFIG_ARCH)/lib/c_start.o $(DRIVER) -Wl,-\( coreboot.a
>> $(LIBGCC_FILE_NAME) -Wl,-\)"
>> +    action    "$(CC) $(DISTRO_LFLAGS) -nostdlib -r -o $@
>> src/arch/$(CONFIG_ARCH)/lib/c_start.o $(DRIVER) -Wl,--wrap,__divdi3
>> -Wl,--wrap,__udivdi3 -Wl,--wrap,__moddi3 -Wl,--wrap,__umoddi3 -Wl,-\(
>> coreboot.a $(LIBGCC_FILE_NAME) -Wl,-\)"
>>  end
>
> You don't need the -( -) here, FWIW.  libgcc does not require symbols
> from
> coreboot.a ;-) 
Yes, actually it does. On powerpc libgcc uses external symbols that it
does not provide.

Stefan







More information about the coreboot mailing list