Created attachment 472640 [details, diff] glibc-2.25-sh-fix-gcc6.patch The relevant snippet from build log: [1] Upstream has already fixed build failure in glibc-git as: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d40dbe722f004f999b589de776f7e57e564dda01 I confirm this patch fixes glibc building for me as well. I tested 2.24 and 2.25 as: --- a/sys-libs/glibc/glibc-2.24-r1.ebuild +++ b/sys-libs/glibc/glibc-2.24-r1.ebuild @@ -121,6 +121,7 @@ src_prepare() { cd "${S}" epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838 + epatch "${FILESDIR}"/2.25/${PN}-2.25-sh-fix-gcc6.patch if use hardened ; then # We don't enable these for non-hardened as the output is very terse -- Resulting binaries also work using qemu-sh4. [1]: build failure: sh4-unknown-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -nostdlib -nostartfiles -r -o /tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/build-default-sh4-unknown-linux-gnu-nptl/elf/librtld.map.o '-Wl,-(' /tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/build-default-sh4-unknown-linux-gnu-nptl/elf/dl-allobjs.os /tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/build-default-sh4-unknown-linux-gnu-nptl/libc_pic.a -lgcc '-Wl,-)' -Wl,-Map,/tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/build-default-sh4-unknown-linux-gnu-nptl/elf/librtld.mapT /tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/build-default-sh4-unknown-linux-gnu-nptl/libc_pic.a(init-first.os):(.data+0x0): multiple definition of `__libc_multiple_libcs' /tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/build-default-sh4-unknown-linux-gnu-nptl/elf/dl-allobjs.os:(.bss+0x74): first defined here /tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/build-default-sh4-unknown-linux-gnu-nptl/libc_pic.a(_itoa.os): In function `_itoa': _itoa.c:(.text+0xd4): multiple definition of `_itoa' /tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/build-default-sh4-unknown-linux-gnu-nptl/elf/dl-allobjs.os:(.text+0x136b8): first defined here collect2: error: ld returned 1 exit status make[2]: *** [Makefile:342: /tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/build-default-sh4-unknown-linux-gnu-nptl/elf/librtld.map] Error 1 make[2]: Leaving directory '/tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/glibc-2.23/elf' make[1]: *** [Makefile:215: elf/subdir_lib] Error 2 make[1]: Leaving directory '/tmp/portage/cross-sh4-unknown-linux-gnu/glibc-2.23-r3/work/glibc-2.23' make: *** [Makefile:9: all] Error 2
Fixed in 2.24 and 2.25 commit dc2c28a7d39a02e89a438815b5fbad0261c6a901 Author: Matthias Maier <tamiko@gentoo.org> Date: Wed Jun 14 17:35:21 2017 -0500 sys-libs/glibc: version 2.25, update to patchset 4 Package-Manager: Portage-2.3.6, Repoman-2.3.2 commit 2187adcceef17b0df8b35f31f1a9841ccf59de30 Author: Matthias Maier <tamiko@gentoo.org> Date: Wed Jun 14 17:21:46 2017 -0500 sys-libs/glibc: version 2.24, update to patchset 7 Package-Manager: Portage-2.3.6, Repoman-2.3.2