Skip to content

gcc-sh-elf-newlib build fails for GCC 10.1 #33

Open
@michalsieron

Description

@michalsieron

CI in #31 revealed, that gcc-newlib-sh-linux step is failing (run#3651807217).

There seems to a problem with duplicate _errno symbols (see line 65617 of logs).

Here it is cleaned up a little bit:

$PREFIX/sh-elf/bin/ld:
  $PREFIX/sh-elf/lib/libc.a(lib_a-syscalls.o):(.bss+0x0): multiple definition of `_errno';
  $PREFIX/sh-elf/lib/libc.a(lib_a-reent.o):(.bss+0x0): first defined here

Below is a comparison of *_errno symbols in newlib libc compiled with GCC 9.2 and GCC 10.1:

$ # GCC 9.2
$ sh-elf-nm -g sh-elf/lib/libc.a | grep _errno | sort | uniq -c
     20          U ___errno
     17          U _errno
      1 00000000 T ___errno
      2 00000004 C _errno
$ # GCC 10.1
$ sh-elf-nm -g sh-elf/lib/libc.a | grep _errno | sort | uniq -c
     20          U ___errno
     17          U _errno
      2 00000000 B _errno
      1 00000000 T ___errno

Looks like _errnos are in BSS and not in COMMON section.

I'm pretty confident, that this is a reason: https://wiki.gentoo.org/wiki/Project:Toolchain/Gcc_10_porting_notes/fno_common

Although neither adding CFLAGS=-fcommon in make call or before configure seems to help.

For this reason we skip the gcc-sh-elf-newlib-linux for now, but it needs to be repaired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions