Compiler crash when building libreoffice with debug

Stephan Bergmann sbergman at redhat.com
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 
(<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66460> "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 configure.ac tries to detect whether marking functions 
that contain calls to assert as "constexpr" (via the expansion of LO's 
SAL_CONSTEXPR macro) is OK (see HAVE_CXX14_CONSTEXPR in 
config_host/config_global.h).

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, autogen.sh originally 
determined that HAVE_CXX14_CONSTEXPR is 1 for your environment.  But 
when you call "make ... debug=t", autogen.sh 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 
<https://cgit.freedesktop.org/libreoffice/core/commit/?id=4b8c29015d7c70121a161da0f3a85fa4ea0c5987> 
"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