Summary: | sys-libs/compiler-rt-sanitizers-9.0.1 with sys-libs/glibc-2.31 - .../work/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:1131:1: error: 'assertion_failed__1131' declared as an array with a negative size | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mike Lothian <mike> |
Component: | Current packages | Assignee: | LLVM support project <llvm> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ago, agrigo2001, alex, aliaksei.urbanski, anton.kochkov, ao, candrews, chris, herrtimson, luke-jr+gentoobugs, mail, mgorny, nrndda, ostroffjh, phobosk, toralf, vmatare+gbug, waebbl-gentoo, zeekec |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=727762 | ||
Whiteboard: | fixed in 10 | ||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 708318 | ||
Attachments: |
Build log
Patch for glibc-2.31 Fixes the compilation issue with glibc 2.31 Patch to adjust sys-libs/compiler-rt-sanitizers-9.0.1 for glibc 2.31+ |
Description
Mike Lothian
2020-02-05 23:58:06 UTC
Created attachment 612052 [details]
Build log
Created attachment 612054 [details, diff]
Patch for glibc-2.31
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cc.o /usr/lib/llvm/9/bin/x86_64-pc-linux-gnu-clang++ -DHAVE_RPC_XDR_H=0 -I/var/tmp/portage/sys-libs/compiler-rt-sanitizers-9.0.1/work/compiler-rt/lib/sanitizer_common/.. -O3 -march=native -pipe -Wall -std=c++11 -Wno-unused-parameter -m32 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cc.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cc.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizer CommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cc.o -c /var/tmp/portage/sys-libs/compiler-rt-sanitizers-9.0.1/work/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc /var/tmp/portage/sys-libs/compiler-rt-sanitizers-9.0.1/work/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:1131:1: error: 'assertion_failed__1131' declared as an array with a negative size CHECK_SIZE_AND_OFFSET(ipc_perm, mode); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-libs/compiler-rt-sanitizers-9.0.1/work/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1437:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET' COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-libs/compiler-rt-sanitizers-9.0.1/work/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30: note: expanded from macro 'COMPILER_CHECK' #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/sys-libs/compiler-rt-sanitizers-9.0.1/work/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:57: note: expanded from macro 'IMPL_COMPILER_ASSERT' typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1] ^~~~~~~~~~~~~~~ 1 error generated. Thanks, I'll backport it now. Actually, it doesn't apply cleanly and it seems that getting full set of patches is not worth the effort. Just use 10.x if you need bleeding edge glibc. *** Bug 710800 has been marked as a duplicate of this bug. *** Created attachment 618030 [details, diff] Fixes the compilation issue with glibc 2.31 As a quick workaround Taken from: http://www.linuxfromscratch.org/blfs/view/svn/general/llvm.html (In reply to Frits Letteboer from comment #7) > Created attachment 618030 [details, diff] [details, diff] > Fixes the compilation issue with glibc 2.31 > > As a quick workaround > > Taken from: http://www.linuxfromscratch.org/blfs/view/svn/general/llvm.html I confirm that this patch solves the problem. *** Bug 720222 has been marked as a duplicate of this bug. *** (In reply to Michał Górny from comment #5) > Actually, it doesn't apply cleanly and it seems that getting full set of > patches is not worth the effort. Just use 10.x if you need bleeding edge > glibc. It's said that some packages are broken with LLVM 10, in other distros as well — bug 711788. app-doc/doxygen has RDEPEND="clang? ( <sys-devel/clang-10:= )", so we should either get rid of that or continue to support clang:9. This issue also happens to compiler-rt-sanitizers:8.0.1 *** Bug 733378 has been marked as a duplicate of this bug. *** I also confirm that the patch from Frits Letteboer solves the problem I Confirm that patch from Frits Letteboer solves compilation problem and I'm able to build sys-libs/compiler-rt-sanitizers-9.0.1. However I believe disabling check is not the best way fixing it. We need to wait for upstream to fix it. the patch from Frits Letteboer fixes the compile for me too *** Bug 744877 has been marked as a duplicate of this bug. *** glibc 2.31 is stable now... would be nice to have a path forward? (In reply to Michał Górny from comment #5) > Just use 10.x if you need bleeding edge glibc. 10.x what? This build still fails with LLVM/Clang 10 installed. llvm/clang is a whole toolchain and some of the ebuilds have slots, others don't. compiler-rt-sanitizers has slots, which means you have to emerge =compiler-rt-sanitizers-10.0.x to match your llvm/clang-10 toolchain. I thought this was obvious? personally I whished the provided patch was backported, but I can see that ressources for testing are limited. I thus removed USE="sanitize" from my llvm:9 and wait a bit longer for llvm-10.0.1 to be stable on all relevant arches (In reply to Craig Andrews from comment #8) > I confirm that this patch solves the problem. Are you sure it doesn't simply remove compile-time sanity checks? Looks like with this patch, big endian platforms (other than MIPS, aarch64, and s390x) will break at runtime (ie, when performing the actual sanitizer checks)... Created attachment 662686 [details, diff]
Patch to adjust sys-libs/compiler-rt-sanitizers-9.0.1 for glibc 2.31+
This patch is an actual backport of the relevant changes in version 10.
Disclaimer: This does remove functionality from (and perhaps breaks sanitizer use with) systems with older glibc versions (2.30 and earlier); but with a current glibc, I think it should work. Untested.
(In reply to Luke-Jr from comment #21) > Created attachment 662686 [details, diff] [details, diff] > Patch to adjust sys-libs/compiler-rt-sanitizers-9.0.1 for glibc 2.31+ > > This patch is an actual backport of the relevant changes in version 10. Works for me, thanks! Many packages still have not adapted t Many packages have not yet adapted to LLVM/Clang 10, so we still need to keep 9 around in the mean time. If there are no objections, I will apply the patch by Luke Jr to 9.0.1 in a new revision. Michał, what do you think? (In reply to Guilherme Amadio from comment #24) > Many packages have not yet adapted to LLVM/Clang 10, so we still need to > keep 9 around in the mean time. If there are no objections, I will apply the > patch by Luke Jr to 9.0.1 in a new revision. Michał, what do you think? Just make sure to put it into files/9.0.1/ directory. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2741567d6f7fb139c8ad37137fb581987a779e97 commit 2741567d6f7fb139c8ad37137fb581987a779e97 Author: Guilherme Amadio <amadio@gentoo.org> AuthorDate: 2020-12-19 14:07:38 +0000 Commit: Guilherme Amadio <amadio@gentoo.org> CommitDate: 2021-01-07 13:59:40 +0000 sys-libs/compiler-rt-sanitizers: fix for glibc 2.31+, bug #708430 Closes: https://bugs.gentoo.org/708430 Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Guilherme Amadio <amadio@gentoo.org> .../compiler-rt-sanitizers-9.0.1-r1.ebuild | 160 +++++++++++++++++++++ .../files/9.0.1/glibc-2.31.patch | 35 +++++ 2 files changed, 195 insertions(+) |