Bug 12142 - heimdal compatibility
heimdal compatibility
Status: ASSIGNED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build
4.4.5
x64 Mac OS X
: P5 normal
: ---
Assigned To: Jeremy Allison
Jeremy Allison
:
: 11969 11970 11971 11972 11973 11974 12146 12147 12148 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-10 21:00 UTC by s3
Modified: 2016-12-04 10:34 UTC (History)
1 user (show)

See Also:


Attachments
Samba compile bug on FreeBSD 11.0-p1 (3.47 KB, text/plain)
2016-12-04 10:34 UTC, Jon Frimann
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description s3 2016-08-10 21:00:31 UTC
perl -i.bak -ple 's|(\#include <talloc\.h>)|$1\n#include <time.h>|' lib/param/loadparm.h;

perl -i.bak -ple 's|(\#include \"\.\./lib/util/setid\.h\")|$1\n#include <grp\.h>\n#include <uuid/uuid\.h>|' lib/param/loadparm.h;

perl -i.bak -ple 's|(\#include \"\.\./lib/util/setid\.h\")|$1\n#include <grp\.h>\n#include <uuid/uuid\.h>|' source3/lib/system_smbd.c;

perl -i.bak -ple 's|(\#include \"includes\.h\")|$1\n#include <grp\.h>\n#include <uuid/uuid\.h>|' source4/torture/local/nss_tests.c;
Comment 1 Jeremy Allison 2016-08-11 19:56:16 UTC
Sorry, I'm being too dumb here but could you be a little more specific about what bugs you're reporting here rather than just a script ?

Thanks,

Jeremy.
Comment 2 s3 2016-08-12 09:05:30 UTC
If you compile samba with clang instead of gcc, then many warnings and errors suddenly become evident. The missing headers above cause compilation errors. The patch adds the missing headers.
Comment 3 Jeremy Allison 2016-08-12 15:55:04 UTC
Great - thanks ! Normally we prefer patches in git format-patch format, but I can also work with this. Thanks for the extra context.
Comment 4 Stefan Metzmacher 2016-08-14 10:39:33 UTC
Would it be possible to get the output of the errors?

That makes it easier to understand what the actual problem is.

Including uuid/uuid.h just looks wrong without knowing the exact reason
for it.

Including <time.h> should be replaced by "system/time.h" from lib/replace.
And <grp.h> should be replaced by "system/passwd.h" from lib/replace.

So I guess if some broken system headers require uuid/uuid.h,
it should be included in one of the lib/replace/system/*.h files,
instead of individual .c files.
Comment 5 s3 2016-08-15 09:13:56 UTC
I removed the patch and recompiled from fresh sources, to get the original errors. 
However, something has changed in the underlying system, and I got the following instead.

config options:

--prefix=${prefix} \
--with-configdir=${etc} \
--with-piddir=${prefix}/var/run \
--mandir=${man} \
--docdir=${doc} \
--with-pie \
--with-libiconv=${foot}/share/libiconv \
--without-ldap \
--without-ads \
--disable-cups --disable-iprint \
--without-winbind \
--without-ntvfs-fileserver \
--without-gettext \
--without-systemd \
--without-acl-support \
--fatal-errors

Notes on the tools:

clang 3.8.0
gnutls: stable 3.4.14
libiconv 1.14


[ 137/3582] Compiling IDL librpc/idl/auth.idl
/Volumes/home/opt/src/samba-4.4.5/librpc/idl/auth.idl:112: warning: helper() is pidl-specific and deprecated. Use `include' instead
/Volumes/home/opt/src/samba-4.4.5/librpc/idl/auth.idl:104: error: Unable to determine origin of type `struct cli_credentials'
/Volumes/home/opt/src/samba-4.4.5/librpc/idl/auth.idl:104: error: Unable to determine origin of type `struct cli_credentials'

[ 215/3582] Compiling IDL librpc/idl/winbind.idl
/Volumes/home/opt/src/samba-4.4.5/librpc/idl/winbind.idl:183: warning: [out] argument `validation' not a pointer
/Volumes/home/opt/src/samba-4.4.5/librpc/idl/winbind.idl:185: warning: [out] argument `authoritative' not a pointer
/Volumes/home/opt/src/samba-4.4.5/librpc/idl/winbind.idl:183: error: winbind_SamLogon: [out] argument 'validation' is not a pointer or array, skip client functions

[ 216/3582] Compiling IDL source4/librpc/idl/irpc.idl
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:28: warning: subcontext() is deprecated. Use represent_as() or transmit_as() instead
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:70: warning: [out] argument `info' not a pointer
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:83: warning: top-level [out] pointer `dcname' is not a [ref] pointer
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:91: warning: [out] argument `num_addrs' not a pointer
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:113: warning: [out] argument `generic_reply' not a pointer
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:159: warning: [out] argument `info' not a pointer
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:70: error: nbtd_information: [out] argument 'info' is not a pointer or array, skip client functions
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:83: error: nbtd_getdcname: [out] argument 'dcname' is a pointer to type 'string', skip client functions
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:91: error: nbtd_proxy_wins_challenge: [out] argument 'num_addrs' is not a pointer or array, skip client functions
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:113: error: kdc_check_generic_kerberos: [out] argument 'generic_reply' is not a pointer or array, skip client functions
/Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:159: error: smbsrv_information: [out] argument 'info' is not a pointer or array, skip client functions


[ 573/3582] Compiling lib/addns/dnsrecord.c
In file included from ../lib/addns/dnsrecord.c:24:
In file included from ../lib/addns/dns.h:31:
In file included from ../lib/replace/system/gssapi.h:47:
../source4/heimdal/lib/gssapi/gssapi/gssapi_spnego.h:41:1: fatal error: unknown type name 'GSSAPI_CPP_START'
GSSAPI_CPP_START
^
1 error generated.
Waf: Leaving directory `/Volumes/home/opt/src/samba-4.4.5/bin'
Build failed:  -> task failed (err #1): 
        {task: cc dnsrecord.c -> dnsrecord_1.o}
make: *** [all] Error 1
Comment 6 s3 2016-08-15 09:56:14 UTC
*** Bug 12146 has been marked as a duplicate of this bug. ***
Comment 7 s3 2016-08-15 09:56:33 UTC
The option "--with-system-mitkrb5" returns the following

ERROR: MIT krb5 build requires at least 1.9.0. Kerberos 5 release 1.7-prerelease is found and cannot be used
ERROR: You may try to build with embedded Heimdal Kerebros by not specifying --with-system-mitkrb5
"

Compiling without the above option returns the following

[ 573/3582] Compiling lib/addns/dnsrecord.c
In file included from ../lib/addns/dnsrecord.c:24:
In file included from ../lib/addns/dns.h:31:
In file included from ../lib/replace/system/gssapi.h:47:
../source4/heimdal/lib/gssapi/gssapi/gssapi_spnego.h:41:1: fatal error: unknown type name 'GSSAPI_CPP_START'
GSSAPI_CPP_START
^
1 error generated.
Waf: Leaving directory `/Volumes/home/opt/src/samba-4.4.5/bin'
Build failed:  -> task failed (err #1): 
        {task: cc dnsrecord.c -> dnsrecord_1.o}
make: *** [all] Error 1
Comment 8 s3 2016-08-15 09:57:52 UTC
*** Bug 12148 has been marked as a duplicate of this bug. ***
Comment 9 s3 2016-08-15 09:58:19 UTC
*** Bug 12147 has been marked as a duplicate of this bug. ***
Comment 10 s3 2016-08-15 09:58:54 UTC
*** Bug 11974 has been marked as a duplicate of this bug. ***
Comment 11 s3 2016-08-15 09:59:19 UTC
*** Bug 11973 has been marked as a duplicate of this bug. ***
Comment 12 s3 2016-08-15 10:00:48 UTC
*** Bug 11972 has been marked as a duplicate of this bug. ***
Comment 13 s3 2016-08-15 10:01:43 UTC
*** Bug 11971 has been marked as a duplicate of this bug. ***
Comment 14 s3 2016-08-15 10:02:02 UTC
*** Bug 11970 has been marked as a duplicate of this bug. ***
Comment 15 s3 2016-08-15 10:02:21 UTC
*** Bug 11969 has been marked as a duplicate of this bug. ***
Comment 16 s3 2016-10-27 17:33:31 UTC
Update

samba 4.5.1
clang 3.9.0
heimdal 1.6rc2_1

configuration:

--prefix=${prefix} \
--with-configdir=${etc} \
--with-piddir=${prefix}/var/run \
--mandir=${man} \
--docdir=${doc} \
--with-pie \
--with-libiconv=${foot}/share/libiconv \
--with-pam \
--without-acl-support \
--without-ad-dc \
--without-ads \
--disable-avahi \
--disable-cups \
   --without-dnsupdate \
   --without-gettext \
   --disable-glusterfs \
   --disable-iprint \
   --without-ldap \
   --without-ntvfs-fileserver \
   --without-quotas \
   --without-systemd \
   --without-winbind \
   --with-system-mitkrb5 /usr/local/opt/heimdal \
   --fatal-errors

compiler error:

...
symlink: rpc/dcerpc.py -> python/samba/dcerpc/__init__.py
        Selected embedded Heimdal build
ERROR: Target 'roken' in directory /Volumes/home/opt/src/samba-4.5.1/source4/heimdal_build re-defined as LIBRARY - was SYSLIB
Comment 17 Jon Frimann 2016-12-04 10:34:14 UTC
Created attachment 12718 [details]
Samba compile bug on FreeBSD 11.0-p1

This bug happens in Samba 11.0-p1. This bug also happens on samba version 4.4 and 4.3. It does not happen with Samba 4.2. See attached file for complete compile error message.

uname -a
FreeBSD saturn 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 01:43:23 UTC 2016     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64