The Samba-Bugzilla – Bug 13856
Samba 4.10.0 cross-compile issue when compiling Heimdal
Last modified: 2019-07-29 05:43:09 UTC
We build Samba for LibreELEC, a custom Linux distribution, cross-compiling with our own gcc-8.3.0 toolchain.
We patch gcc to detect incorrect build host include usage when building for the target.
We are able to build Samba 4.9.5 with Heimdal 7.5.0 without issue (successful build log) - all is good.
However, we are seeing a cross-compile problem with Samba 4.10.0, which now triggers a cross-compilation failure when building the "embedded" Heimdal.
Specifically, /usr/include/heimdal is being used by the Samba 4.10.0 build process which is incorrect when cross-compiling, and this did not happen with Samba 4.9.5.
This is the Samba 4.9.5 configuration: http://ix.io/1DXj
And this is the Samba 4.10.0 configuration: http://ix.io/1DXi (I'm including the fix for https://bugzilla.samba.org/show_bug.cgi?id=13844)
Any ideas why this cross-compile problem happens with Samba 4.10.0 but does NOT happen with Samba 4.9.5?
Note: The "link" error and truncation warnings may also be of interest - the truncation warning is also present in 4.9.5 (search for "_heim_time2generalizedtime").
As discussed on IRC, the explicit include path added via source4/heimdal_build/wscript_build appears to be responsible for the failure, but I don't know why it wasn't causing issues with the 4.9 build.
I'm also a little confused as to why heimdal is even built, given the --without-winbind --without-ads --without-ad-dc configure invocation.
(In reply to David Disseldorp from comment #1)
We still use the internal heimdal unless --with-system-mitkrb5 or --with-system-heimdalkrb5
This specifically allowed us to upgrade our minimum kerberos requirement because we could fall back on the internal one (a bit like the way we use third_party).
Created attachment 15036 [details]
Created attachment 15037 [details]
Created attachment 15038 [details]
4.9.5 build log (Successful)
Created attachment 15039 [details]
4.10.0 build log (Failure)
Created attachment 15296 [details]
Samba 4.10.6 build failure
This is still a problem when building 4.10.6.
4.9.11 builds fine.
(In reply to Neil MacLeod from comment #7)
You need this patch for musl as well: https://github.com/Andy2244/openwrt-extra/blob/master/samba4/patches/006-samba-4-10-musl_rm_unistd_incl.patch
Just got 4.10.6 working for openwrt, so maybe compare our version/patches with your LibreELEC version.
Hi @andieq, many thanks for the suggestion but unfortunately it had no effect - Samba 4.10.x continues to fail as before. To be honest I wasn't expecting it to fix this issue as we build with glibc.
This is my Samba 4.10 development branch:
There's not much change from 4.9.11, but Samba 4.10.x no longer cross-compiles due to the WAF build system pulling in the host includes rather than from the sysroot. Note that this failure is a custom modification to gcc so you may not see it in your build system:
We are using an external Heimdal (heimdal-7.7), but that hasn't changed from 4.9.x.
I don't think additional cross-answers are required by 4.10, the cross-answers file I'm using is here:
Looking at your repo it appears you didn't need to make any cross-answer modifications.
(In reply to Neil MacLeod from comment #9)
Ah just noticed the "link" redefinition, which i also got on musl, so had to grab the Alpine patch for it. Was assuming you guys also use musl, sorry this dind't work for you.
Yeah no cross-answer changes, i needed the 2 waf cross-compile patches, the gnutls patch and the musl one. Other than that "waf install --destdir" wasn't working anymore, so now have to manually grab everything from /bin....
I also could not get the AD_DC version building, because it pulls in mixed lib's (target/host) on it trying to build the "python embedded interpreter". Something is different from python2 to 3....