Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 496478

Summary: sys-devel/llvm-{3.3-r2,9999} with USE=debug uses alternative C++ ABI
Product: Gentoo Linux Reporter: Maciej Piechotka <uzytkownik2>
Component: EclassesAssignee: Michał Górny <mgorny>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: nikoli, williamh, wizardedit
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-December/068994.html
Whiteboard:
Package list:
Runtime testing required: ---

Description Maciej Piechotka 2013-12-30 11:25:12 UTC
USE=debug makes development easier for LLVM as there are additional checks. While it is known that it changes ABI (lack of llvm::DebugInfo etc.) this one took me a while to find out what's going on.

The problem is that llvm is compiled with _GLIBCXX_DEBUG which chooses for example std::__debug::vector in place of std::vector. The problem is when it crosses API boundary the size does not match (and probably layout as well). This means that at least the cmake modules should add it to defines or (even better) the define should be removed from ebuild to allow interop with other C++ libraries. This can be done by disabling expensive checks in LLVM.

Michał: If I shouldn't add you to CC please tell me (I assumed it will make the bug wranglers live easier) - I've just seen you are working on llvm ebuild a lot recently and that you started discussing the build system with upstream.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-30 11:31:15 UTC
Wait... so USE=debug actually works? I always assumed it eats all your RAMs and disk space, and fails hard at everything (tests esp.).

As far as I'm concerned, we can just mask USE=debug with an explanatory message. I don't see any other real solution here.
Comment 2 Maciej Piechotka 2013-12-30 11:37:21 UTC
(In reply to Michał Górny from comment #1)
> Wait... so USE=debug actually works? I always assumed it eats all your RAMs
> and disk space, and fails hard at everything (tests esp.).
> 

Well - at least the cmake install I used to have for cmake modules worked. My guess would be that at least some problems and inefficiencies could be gone after disabling expensive checks (I can check - give me an hour or so to test). clang also seems to work just fine.

> As far as I'm concerned, we can just mask USE=debug with an explanatory
> message. I don't see any other real solution here.

I see your point - I'd be disappointed as without USE=debug the build system on my side would need to be hacked to work in debug build.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-30 12:39:13 UTC
(In reply to Maciej Piechotka from comment #2)
> > As far as I'm concerned, we can just mask USE=debug with an explanatory
> > message. I don't see any other real solution here.
> 
> I see your point - I'd be disappointed as without USE=debug the build system
> on my side would need to be hacked to work in debug build.

Well, you could just unmask the flag :). Otherwise, it's one of the cases where we don't have any tools to solve this.
Comment 4 Maciej Piechotka 2013-12-30 13:34:36 UTC
With following patch on ebuild:

# diff -d /usr/portage/sys-devel/llvm/llvm-3.3-r2.ebuild /usr/local/portage/sys-devel/llvm/llvm-3.3-r2.ebuild    
190c190
<               $(use_enable debug expensive-checks)
---
>               --disable-expensive-checks
321,322c321,322
<               pax-mark m Debug+Asserts+Checks/bin/llvm-rtdyld
<               pax-mark m Debug+Asserts+Checks/bin/lli
---
>               pax-mark m Debug+Asserts/bin/llvm-rtdyld
>               pax-mark m Debug+Asserts/bin/lli

I've got following failures:
 - LLVM :: Analysis/ScalarEvolution/2008-11-18-Stride2.ll
 - LLVM :: Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll
 - LLVM :: Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll
 - LLVM :: CodeGen/ARM/2010-06-21-nondarwin-tc.ll
 - LLVM :: CodeGen/ARM/2011-06-16-TailCallByVal.ll
 - LLVM :: CodeGen/ARM/peephole-bitcast.ll
 - LLVM :: CodeGen/Mips/2008-07-15-SmallSection.ll
 - LLVM :: CodeGen/Mips/2008-08-08-bswap.ll
 - LLVM :: CodeGen/Mips/2008-08-03-fabs64.ll
 - LLVM :: CodeGen/Mips/cprestore.ll
 - LLVM :: CodeGen/Mips/global-pointer-reg.ll
 - LLVM :: CodeGen/Mips/gprestore.ll
 - LLVM :: CodeGen/PowerPC/2008-07-10-SplatMiscompile.ll
 - LLVM :: CodeGen/PowerPC/Atomics-64.ll
 - LLVM :: CodeGen/PowerPC/2008-10-17-AsmMatchingOperands.ll (U)
 - LLVM :: CodeGen/Thumb2/thumb2-call-tc.ll
 - LLVM :: CodeGen/Thumb2/thumb2-ifcvt1-tc.ll
 - LLVM :: CodeGen/Thumb2/thumb2-rev16.ll
 - LLVM :: CodeGen/X86/2009-04-16-SpillerUnfold.ll (U)
 - LLVM :: CodeGen/X86/2009-08-06-inlineasm.ll
 - LLVM :: CodeGen/X86/20090313-signext.ll
 - LLVM :: CodeGen/X86/asm-modifier-P.ll
 - LLVM :: CodeGen/X86/change-compare-stride-1.ll
 - LLVM :: CodeGen/X86/cvtv2f32.ll
 - LLVM :: CodeGen/X86/lsr-reuse.ll
 - LLVM :: CodeGen/X86/remat-scalar-zero.ll
 - LLVM :: CodeGen/X86/umul-with-carry.ll
 - LLVM :: CodeGen/X86/zext-sext.ll
 - LLVM :: MC/ARM/neont2-vld-encoding.s
 - LLVM :: MC/ARM/neont2-vst-encoding.s
 - LLVM :: MC/AsmParser/directive_lsym.s
 - LLVM :: MC/COFF/seh.s
 - LLVM :: MC/COFF/seh-section.s
 - LLVM :: MC/Disassembler/ARM/invalid-VQADD-arm.txt
 - LLVM :: MC/Disassembler/ARM/invalid-VST2b32_UPD-arm.txt
 - LLVM :: MC/Disassembler/ARM/invalid-t2LDREXD-thumb.txt
 - LLVM :: MC/Disassembler/ARM/invalid-t2STRD_PRE-thumb.txt
 - LLVM :: MC/Disassembler/ARM/invalid-t2STREXB-thumb.txt
 - LLVM :: MC/Mips/elf-bigendian.ll
 - LLVM :: MC/Mips/higher_highest.ll
 - LLVM :: MC/Mips/sym-offset.ll
 - LLVM :: Object/objdump-file-header.test
 - LLVM :: Transforms/BBVectorize/simple-ldstr-ptrs.ll
 - LLVM :: Transforms/GVN/rle-no-phi-translate.ll
 - LLVM :: Transforms/IndVarSimplify/loop_evaluate10.ll
 - LLVM :: Transforms/IndVarSimplify/loop_evaluate9.ll
 - LLVM :: Transforms/IndVarSimplify/loop_evaluate_6.ll
 - LLVM :: Transforms/Inline/dynamic_alloca_test.ll
 - LLVM :: Transforms/MergeFunc/fold-weak.ll
 - LLVM :: Transforms/PhaseOrdering/PR6627.ll
 - LLVM :: Transforms/Reassociate/2012-05-08-UndefLeak.ll
 - LLVM :: Transforms/TailCallElim/nocapture.ll
 - LLVM :: Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll (U)
 - LLVM :: tools/llvm-lit/chain.c
 - Clang :: ARCMT/GC-check-warn-nsalloc.m
 - Clang :: Analysis/outofbound-notwork.c
 - Clang :: Analysis/string-fail.c
 - Clang :: CXX/basic/basic.lookup/basic.lookup.qual/p6-0x.cpp
 - Clang :: CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp
 - Clang :: CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
 - Clang :: CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp
 - Clang :: CXX/temp/temp.param/p14.cpp
 - Clang :: CXX/temp/temp.res/temp.dep.res/temp.point/p1.cpp
 - Clang :: CodeGen/2009-02-13-zerosize-union-field-ppc.c
 - Clang :: CodeGen/blocks-2.c
 - Clang :: CodeGen/libcalls-d.c
 - Clang :: CodeGen/libcalls-ld.c
 - Clang :: CodeGenCXX/conversion-function.cpp
 - Clang :: CodeGenCXX/debug-info-limit-type.cpp
 - Clang :: FixIt/fixit-pmem.cpp
 - Clang :: PCH/changed-files.c
 - Clang :: PCH/pr4489.c
 - Clang :: PCH/source-manager-stack.c
 - Clang :: Parser/cxx-ambig-decl-expr-xfail.cpp
 - Clang :: SemaCXX/switch-implicit-fallthrough-cxx98.cpp
 - Clang :: SemaTemplate/instantiate-function-1.mm

The (U) mark new failures unsupported release build - all others failed in _both_ builds (i.e. there were no true new failures).
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-07-03 07:47:07 UTC
Anything to do about this? Is still still a case for 3.8*?