Summary: | dev-libs/boost-1.65.0: missing linkage to libatomic on sparc (undefined reference to `__atomic_fetch_sub_4') | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Rolf Eike Beer <eike> |
Component: | Current packages | Assignee: | C++ Team [disbanded] <cpp+disabled> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | office, x86 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | Sparc64 | ||
OS: | Linux | ||
URL: | https://github.com/boostorg/build/issues/338 | ||
See Also: | https://github.com/gentoo/gentoo/pull/9802 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 544378, 644808 | ||
Attachments: | build.log |
Description
Rolf Eike Beer
2018-01-31 19:11:30 UTC
Also affects 1.63.0. The problem is tools/build/src/tools/gcc.{py,jam}: here Boost tries to guess which CPU it has to use and adds a -mcpu flag for it. It does not know about anything newer than ultrasparc3 (like my niagara2), so it adds it's default: v7. That one has only byte-wise atomics, so int-wise things wont work with that instruction set. It's end up calling this: "sparc-unknown-linux-gnu-g++" -O2 -mcpu=niagara2 -pipe -std=c++14 -finline-functions -Wno-inline -Wall -mcpu=v7 -pthread -m32 -DBOO ... I have no idea why it does all this cpu detection, I think entirely removing it would do no harm (at least not on sparc). I meanwhile managed to get it working. All you need to do is to remove the "default=True" from /usr/share/boost-build/tools/gcc.py and " : default" from /usr/share/boost-build/tools/gcc.jam (no idea which one is the right one, I just did both). This causes the build system to not add "-mcpu=v7" when it can't determine the CPU. This also affects x86 as the only other arch: /usr/share/boost-build/tools/gcc.py:cpu_flags('gcc', 'OPTIONS', 'x86', 'i686', ['-march=i686'], default=True) The setting for sparc is entirely bogus: v7 is the gcc default anyway, and all CPUs since 1995 (!) are v9 ones. So I guess these default settings should just be removed, at least in Gentoo, but probably just upstream. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68b4b694543cddeb2f33115f5581403d1187fe3f commit 68b4b694543cddeb2f33115f5581403d1187fe3f Author: Rolf Eike Beer <eike@sf-mail.de> AuthorDate: 2018-09-07 18:57:31 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2018-09-16 21:28:40 +0000 dev-util/boost-build: add patch to unbreak compiler options on sparc Boost tries to autodetect the processor architecture and overrides any flags set with CXXFLAGS with the -mcpu value it thinks it is appropiate. Sadly the most recent architecture it knows of is ultrasparc3. For every newer cpu type it falls back to it's default, which is v7 (which would be the compiler default anyway). This avoids any advanced cpu instructions, e.g. those that support atomic operations on thing larger than a byte. Remove the whole outdated cruft and just use whatever the user passed in. Closes: https://bugs.gentoo.org/646234 Closes: https://github.com/gentoo/gentoo/pull/9802 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Package-Manager: Portage-2.3.40, Repoman-2.3.9 dev-util/boost-build/boost-build-1.62.0-r1.ebuild | 1 + dev-util/boost-build/boost-build-1.63.0.ebuild | 1 + dev-util/boost-build/boost-build-1.65.0.ebuild | 1 + dev-util/boost-build/boost-build-1.66.0.ebuild | 1 + dev-util/boost-build/boost-build-1.67.0.ebuild | 1 + ...boost-build-1.62.0-sparc-no-default-flags.patch | 47 ++++++++++++++++++++++ 6 files changed, 52 insertions(+) |