Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 618506 - cross-sh4-unknown-linux-gnu/glibc fails to build with gcc-5: libc_pic.a(init-first.os):(.data+0x0): multiple definition of `__libc_multiple_libcs'
Summary: cross-sh4-unknown-linux-gnu/glibc fails to build with gcc-5: libc_pic.a(init-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2017-05-15 08:42 UTC by Sergei Trofimovich (RETIRED)
Modified: 2017-06-14 22:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
glibc-2.25-sh-fix-gcc6.patch (glibc-2.25-sh-fix-gcc6.patch,1.05 KB, patch)
2017-05-15 08:42 UTC, Sergei Trofimovich (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2017-05-15 08:42:41 UTC
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
Comment 1 Matthias Maier gentoo-dev 2017-06-14 22:53:19 UTC
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