Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 362567 - sys-devel/llvm ignores "debug" flag
Summary: sys-devel/llvm ignores "debug" flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-08 05:50 UTC by Ruslan Lopatin
Modified: 2011-04-15 16:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ruslan Lopatin 2011-04-08 05:50:24 UTC
When debug flag is set, the LLVM is still being built with -DNDEBUG gcc option, which disables the internal LLVM assertions and debug reporting. The prevents the internal LLVM debugging mechanisms from being used.

The llvm-config output is also incorrect.

Reproducible: Always

Steps to Reproduce:
1. USE="debug" emerge sys-devel/llvm.
2. llvm-config --build-mode
3. llvm-config --cxxflags

Actual Results:  
LLVM build mode is reported correctly as "Debug".
CXX flags contain "-DNDEBUG" option.


Expected Results:  
-DNDEBUG should not be passed to gcc when building LLVM with "debug" flag.
`llvm-config --cxxflags` output should not contain -DNDEBUG option.

See /usr/include/llvm/Support/Debug.h.
It contains DEBUG_WITH_TYPE macro and other definitions expected the NDEBUG to be unset. NDEBUG is also shouldn't be set for LLVM "-debug" command line argument to work, which can be really helpful when developing with LLVM (e.g. for LLVM front-end development).
Comment 1 Bernard Cafarelli gentoo-dev 2011-04-15 16:01:54 UTC
Thanks for the report! I have updated the ebuild to use Debug+Asserts+Checks build mode for debug (without the additional flags, -DNDEBUG creeps in).

llvm-2.9-r1 should be fine, don't hesitate to reopen this bug if debug still does not work well for you