| Summary: | Failed building valgrind (memcheck) for Linux powerpc32 (undefined reference to `__floatsidf') with recent gcc | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Christophe Leroy <christophe.leroy> |
| Component: | memcheck | Assignee: | Julian Seward <jseward> |
| Status: | REPORTED --- | ||
| Severity: | critical | ||
| Priority: | NOR | ||
| Version First Reported In: | 3.19.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Christophe Leroy
2022-08-10 09:55:31 UTC
Looking at gcc history, I found: commit e610393ca76b204d861177a9ec542e2b4b3956cb Author: Joseph Myers <joseph@codesourcery.com> Date: Thu Oct 30 17:28:30 2014 +0000 Make soft-fp symbols into compat symbols for powerpc*-*-linux*. Continuing preparations for implementing TARGET_ATOMIC_ASSIGN_EXPAND_FENV for powerpc*-*-linux* soft-float and e500, this patch makes soft-fp symbols used for those targets into compat symbols when building with glibc >= 2.19, so that they are only in shared libgcc for existing binaries requiring them, not in static libgcc and not available for new links using shared libgcc. Instead, new links will get the symbols from libc, which has exported all of them since 2.19. .... I understand that: - libc is required to get those symbols. - valgrind is intentionaly linked without libc but with libgcc only (from comments in coregrind/m_main.c) John Reiser suggested a work-around (see below). That doesn't work, I ended up pulling the entire glibc objects and got conflicts with other symbols, I gave up.
2. Possible work-around: Extract the missing functions from libc.a
into separate *.o files:
__floatsidf.o, __muldf3.o, __ltdf2.o, __fixdfsi.o, etc.
Use something like these commands:
# See if what you want really is in libc.a
nm -gop libc.a | grep -E '__floatsidf|__muldf3|__ltdf2|__fixdfsi'
# See the actual components of the libc.a archive
ar t libc.a
# Extract the files that you want
ar x libc.a __floatsidf.o __muldf3.o __ltdf2.o __fixdfsi.o
Then add those *.o filenames to the command line for 'ld'.
I was previously using glibc 2.23 and it was working perfectly as glibc 2.23 provides those missing symbols I was previously using glibc 2.23 with gcc 5 and it was working perfectly as the symbols where present in libgcc. With gcc 11 and glibc 2.35 it doesn't work anymore because the symbols are not anymore in libgcc. |