Building with Musl

Szabolcs Nagy nsz at port70.net
Tue Jul 26 20:34:46 AWST 2016


* Andrew Bainbridge <andbain at microsoft.com> [2016-07-26 11:20:01 +0000]:
> Andrew Bainbridge <andbain <at> microsoft.com> writes:
> 
> My embedded device is running Linux 3.4.0. I couldn't find 
> a package of kernel 3.4.0 kernel headers available on 
> Raspbian package manager, so I installed the nearest, which
> was linux-headers-3.6-trunk-rpi. Already, I can see myself 
> falling into a rabbit hole.
> 
> Then I found lots more compile errors failing to find more
> headers. So I ended up with an include path like this:
> 
> export CFLAGS="-I ../zlib-1.2.8 -I /usr/src/linux-headers-3.6
> -trunk-common/include -I /usr/src/linux-headers-3.6-trunk-
> common/arch/arm/include -I /usr/include/arm-linux-gnueabihf"
> 
> But then I end up with a error message from line 30 of 
> /usr/include/arm-linux-gnueabihf/bits/types.h. The compiler 
> complains about the keyword "typedef". The previous line was
> #include <bits/wordsize.h>, so presumably that file left the
> compiler in a bad state. 
> 
> At this point I gave up and removed #includes of 
> linux/types.h and linux/pkt_sched.h from dropbear's 
> includes.h. Then the only thing that failed to compile was a
> couple of places that wanted definitions of 
> TC_PRIO_INTERACTIVE_BULK and TC_PRIO_INTERACTIVE. Grepping
> the 3.6 kernel headers I installed, I saw that they are
> defined as 4 and 6 respectively, so I just pasted those 
> values in as literals. This is entirely not cool. I'm 
> ashamed. However, the code now compiles and works on the 
> embedded device.
> 
> I guess me learning how to cross compile properly is
> off-topic for this mailing list.

note that there are several musl libc based linux distros
that package dropbear e.g.
http://git.alpinelinux.org/cgit/aports/plain/main/dropbear/

some of them cross compile like openwrt so you might want
to look at their patches.

that said i dont remember running into issues when i last
built dropbear with musl.


More information about the Dropbear mailing list