Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 452710

Summary: mail-client/mutt-1.5.21-r12: idn include breaks on linux because it has idn/assert.h
Product: Gentoo Linux Reporter: Petr Pisar <petr.pisar>
Component: Current packagesAssignee: Fabian Groffen <grobian>
Status: RESOLVED FIXED    
Severity: normal CC: jer
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://dev.mutt.org/trac/ticket/3624
Whiteboard:
Package list:
Runtime testing required: ---

Description Petr Pisar 2013-01-17 17:50:12 UTC
While playing with mutt development tree, I found it's not possible link mutt executable if net-dns/idnkit is installed:

/home/petr/mutt-devel/curs_main.c:300: undefined reference to `assert'

I minimized the problem to:

$ printf '#include <assert.h>\nassert(1);' | cpp -I/usr/include/idn -E -
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
# 1 "/usr/include/idn/assert.h" 1
# 51 "/usr/include/idn/assert.h"
# 1 "/usr/include/idn/assert.h" 1
# 52 "/usr/include/idn/assert.h" 2
# 2 "<stdin>" 2
assert(1);

While removing /usr/include/idn fixes the problem:

$ printf '#include <assert.h>\nassert(1);' | cpp -E -
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
# 1 "/usr/include/assert.h" 1 3 4
# 37 "/usr/include/assert.h" 3 4
[...]
extern void __assert_fail (__const char *__assertion, __const char *__file,
      unsigned int __line, __const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
[...]
# 2 "<stdin>" 2
((1) ? (void) (0) : __assert_fail ("1", "<stdin>", 2, __PRETTY_FUNCTION__));

The problem is idnkit installs assert.h which is not compatible with glibc assert.h:

$ qfile -v /usr/include/idn/assert.h 
net-dns/idnkit-1.0-r2 (/usr/include/idn/assert.h)

Solution is not to install /usr/include/idn/assert.h from net-dns/idnkit.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-17 17:54:08 UTC
It doesn't clash with libc's assert.h at all. Lots of packages install an assert.h and mutt simply needs to properly distinguish between them.
Comment 2 Fabian Groffen gentoo-dev 2013-09-09 20:02:05 UTC
Does -r13 still have this problem?  The check somewhat changed.
Comment 3 Petr Pisar 2013-09-10 19:03:59 UTC
No. -r13 builds without hickups.

Upstream has changed the CFLAGS generation not to include /usr/include/idn if not necessary and resolved the issue with these two commits:

changeset:   5634:acc8b2afdf29
branch:      HEAD
user:        Michael Elkins <me@sigpipe.org>
date:        Tue Jan 22 02:02:00 2013 +0000
summary:     remove PKG_CHECK_MODULE() check and always use AC_CHECK_HEADERS()

changeset:   5633:98e031cd81d4
branch:      HEAD
user:        Michael Elkins <me@sigpipe.org>
date:        Sun Jan 20 21:45:10 2013 +0000
summary:     use pkg-config to look for libidn if available.
Comment 4 Fabian Groffen gentoo-dev 2013-09-11 08:26:31 UTC
ok, thanks, closing as fixed then.