[Pkg-samba-maint] Bug#812264: Bug#812264: What's going on here

Andrew Bartlett abartlet at samba.org
Thu Apr 7 07:16:32 UTC 2016


On Wed, 2016-04-06 at 13:56 +0200, Roderich Schupp wrote:
> FYI, this FTBFS is  only accidentally caused by GCC 6:
> 
> - the linker complains that tolower() is implemented in serveral
> object files
> 
> - in /usr/include/ctype.h (line ~216) we find
> 
> __extern_inline int
> __NTH (tolower (int __c))
> {
>   return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] :
> __c;
> }
> 
> - __extern_inline is defined as (/usr/include/x86_64-linux
> -gnu/sys/cdefs.h, line 333)
> 
> #define __extern_inline extern __inline __attribute__
> ((__gnu_inline__))
> 
> - this definition would NOT cause tolower() to be compiled into any
> object files, but if we 
>   look at the preprocessed source4/heimdal/lib/roken/vis.c, we see
> that the above lines
>   from ctype.h come out as
> 
> extern __inline int
> __attribute__ ((__nothrow__ , __leaf__)) tolower (int __c)
> {
>   return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] :
> __c;
> }
> 
>   i.e. " __attribute__ ((__gnu_inline__))" is missing 
> 
> - the reason is that source4/heimdal/lib/roken/roken-common.h (line
> 275) has
> 
> #ifndef HAVE___ATTRIBUTE__
> #define __attribute__(x)
> #endif
> 
>   i.e. it #define's __attribute__ away and that is caused by
> (source4/heimdal_build/roken.h, line 143):
> 
> #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
> #ifndef HAVE___ATTRIBUTE__
> #define HAVE___ATTRIBUTE__
> #endif
> #endif
> 
> - accidentally GCC 6 is still at 6.0, hence __GNUC_MINOR__=0, so
> HAVE___ATTRIBUTE__ doesn't get #defined;
>   it works with current GCC 5 in unstable as its version is 5.1.x
> 
> My guess is that the author of the above lines really meant "gcc
> since 3.1". Patch attached.

Thanks.  A colleague of mine also dug into it, and there is a fix in
upstream Samba for __attribute__ detection.  We need to file a Samba
bug for that, and get that backported to the next 4.4 (and probably
include it in debian in the meantime). 

https://git.samba.org/?p=samba.git;a=commitdiff;h=1dc05386f20481596ee73
60d6f4e628a16675d3f
https://git.samba.org/?p=samba.git;a=commitdiff;h=1c796547f20fa3c7c2e93
fd5ce6ee8453a2bb435

If you could file the issue with us upstream that would be great.

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba



More information about the Pkg-samba-maint mailing list