Re: cross compile heimdal linking libbsd issue

Martin Kjær Jørgensen via samba <[email protected]> Mon, 15 Jun 2026 13:26:49 +0200
Newsgroups gmane.network.samba.general
Message-ID <bed771d5.AV8AAJyPcEAAAAAAAAAABGWc4AQAAYKKTDEAAAAAADUqzQBqL-F9@mailjet.com>
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 build
at 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

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba