On Sun, 4 Nov 2018, Christian Weisgerber wrote:
> As landry@ has reported, security/gnutls no longer builds on sparc64
> and powerpc after the _ISOC11_SOURCE header change that has exposed
> max_align_t.
> 
> The failure cascade is like this:
> 
> security/gnutls uses ports-gcc (gcc 4.9) on non-clang archs.
> 
> gcc 4.9 apparently does not accept the "restrict" keyword by default.
> This causes a configure check to add -std=gnu99 to the compiler flags:
>   checking for cc option to accept ISO C99... -std=gnu99 
> 
> Since max_align_t is from C11, the -std=gnu99 flag removes it from
> visibility:
>   checking for max_align_t... no
> 
> gnutls's copy of gnulib then provides its own replacement definition
> of max_align_t.  So far this is consistent within the C universe.
> 
> But then gnutls builds its C++ library.  Plain c++, no -std flag.

That's arguably a bug in gnutls...


> This has different visibility rules.  The max_align_t from stddef.h
> reappears and collides with the gnulib replacement:
>   ../../src/gl/stddef.h:106:3: error: conflicting declaration
>   'typedef union max_align_t max_align_t'
>    } max_align_t; ^
> 
> I'm not sure how to fix this.  Maybe add -std=c11 (or -std=gnu11?) right 
> away to CFLAGS?

That seems like the simplest solution, forcing both sides to 
(approximately) the same symbol visibility.


Philip

Reply via email to