[OpenBIOS] Some encountered issues when compiling openbios on a ppc64 host

Blue Swirl blauwirbel at gmail.com
Thu Jan 21 18:30:23 CET 2010


On Wed, Jan 20, 2010 at 5:46 PM, Blue Swirl <blauwirbel at gmail.com> wrote:
> On Tue, Jan 19, 2010 at 8:59 PM, Stefan Reinauer <stepan at openbios.org> wrote:
>> On 1/19/10 8:00 PM, Blue Swirl wrote:
>>>> But frankly, the better solution would be to drop our libgcc copy and use
>>>> that of gcc again... It was a design mistake to let our own copy sneak in.
>>>>
>>> I disagree. Having our own libgcc makes OpenBIOS independent of any
>>> installed libc headers of the host.
>> libgcc and libc headers have nothing to do with each other. libgcc is
>> part of gcc, and any gcc without libgcc is to be considered an
>> incomplete toolchain.
>>> You can also use target-elf/-eabi
>>> cross-compilers, which are easier to build than for example
>>> target-linux.
>> Yes, but if those are built correctly, they still come with libgcc. If
>> they don't, it makes more sense to file a bug report with the toolchain
>> provider than to duplicate parts of the toolchain in openbios.
>
> The problem was with older 3.x (maybe early 4.x) series in
> cross-compile mode, so bug reports may not help.
>
>>> At least for Sparc32/64, the administrative burden has
>>> not been very big, though I don't know about PPC.
>>>
>> The administrative burden is higher than using a complete toolchain...
>> Who is supplying gcc without libgcc anyways?
>
> Some numbers: there were just 12 commits regarding libgcc since r4 (!)
> introduced it in 2006, some of them were generic cleanups.
>
>>> This is the same approach as taken by Linux.
>>>
>> Not a very good argument. libgcc is part of gcc. So there is no reason
>> to duplicate it in any project. This is not some OS dependency like
>> crt0.o but very gcc intrinsic.
>
> If we decide to only support new GCCs, I guess libgcc support could be
> dropped. Maybe it's OK after all, for example I don't have the buggy
> 3.x versions of the cross-compilers anymore. With the 4.2.4 version
> which I'm using, there is a libgcc.a for all target architectures.
>

This patch would remove libgcc, however PPC needs some work:

  LINK  openbios-qemu.elf
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o): In function `__eabi':
/src/gcc/gcc-4.2.4/obj-amd64/gcc/eabi.S:232: undefined reference to `__init'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x4):
undefined reference to `_SDA_BASE_'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x8):
undefined reference to `__SDATA_START__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0xc):
undefined reference to `__SBSS_END__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x10):
undefined reference to `_SDA2_BASE_'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x14):
undefined reference to `__SDATA2_START__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x18):
undefined reference to `__SBSS2_END__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x1c):
undefined reference to `__GOT_START__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x28):
undefined reference to `__GOT_END__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x2c):
undefined reference to `__GOT2_START__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x30):
undefined reference to `__GOT2_END__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x34):
undefined reference to `__FIXUP_START__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x38):
undefined reference to `__FIXUP_END__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x3c):
undefined reference to `__CTOR_LIST__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x40):
undefined reference to `__CTOR_END__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x44):
undefined reference to `__DTOR_LIST__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x48):
undefined reference to `__DTOR_END__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x4c):
undefined reference to `__EXCEPT_START__'
/usr/local/lib/gcc/powerpc-elf/4.2.4/libgcc.a(eabi.o):(.got2+0x50):
undefined reference to `__EXCEPT_END__'
make[1]: *** [openbios-qemu.elf] Error 1

Probably the linker script or some .S files must be tweaked.

Sparc32/64 and amd64 unix versions compile and work.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Remove-libgcc.patch
Type: application/mbox
Size: 34928 bytes
Desc: not available
URL: <http://lists.openbios.org/pipermail/openbios/attachments/20100121/63456799/attachment-0001.bin>


More information about the OpenBIOS mailing list