Project

General

Profile

Bug #24771

2.6.0 build fails if --enable-debugging is passed to configure script

Added by John Dennis about 2 years ago. Updated 11 months ago.

Status:
Solution déployée
Priority:
Normal
Category:
-
Target version:
Start date:
25 Jun 2018
Due date:
% Done:

100%

Patch proposed:
Yes
Planning:
No

Description

On line 703 of configure.ac -Werror is added to CFLAGS if enable-debugging is on.

-Werror causes the compilation to fail if any warnings are emitted during compilation.

However lasso version 2.6.0 when built with gcc 8.1.1 has numerous compiler warnings, both in the core and in the bindings. Thus with --enable-debugging the build fails almost immediately (as soon as a warning is emitted). This prevents lasso from being built with debugging support.

0001-Move-AC_SUBST-declaration-for-AM_CFLAGS-with-alike-2.patch View (912 Bytes) Benjamin Dauvergne, 24 Jul 2018 12:40 PM

0002-Add-an-enable-pedantic-option-to-prevent-enable-debu.patch View (1.56 KB) Benjamin Dauvergne, 24 Jul 2018 12:40 PM

0002-Remove-Werror-from-enable-debugging-fixes-24771.patch View (900 Bytes) Benjamin Dauvergne, 24 Jul 2018 04:31 PM

0001-Move-AC_SUBST-declaration-for-AM_CFLAGS-with-alike-2.patch View (912 Bytes) Benjamin Dauvergne, 24 Jul 2018 04:31 PM

Associated revisions

Revision 62d2f4bf (diff)
Added by Benjamin Dauvergne about 2 years ago

Move AC_SUBST declaration for AM_CFLAGS with alike (#24771)

Just to reorder things properly in configure.ac.

Revision 50b5cdac (diff)
Added by Benjamin Dauvergne about 2 years ago

Remove -Werror from --enable-debugging (fixes #24771)

GCC 8 has better warnings and it breaks the build on platform already
using it and wanting debugging symbols.

History

#1 Updated by Benjamin Dauvergne about 2 years ago

I'm ok to remove it, and create a --pedantic option instead.

#2 Updated by John Dennis about 2 years ago

Adding --pedantic to enable -Werror sounds like a good approach to me, it separates two concepts (debugging and strictness) that got co-mingled. At some point the warnings should be looked at, I assume since -Werror has been a part of --debugging for a while it implies there was a recent point in time where there were no warnings so it shouldn't be too hard.

On an almost unrelated note, I've got a number patches prepared to support using Python3 during the build. It appears as if although the generated Python binding had been ported to Py3 other build scripts and the automake files were not ready to handle Py3. It was while I was working on getting the Py3 build working that I tried to turn on debugging and discovered it failed. My quick and dirty interim solution was to just temporarily remove -Werror from the CFLAGS and I was able to move on.

#3 Updated by Benjamin Dauvergne about 2 years ago

  • Target version set to 2.6.1

#4 Updated by Benjamin Dauvergne about 2 years ago

  • Assignee set to John Dennis

#5 Updated by Benjamin Dauvergne about 2 years ago

  • Assignee changed from John Dennis to Benjamin Dauvergne

#6 Updated by Benjamin Dauvergne about 2 years ago

John could you review my patch please ?

#7 Updated by Benjamin Dauvergne about 2 years ago

I forgot there was already a --enable-pedantic option, so I just removed -Werror in these new patches.

#8 Updated by Benjamin Dauvergne about 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Solution proposée to Résolu (à déployer)

#9 Updated by John Dennis about 2 years ago

Hi Benjamin:

I think there are a couple of issues with the patch or perhaps I'm not in sync with what you were trying to achieve, so here's my questions:

Why is there any connection between debugging and the pedantic option? The two seem independent to me. In one case I want to produce a build I can run under the debugger and in the other case I want to see if the compiler can help me diagnose coding mistakes. I don't see any correlation between the two.

There was already an enable pedantic option and now it looks like you're processing that arg twice.

if test "z$enable_pedantic" = "zyes" ; then
enable_pedantic=yes

Isn't the assignment of 'yes' to enable_pedantic a redundant no-op here? The assignment is inside a conditional block that has confirmed that enable_pedantic is already 'yes'.

+ if test "z$enable_debugging" "!=" "zyes" ; then
+ LASSO_DEFINES="$LASSO_DEFINES -DLASSO_DEBUG"
+ CFLAGS="$CFLAGS -O0 -g -Wall -Wextra"
+ fi

This seems to enforce the requirement that if you enable pedantic you must compile with the option to produce a debuggable build. Is this something gcc requires? If not why are we enforcing this?

I'm not even sure -Wall and -Wextra should be turned on by saying I want a build that I can run under gdb, but I'm OK with it, I can see the value in it but on the other hand I prefer options that do not have unrelated side-effects.

#10 Updated by Benjamin Dauvergne about 2 years ago

John Dennis a écrit :

Hi Benjamin:

I think there are a couple of issues with the patch or perhaps I'm not in sync with what you were trying to achieve, so here's my questions:

Why is there any connection between debugging and the pedantic option? The two seem independent to me. In one case I want to produce a build I can run under the debugger and in the other case I want to see if the compiler can help me diagnose coding mistakes. I don't see any correlation between the two.

There was already an enable pedantic option and now it looks like you're processing that arg twice.

if test "z$enable_pedantic" = "zyes" ; then
enable_pedantic=yes

Isn't the assignment of 'yes' to enable_pedantic a redundant no-op here? The assignment is inside a conditional block that has confirmed that enable_pedantic is already 'yes'.

+ if test "z$enable_debugging" "!=" "zyes" ; then
+ LASSO_DEFINES="$LASSO_DEFINES -DLASSO_DEBUG"
+ CFLAGS="$CFLAGS -O0 -g -Wall -Wextra"
+ fi

This seems to enforce the requirement that if you enable pedantic you must compile with the option to produce a debuggable build. Is this something gcc requires? If not why are we enforcing this?

I'm not even sure -Wall and -Wextra should be turned on by saying I want a build that I can run under gdb, but I'm OK with it, I can see the value in it but on the other hand I prefer options that do not have unrelated side-effects.

Finally I choosed to simply remove -Werror from the debugging CFLAGS, so all is well.

#11 Updated by Benjamin Dauvergne 11 months ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF