Menu

#1330 V5-7-patches: configuration bug for Debian systems introduced

backport-needed
closed
nobody
3
2016-07-21
2016-07-19
Sam Tannous
No

In V5-7-patches branch, recent changes to the configuration system (7c38dba08, 9e4b85d67 ) introduced bugs for Debian build systems since debian dpkg-buildflags produces "-Werror=format-security" and not just
"-Werror".

The existing "sed" expression in configure.ac only removes the "-Werror" leaving a
dangling "=format-security" which fails in dh_auto_configure (as part of a dpkg-buildpackage).

The patch looks a little odd because of m4 "absorbs" the square brackets in the regular expression.
Instead of square brackets to collect the string after the "-Werror", we need to use the quadrigraphs
@<:@ and @:>@ for [ and ] respectively.

I've tested this by merging latest upstream V5-7-patches into my branch and building with
dpkg-buildpackage -uc -us on latest Debian Jessie (Linux debian-stable 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux).

Regards,
Sam Tannous

1 Attachments

Discussion

  • Sam Tannous

    Sam Tannous - 2016-07-20

    Unfortunately, this causes other problems in compiling later on.

    snmp_perl.c:5:20: fatal error: EXTERN.h: No such file or directory

    So until I can figure out why this change in configure.ac (removing -Werror=format-security)
    causes snmp_perl.c to not compile, I'm going to revert the two patches that caused this Debian
    build breakage.

     
  • Bart Van Assche

    Bart Van Assche - 2016-07-20

    Please retest with the latest version of the Net-SNMP code. A fix for the build error mentioned above was checked in yesterday (https://sourceforge.net/p/net-snmp/code/ci/32cc6c32f96f17a5a4ccab1ae3a3896894fb4b97/).

     
  • Sam Tannous

    Sam Tannous - 2016-07-20

    Hey Bart,

    Thanks for the quick patch for the Perl problem.

    But Debian users will still have issues with an invalid configure script since removing only "-Werror" leaves a dangling "=format-security":

    configure:6918: checking whether the C compiler works
    configure:6940: gcc -g -O2 -fstack-protector-strong -Wformat =format-security -DNETSNMP_USE_INLINE -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now conftest.c  >&5
    gcc: error: =format-security: No such file or directory
    configure:6944: $? = 1
    configure:6982: result: no
    configure: failed program was:
    

    The last patch would need to remove "-Werror" and with a regex expression for m4 (yucky since m4 absorbs []). Something like this will work (feel free to use the quadrigraphs @<:@ and @:>@
    if you like them instead of the [[foo]] ;-)

    diff --git a/configure.ac b/configure.ac
    index c6b02a8..eee0502 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -52,7 +52,7 @@ m4_include([configure.d/config_project_with_enable])
     #   (e.g. it causes type mismatches in the AC_CV_FUNCS call)
     ##
     noerr_CFLAGS="$CFLAGS"
    -CFLAGS=`echo $CFLAGS | sed 's/-Werror//'`
    +CFLAGS=`echo $CFLAGS | sed -e 's/-Werror\(=[[a-zA-Z:_\-]]\+\)\?\b/ /'`
     CFLAGS_without_Werror=$CFLAGS
     export CFLAGS
     m4_include([configure.d/config_project_manual])
    

    Thanks,
    Sam Tannous

     
  • Bart Van Assche

    Bart Van Assche - 2016-07-21

    Please retest with the latest version of the master or the v5.7 branch.

     
  • Sam Tannous

    Sam Tannous - 2016-07-21

    Hi Bart,

    I probably didn't make this clear enough in my last response....

    I did test with latest v5.7 and without my patch, the build fails as described in my original patch.
    The "sed" call has to remove -Werror as well as the other part of the argument. So the
    configure fails since there is a dangling =format-security that is present in Debian build systems
    that are tracking this branch (like mine).

    So with my patch applied to the latest v5.7 branch, it works on Debian Jessie systems.
    But if you could accept my patch, we'd have a working branch for Debian users.

    Thanks,
    Sam

     
  • Sam Tannous

    Sam Tannous - 2016-07-21

    Yes, sorry. It works fine. (And your regex is cleaner then mine.)

     
  • Bart Van Assche

    Bart Van Assche - 2016-07-21
    • status: open --> closed
     
  • Bart Van Assche

    Bart Van Assche - 2016-07-21

    Thanks for the report and for testing!

     

Log in to post a comment.