Summary: | dev-libs/libbsd-0.8.6 fails nlist testcase on sparc | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Rolf Eike Beer <eike> |
Component: | Current packages | Assignee: | Freedesktop bugs <freedesktop-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | sparc |
Priority: | Normal | Keywords: | TESTFAILURE |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/gentoo/gentoo/pull/7446 https://bugs.gentoo.org/show_bug.cgi?id=937917 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 630340 | ||
Attachments: | strace log |
Description
Rolf Eike Beer
![]() Could you please run "strace ./test/nlist" from the build directory, and attach the resulting output. I guess this is the part you are interested in: open("./work/libbsd-0.8.6-.sparc32/test/.libs/nlist", O_RDONLY|O_LARGEFILE) = 3 _llseek(3, 0, [0], SEEK_SET) = 0 read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\2\0\22\0\0\0\1\0\1\6@\0\0\0004\0\0'\274\0\0\1\0\0004\0 \0\10\0(\0\34\0\33", 52) = 52 close(3) = 0 fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 3), ...}) = 0 brk(NULL) = 0x26000 brk(0x48000) = 0x48000 (In reply to Rolf Eike Beer from comment #2) > I guess this is the part you are interested in: You guessed wrong. Created attachment 499018 [details]
strace log
Ok, I don't see what I was looking for (open() == -1). This is some deeper issue with the symbol table processing code. This looks as if it could be related: https://cgit.freedesktop.org/libbsd/commit/?id=9ceac74e91411d3f7dbbc42d772f3500c47c7cec Fails the same on 0.8.7. My guess is that it's because the compiler is compiling for V8+ i.e. 32-bit V9, rather than a lower baseline. V8+ has a different e_machine (EM_SPARC32PLUS) to standard sparc32 (EM_SPARC), but src/local-elf.h currently looks like: #if defined(__arch64__) #define ELF_TARG_MACH EM_SPARCV9 #define ELF_TARG_CLASS ELFCLASS64 #else #define ELF_TARG_MACH EM_SPARC #define ELF_TARG_CLASS ELFCLASS32 #endif I should think this can be fixed by changing it to: #if defined(__arch64__) #define ELF_TARG_MACH EM_SPARCV9 #define ELF_TARG_CLASS ELFCLASS64 #else #if defined(__sparc_v9__) #define ELF_TARG_MACH EM_SPARC32PLUS #else #define ELF_TARG_MACH EM_SPARC #endif #define ELF_TARG_CLASS ELFCLASS32 #endif Unfortunately this only works for Linux; on Solaris, the only difference I can se between V8 and non-V8+ is whether __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* are defined; there's no v9 (or v8plus) macro available. That's an issue for upstream though, and this is a strict improvement. I can confirm that this makes the tests green (based on 0.8.7). The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6ef75dadb937aec325a57e51d046d7c2e1eec57 commit a6ef75dadb937aec325a57e51d046d7c2e1eec57 Author: Rolf Eike Beer <eike@sf-mail.de> AuthorDate: 2018-03-13 15:44:01 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2018-03-21 22:07:43 +0000 dev-libs/libbsd: fix ELF machine type for 32 bit sparc Bug: https://bugs.gentoo.org/634550 Package-Manager: Portage-2.3.24, Repoman-2.3.6 RepoMan-Options: --include-arches="sparc" Closes: https://github.com/gentoo/gentoo/pull/7446 dev-libs/libbsd/files/libbsd-0.8.6-sparc.patch | 32 ++++++++++++++++++++++++++ dev-libs/libbsd/libbsd-0.8.6.ebuild | 4 ++++ dev-libs/libbsd/libbsd-0.8.7.ebuild | 4 ++++ 3 files changed, 40 insertions(+)} |