Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Compile smb for Qnx 6.6: (2 Items)
   
Compile smb for Qnx 6.6  
Hello,
Is there any directions regarding building a working samba version for Qnx 6.6 ?
I'm trying to read wiki etc... but can't find my way arround it...
Re: Compile smb for Qnx 6.6  
Hi Paul,

It can be done, although it isn't easy or straightforward.  I actually just went through updating our local build to 
Samba 4.11.17 (client and server, but no active directory server support).  Porting the dependency chain is a 
substantial amount of work, though.

Here are some things you'll have to watch out for:
- I had problems with the QNX supplied version of GNU ld faulting on Samba's massive collection of .sos.  I ended up 
recompiling binutils from the 'core-dev-tools' project here to get a compatible version of 'ld.gold' to use as an 
alternative.
- You'll need to build MIT krb5 externally for kerberos support; Samba's embedded heimdal doesn't cross-compile properly
.
- Samba depends on Python; you'll need to make sure you've compiled the same version of Python for both host and build 
systems.  (We ported 3.6.9 to match some of our data processing toolchain).  We use the 'crossenv' python module to set 
up the cross-python environment, but you'll also need to explicitly override 'sys.platform' and 'sys.maxsize' inside the
 cross environment or waf won't do feature detection properly.
- You'll need to set up a QNX target machine you can ssh in, with NFS mapped to your build drive, so you can 'cross-
execute' during Samba's configure pass.   This only has to be done once; configure can save the results in a 'cross-
answers' file and re-use them for future builds.
- Finally, we ran in to an issue on multi-core x86 QNX 6.6 targets where procnto would flood the system with IPIs 
whenever an smbd or nmbd process terminated.  Samba uses tons of little .so files with a bazillion small sections inside
, and the memory manager notifies every core for every one of those tiny unmappings.   To mitigate this, we ended up 
locking both our hard real time processes and most of procnto's threads to core 0 (so that our hard real time processes 
could reliably preempt the memory manager instead of being flooded out by IPIs); and forcing samba to statically link 
key binaries as much as it could (configure --nonshared-binary=smbd/smbd,nmbd/nmbd).  I believe this was been fixed when
 the memory manager was rewritten in QNX 7.0, but I haven't personally verified it.  It's possible that the pathological
 behaviour was also related to using ld.gold.

I wish I could pass along more complete build instructions, but unfortunately our tooling still has a few too many 
proprietary stages.   If I get time to containerize it properly I'll see if I can post more of it.

Good luck!

-Will