Re: Building with Musl

2016-07-26 Thread Matt Johnston
Hi Andrew,

I suspect Dropbear itself needs fixing, your workaround sounds fine for now. 
The configure script should probably just test for HAVE_LINUX_TYPES_H or 
similar and the required #defines. I'll look at it.

Cheers,
Matt

#ifdef SO_PRIORITY
#include 
#include 
#endif




> On Tue 26/7/2016, at 7:20 pm, Andrew Bainbridge  wrote:
> 
> Andrew Bainbridge  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 , 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.
> 



Re: Building with Musl

2016-07-26 Thread Alexander Dahl
Hei hei,

Am 2016-07-26 14:34, schrieb Szabolcs Nagy:
> note that there are several musl libc based linux distros
> that package dropbear e.g.
> http://git.alpinelinux.org/cgit/aports/plain/main/dropbear/

Which does not cross compile AFAIK. ;-)

> 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.

You can choose musl on buildroot [1] and it has no patches on current
master, but recently bumped the used dropbear version to 2016.74.

LEDE [2] is about to switch to musl, but I'm not sure if they use
patches, haven't looked into the tree recently.

ptxdist [3] cross compiles a recent dropbear without patches, but does
not use musl. ^^

HTH & Greets
Alex

[1] https://buildroot.org/
[2] https://www.lede-project.org/
[3] http://www.ptxdist.org/

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: C28E E6B9 0263 95CF 8FAF  08FA 34AD CD00 7221 5CC6 ***