Compiler crash when building libreoffice with debug

Stephan Bergmann sbergman at
Mon Mar 7 10:51:36 UTC 2016

On 03/05/2016 05:38 PM, Pranav Ganorkar wrote:
> When trying to build sfx2 module with debugging symbols , I get the
> following build error:
> make sfx2.clean && make sfx2 debug=t

I fear that "selective debug" thing is not really working fully.

The problem is that recent GCC has a bug 
(<> "ICE using 
__func__ in constexpr function") that causes internal compiler errors in 
constexpr functions that contain calls to assert (and where NDEBUG is 
not defined, so that the calls to assert actually expand to code).

That's why LO's tries to detect whether marking functions 
that contain calls to assert as "constexpr" (via the expansion of LO's 

If you build LO with a GCC with above bug, using constexpr is still fine 
as long as calls to assert don't actually expand to any real code (i.e., 
in the implicit --disable-debug case).  Hence, originally 
determined that HAVE_CXX14_CONSTEXPR is 1 for your environment.  But 
when you call "make ... debug=t", does not get re-run, so the 
problematic functions (in include/o3tl/typed_flags_set.hxx) still get 
marked as "constexpr," even though their calls to assert now expand to 
code that triggers the GCC bug.

Probably best to disable HAVE_CXX14_CONSTEXPR regardless of whether your 
configure switches would cause NDEBUG to be defined, so that later 
builds with "make ... debug=t" do not run into this problem.  Did that 
now with 
"Make detection of HAVE_CXX14_CONSTEXPR work with 'selective 
debugging.'"  (Do a full top-level "make" once after pulling that, and 
afterwards "make sfx2.clean && make sfx2 debug=t" should work for you.)

More information about the LibreOffice mailing list