On 14.06.2026 16:54, Martin Kj?r J?rgensen via samba wrote:> Hey list, > > I am trying to cross compile samba on x86_64 to aarch64 on a Debian'ized > system using ptxdist rules. ./configure runs okay but it seems linking compile_etNot an answer to your question directly but do you know that samba package for debian can be easily cross-compiled using multiarch and qemu-user? In particular, I provide builds of debian samba packages for x86_64 *and* for arm64 architectures on my site this way (http://www.corpit.ru/mjt/packages/samba/).> fails: > > /build-target/samba-4.23.6/bin/compile_et: error while loading shared libraries: libbsd.so.0: > cannot open shared object file: No such file or directory > > If I install libbsd0:arm64 on the host, the entire samba build finishes > correctly.The Build-Depends filed of the debian samba package includes libbsd-dev, which, in turn, depends on libbsd0. This is the host architecture, i.e. the architecture you're building for. So your build system should have libbsd0:arm64 installed. Thanks, /mjt
Martin Kjær Jørgensen
2026-Jun-15 11:26 UTC
[Samba] cross compile heimdal linking libbsd issue
On 06/15/26 12:37 PM, Michael Tokarev wrote:> > Not an answer to your question directly but do you know that samba > package for debian can be easily cross-compiled using multiarch and > qemu-user? In particular, I provide builds of debian samba packages > for x86_64 *and* for arm64 architectures on my site this way > (http://www.corpit.ru/mjt/packages/samba/). > > > The Build-Depends filed of the debian samba package includes libbsd-dev, > which, in turn, depends on libbsd0. This is the host architecture, i.e. > the architecture you're building for. So your build system should have > libbsd0:arm64 installed. > > Thanks, > > /mjt >I have investigated further, and I can solve the problems by installing qemu-user, add it to binfmt, and let it execute the target compiled `compile_et` and `asn1_compile` as they are compiled for aarch64. This also requires of me to set appropriate LD_LIBRARY_PATH to the sysroot-target. If I do not have qemu-aarch64 installed in binfmt the samba build fails because the host does not recognize the executables. I have also tried to install `comerr-dev` and `heimdal-multidev` and add USING_SYSTEM_ASN1_COMPILE=1 ASN1_COMPILE=/usr/bin/asn1_compile USING_SYSTEM_COMPILE_ET=1 COMPILE_ET=/usr/bin/compile_et to the ./configure script, but samba build does not pick it up. I then tried write the options in the `third_party/heimdal_build/wscript_configure` which solved the first problems, but not all.>From what I know, it seems samba requires an KRB5 implementation to buildat all, but I would prefer to leave it out in my use case. My aim is to cross build samba for very limited embedded hardware platform _without_ the need for qemu-user, and I wish to strip samba from anything unnecessary. It only needs to support a "simple" file share, and accept user and password login from a smbpasswd file. To mitigate my current build situation, I am installing MIT-KRB5 on the target to satisfy samba needs. -- /Martin