[Toybox] [PATCH 1/4] Implement hostname lookups in display_routes

Rob Landley rob at landley.net
Tue Jun 2 08:56:37 PDT 2020


On 6/1/20 10:56 AM, Eric Molitor wrote:
> ---
>  toys/pending/route.c | 46 +++++++++++++++++++++++++++++++-------------
>  1 file changed, 33 insertions(+), 13 deletions(-)

FYI route.c doesn't build with musl-cross-make because:

~/ccc/sh4-linux-musl-cross/sh4-linux-musl/include/sys/sysinfo.h:10:8: error:
redefinition of 'struct sysinfo'
   10 | struct sysinfo {
      |        ^~~~~~~
In file included from
~/ccc/sh4-linux-musl-cross/sh4-linux-musl/include/linux/kernel.h:5,
                 from
~/ccc/sh4-linux-musl-cross/sh4-linux-musl/include/linux/netlink.h:5,
                 from
~/ccc/sh4-linux-musl-cross/sh4-linux-musl/include/linux/rtnetlink.h:6,
                 from toys/pending/route.c:50:
~/ccc/sh4-linux-musl-cross/sh4-linux-musl/include/linux/sysinfo.h:8:8: note:
originally defined here

Builds find with glibc, but not with musl.

I'm pretty sure this is because glibc does this in sys/sinfo.h:

/* Get sysinfo structure from kernel header.  */
#include <linux/kernel.h>

And if you DON'T do that, including linux/rtnetlink.h along with sys/sysinfo.h
breaks the build.

Rob




More information about the Toybox mailing list