Summary: | sys-libs/glibc-2.27-r3 doesn't build on ~arm with CFLAGS="-mfpu=neon" | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Markus Meier <maekke> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | herrtimson, nrndda, slyfox |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://sourceware.org/bugzilla/show_bug.cgi?id=23273 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | sys-libs:glibc-2.27-r3:20180608-192307.log.gz |
Description
Markus Meier
![]() The link failure when ld is linked. ld should not contain early dependencies on libc (with memcpy) as ld is responsible for loading libc. glibc has a few ways to avoid external memcpy() calls. To shrink the failure space a bit: Things that work: - CFLAGS="-pipe -march=armv7-a -O2" - CFLAGS="-pipe -march=armv7-a -O2 -mfloat-abi=hard" Things that fail: - CFLAGS="-pipe -march=armv7-a -O2 -mfpu=neon" Only -mfpu=neon seems to affect gcc code generation in a way that triggers gcc to insert memcpy() call. Next step is to check how exactly code generation changes. For some reason string/rtld-memcpy.os is built only for non-neon case. Posted summary and patch to https://sourceware.org/bugzilla/show_bug.cgi?id=23273#c1 The outcome of https://sourceware.org/bugzilla/show_bug.cgi?id=23273#c7 is Gentoo needs to make sure ASFLAGS contain at least the same ABI flags of CFLAGS. Upstream glibc maintainers suggest passing flags to CPPFLAGS as those are used in all ASFLAGS contexts (and in some additionalpreprocessor contests). The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c3740323094626403ee2e57f4a0c5b1cb4f37bb commit 6c3740323094626403ee2e57f4a0c5b1cb4f37bb Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2018-06-13 20:45:58 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2018-06-13 20:46:38 +0000 sys-libs/glibc: fix -mfpu=neon build failure, bug #657760 CFLAGS=-mfpu=neon tricked glibc into not building memcpy() implementation. It's caused by the fact that -mfpu=neon was passed when building .c files, but was not passed when building .S files. This change passes CFLAGS to CPPFLAGS to apply to .S files. Reported-by: Markus Meier Closes: https://bugs.gentoo.org/657760 Bug: https://sourceware.org/PR23273 Package-Manager: Portage-2.3.40, Repoman-2.3.9 sys-libs/glibc/glibc-2.27-r4.ebuild | 1415 +++++++++++++++++++++++++++++++++++ sys-libs/glibc/glibc-9999.ebuild | 6 + 2 files changed, 1421 insertions(+) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ff56613857700dd0dfe2937539ae13fc3212eb4 commit 3ff56613857700dd0dfe2937539ae13fc3212eb4 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2018-06-26 07:54:33 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2018-06-26 09:48:14 +0000 sys-libs/glibc: pass user's CFLAGS over CC/XX, not CPPFLAGS Breakage example (before this change): # CFLAGS="-O2 -march=core2 -mno-sse4.2" emerge -v1 =glibc-2.27-r4 Here user's CFLAGS were able to override (this bug) glibc's CFLAGS additions like: sysdeps/i386/i686/multiarch/Makefile:CFLAGS-strspn-c.c += -msse4 'strspn' was built as 'gcc -msse4 -mno-sse4.2' and failed: smmintrin.h:631:1: error: inlining failed in call to always_inline ‘_mm_cmpistri’: target specific option mismatch This happens because we passed user's CFLAGS via CPPFLAGS: Makerules:COMPILE.c = $(CC) -c $(CFLAGS) $(CPPFLAGS) To avoid this kind of overrides this change injects user's CFLAGS into CC/CXX. Above example will use 'gcc -mno-sse4.2 -msse4' order. Reported-by: Philipp Psurek Bug: https://bugs.gentoo.org/657760 Closes: https://bugs.gentoo.org/659030 Package-Manager: Portage-2.3.40, Repoman-2.3.9 sys-libs/glibc/glibc-2.27-r5.ebuild | 1418 +++++++++++++++++++++++++++++++++++ sys-libs/glibc/glibc-9999.ebuild | 16 +- 2 files changed, 1426 insertions(+), 8 deletions(-) |