Bug 24966 - multiple definition of `__fixdfdi' (and other floating point functions)
Summary: multiple definition of `__fixdfdi' (and other floating point functions)
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: 2.29
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-04 22:00 UTC by Chris Packham
Modified: 2019-09-05 09:11 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
Dockerfile to reproduce issue (437 bytes, text/plain)
2019-09-04 22:00 UTC, Chris Packham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Packham 2019-09-04 22:00:26 UTC
Created attachment 11976 [details]
Dockerfile to reproduce issue

Hi,

A crosstool-ng user reported a problem building for powerpc64le-unknown-linux-gnu.

https://github.com/crosstool-ng/crosstool-ng/issues/1227

The issue boils down to

/home/x-tool/.build/powerpc64le-unknown-linux-gnu/buildtools/lib/gcc/powerpc64le-unknown-linux-gnu/8.3.0/../../../../powerpc64le-unknown-linux-gnu/bin/ld: /home/x-tool/.build/powerpc64le-unknown-linux-gnu/buildtools/lib/gcc/powerpc64le-unknown-linux-gnu/8.3.0/libgcc.a(ppc64-fp.o): in function `__fixdfdi':
/home/x-tool/.build/powerpc64le-unknown-linux-gnu/src/gcc/libgcc/config/rs6000/ppc64-fp.c:57: multiple definition of `__fixdfdi'; /home/x-tool/.build/powerpc64le-unknown-linux-gnu/build/build-libc-final/multilib/libc_pic.os:/home/x-tool/.build/src/glibc-2.29/soft-fp/fixdfdi.c:36: first defined here
/home/x-tool/.build/powerpc64le-unknown-linux-gnu/buildtools/lib/gcc/powerpc64le-unknown-linux-gnu/8.3.0/../../../../powerpc64le-unknown-linux-gnu/bin/ld: /home/x-tool/.build/powerpc64le-unknown-linux-gnu/buildtools/lib/gcc/powerpc64le-unknown-linux-gnu/8.3.0/libgcc.a(ppc64-fp.o): in function `__fixsfdi':
/home/x-tool/.build/powerpc64le-unknown-linux-gnu/src/gcc/libgcc/config/rs6000/ppc64-fp.c:65: multiple definition of `__fixsfdi'; /home/x-tool/.build/powerpc64le-unknown-linux-gnu/build/build-libc-final/multilib/libc_pic.os:/home/x-tool/.build/src/glibc-2.29/soft-fp/fixsfdi.c:36: first defined here
... (more errors for other floating point functions)

It looks like we've ended up with multiple floating point libraries selected conflicting with each other. If we change to glibc-2.28 the build succeeds.

I've attached a Dockerfile that can be used to demonstrate the issue.
Comment 1 jsm-csl@polyomino.org.uk 2019-09-04 23:22:06 UTC
You'll need to find why the soft-fp functions got built into glibc.  Only 
sysdeps/powerpc/nofpu/Makefile and sysdeps/nios2/Makefile add them to the 
build, and there's no such thing as soft-float powerpc64, either 
endianness (see the list of supported glibc ABIs at 
<https://sourceware.org/glibc/wiki/ABIList>).  So what went wrong with the 
configure tests distinguishing hard and soft float to cause inappropriate 
sysdeps directories to be used?
Comment 2 Chris Packham 2019-09-04 23:56:57 UTC
Looks like 2.30 doesn't have the same problem. Skimming the history I don't see anything obvious.
Comment 3 Chris Packham 2019-09-05 01:02:35 UTC
Somewhere along the line with_fp_cond gets set to 0 in the configure process.

snippet from config.log

configure:3865: checking for use of fpu sysdeps directories
conftest.c:4:3: error: #error "no hardware floating point"
 # error "no hardware floating point"
   ^~~~~
configure:3884: result: no

As Joseph said this should be true for powerpc64. sysdeps/powerpc/preconfigure only sets this in the 32-bit case. I wonder if one of the other preconfigure scripts is setting this to 0 unconditionally.
Comment 4 Chris Packham 2019-09-05 01:16:20 UTC
I think the problem is actually due to a non-upstream patch that crosstool-NG is carrying for ARC. This ends up modifying with_fp_cond for all architectures (not just arc).
Comment 5 Chris Packham 2019-09-05 01:44:45 UTC
I'm marking this as resolved/worksforme since the bug is actually due to a downstream patch.