Bug 197561 - security/krb5: Due to use of -Werror, krb5 does not build with gcc-5
Summary: security/krb5: Due to use of -Werror, krb5 does not build with gcc-5
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-12 07:51 UTC by John Marino
Modified: 2015-02-12 21:16 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
patch to fix build using gcc5 as compiler (365 bytes, patch)
2015-02-12 20:06 UTC, John Marino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino freebsd_committer freebsd_triage 2015-02-12 07:51:20 UTC
GCC 5, like each release of GCC, comes with new error detections and warnings.  This is exactly why building ports with -Werror is heavily discourages (in fact there is a standard blanket to remove these when found).

In the case of krb5, it fails here:


cc_file.c: In function 'fcc_next_cred':
cc_file.c:368:9: error: 'maxsize' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     ret = load_data(context, id, maxsize, buf);
         ^
cc_file.c:1091:12: note: 'maxsize' was declared here
     size_t maxsize;
            ^
cc_file.c: In function 'read_principal':
cc_file.c:414:9: error: 'maxsize' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     ret = load_principal(context, id, maxsize, &buf);
         ^
cc1: some warnings being treated as errors
Makefile:779: recipe for target 'cc_file.so' failed
gmake[4]: *** [cc_file.so] Error 1
gmake[4]: Leaving directory '/wrkdirs/security/krb5/work/krb5-1.13/src/lib/krb5/ccache'
Makefile:1107: recipe for target 'all-recurse' failed
gmake[3]: *** [all-recurse] Error 1
gmake[3]: Leaving directory '/wrkdirs/security/krb5/work/krb5-1.13/src/lib/krb5'
Makefile:951: recipe for target 'all-recurse' failed
gmake[2]: *** [all-recurse] Error 1
gmake[2]: Leaving directory '/wrkdirs/security/krb5/work/krb5-1.13/src/lib'
Makefile:1526: recipe for target 'all-recurse' failed
gmake[1]: *** [all-recurse] Error 1
gmake[1]: Leaving directory '/wrkdirs/security/krb5/work/krb5-1.13/src'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/security/krb5
=> Cleaning up wrkdir
===>  Cleaning for krb5-1.13_1



At least 103 other ports depend on krb5 directly or indirectly on DragonFly (there's no kerberos in base)


proposed fix:
1) just remove -Werror from cflags
2) resolved the warning above.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-02-12 07:51:20 UTC
Auto-assigned to maintainer cy@FreeBSD.org
Comment 2 Cy Schubert freebsd_committer freebsd_triage 2015-02-12 16:02:53 UTC
CFLAGS isn't set by the port though is set by the configure script in the tarball.

slippy$ pwd
/home/cy/freebsd/svn/ports/security/krb5
slippy$ ag -i werror 
slippy$ 

Can you try CFLAGS=-Wno-werror make please?
Comment 3 John Marino freebsd_committer freebsd_triage 2015-02-12 19:37:54 UTC
it did not work nor did "CONFIGURE_ARGS+= --disable-werror".
I looked at the configure script and it's testing flags to that work with Werror so I'd guess the configure script would have to be patched.

(or the error in source file fixed)
Comment 4 John Marino freebsd_committer freebsd_triage 2015-02-12 20:06:38 UTC
Created attachment 152918 [details]
patch to fix build using gcc5 as compiler

This will allow krb5 to build with -Werror on gcc5.

Basically it initializes "max_size" to 0 in the case of an error on the getsize function.  I'm surprised krb didn't abort when the function return an error though.
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2015-02-12 21:12:34 UTC
Good stuff. Looks like the two older krb5 ports don't need it.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-02-12 21:15:27 UTC
A commit references this bug:

Author: cy
Date: Thu Feb 12 21:15:16 UTC 2015
New revision: 378897
URL: https://svnweb.freebsd.org/changeset/ports/378897

Log:
  Fix gcc5 build for DragonFly BSD.

  PR:		197561
  Submitted by:	marino

Changes:
  head/security/krb5/Makefile
  head/security/krb5/files/patch-lib__krb5__ccache__cc_file.c
Comment 7 Cy Schubert freebsd_committer freebsd_triage 2015-02-12 21:16:16 UTC
Committed. Thanks.