Page MenuHomeFreeBSD

mail/mailsync: Fix build with Clang 6.0.0
ClosedPublic

Authored by loader on May 23 2018, 8:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 12:32 AM
Unknown Object (File)
Thu, Nov 21, 5:04 PM
Unknown Object (File)
Sun, Nov 10, 8:43 AM
Unknown Object (File)
Sat, Nov 9, 8:45 AM
Unknown Object (File)
Sat, Nov 9, 8:45 AM
Unknown Object (File)
Fri, Nov 8, 1:40 PM
Unknown Object (File)
Thu, Nov 7, 9:34 PM
Unknown Object (File)
Wed, Nov 6, 11:34 AM
Subscribers

Details

Summary

[package - head-i386-default][mail/mailsync] Failed for mailsync-5.2.1_3 in configure
https://lists.freebsd.org/pipermail/freebsd-pkg-fallout/Week-of-Mon-20180416/742636.html

[package - head-amd64-default][mail/mailsync] Failed for mailsync-5.2.1_3 in configure
https://lists.freebsd.org/pipermail/freebsd-pkg-fallout/Week-of-Mon-20180416/742473.html

[package - head-armv7-default][mail/mailsync] Failed for mailsync-5.2.1_3 in configure
https://lists.freebsd.org/pipermail/freebsd-pkg-fallout/Week-of-Mon-20180416/745764.html

[package - head-arm64-default][mail/mailsync] Failed for mailsync-5.2.1_3 in configure
https://lists.freebsd.org/pipermail/freebsd-pkg-fallout/Week-of-Mon-20180416/742436.html

error details in config.log:

configure:5836: checking if adding -fno-operator-names helps
configure:5851: c++ -c -O -pipe -fno-strict-aliasing  -fno-operator-names  -I/usr/local/include/c-client conftest.cc >&5
In file included from conftest.cc:35:
In file included from /usr/local/include/c-client/c-client.h:42:
In file included from /usr/local/include/c-client/osdep.h:29:
In file included from /usr/include/c++/v1/stdlib.h:94:
/usr/include/stdlib.h:97:1: error: function declared '[[noreturn]]' after its first declaration
_Noreturn void   exit(int);
^
/usr/include/sys/cdefs.h:280:22: note: expanded from macro '_Noreturn'
#define _Noreturn               [[noreturn]]
                                  ^
conftest.cc:11:6: note: declaration missing '[[noreturn]]' attribute is here
void exit (int);
     ^
In file included from conftest.cc:35:
In file included from /usr/local/include/c-client/c-client.h:42:
In file included from /usr/local/include/c-client/osdep.h:29:
In file included from /usr/include/c++/v1/stdlib.h:94:
/usr/include/stdlib.h:97:17: error: declaration of 'exit' has a different language linkage
_Noreturn void   exit(int);
                 ^
conftest.cc:11:6: note: previous declaration is here
void exit (int);
     ^
2 errors generated.
configure:5857: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "mailsync"
| #define PACKAGE_TARNAME "mailsync"
| #define PACKAGE_VERSION "5.2.1"
| #define PACKAGE_STRING "mailsync 5.2.1"
| #define PACKAGE_BUGREPORT "tpo_deb@sourcepole.ch"
| #define PACKAGE "mailsync"
| #define VERSION "5.2.1"
| #ifdef __cplusplus
| void exit (int);
| #endif
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STRING_H 1
| #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
| #define HAVE_GETPASS 1
| #define HAVE_MEMSET 1
| #define HAVE_STRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRERROR 1
| #define HAVE_STRTOUL 1
| #define HAVE_LIBCRYPT 1
| /* end confdefs.h.  */
| 
| 	    #include <stdio.h>
| 	    #include "c-client.h"
| 
configure:5882: result: no
configure:5902: error: a working c-client installation is required for building mailsync

Clang 6.0.0 sees an attribute [[noreturn]] here
https://svnweb.freebsd.org/base/head/sys/sys/cdefs.h?revision=331266&view=markup#l279

279     #if defined(__cplusplus) && __cplusplus >= 201103L
280     #define _Noreturn               [[noreturn]]
281     #else
282     #define _Noreturn               __dead2
283     #endif

but mail/mailsync/${WRKSRC}/configure generates an exit function declaration in confdefs.h:

#ifdef __cplusplus
void exit (int);
#endif

New version of autoconf (2006) doesn't generate it any more:
http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=a71c24a704ec0570ba99be909fffbc044d50908b

Proposed commit log message:

mail/mailsync: Fix build with Clang 6.0.0

exit function declared in autoconf 2.59 configure scripts conflicts 
with Clang 6 because stdlib.h declares it with an attribute for C++11
or later. This is fixed in later versions of autoconf 2.60.

- Add USES=autoreconf to regenerate configure, new version of
  autoconf no longer declares the exit function. [1]
- Merge the changes from files/patch-configure and post-patch taget
  into acinclude/ac_with_{cclient,openssl}.m4

[1] http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=a71c24a704ec0570ba99be909fffbc044d50908b

Reviewed_by: koobs, mat
Approved by: koobs (mentor)
Differential_Revision: D15532
MFH: 2018Q2
Test Plan
  • portlint: OK (looks fine.)
  • testport: OK (poudriere: 1200062, [amd64, armv7, aarch64], '', tested)

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

loader edited the summary of this revision. (Show Details)

This probably needs a PORTREVISION bump, no?

Changes look good, thanks for the detailed background.

Please include, in the commit log message:

  • a 'plain language' (1-2 sentence) summary of the problem/cause in the commit log message describing the why of the change.

Something like: exit function declared in autoconf vX.Y configure scripts conflicts with clang 6 because blah blah. This is fixed in later versions of autoconf [1]. Use autoreconf to rebuild configure accordingly. Amend as necessary to make sense :)

  • [1] <reference to upstream commit that fixed the issue in autoconf>
This revision is now accepted and ready to land.May 30 2018, 9:27 AM
This revision was automatically updated to reflect the committed changes.