Menu

#3 Compile with musl libc

Unstable (example)
closed
nobody
None
5
2016-02-19
2015-06-17
Felix Janda
No

The attached patches almost make traceroute compile with musl libc (http://musl-libc.org).

The first patch makes support for IDN in libc's resolver optional.

The second patch is a sed -i 's/u_int/uint/'. The u_int*_t types are not standard and therefore on musl <sys types.h=""> needs to be included to get them. It is easier though to use the standard <stdint.h> types because the netinet headers are already using them anyway.

The third patch is a sed -i 's.sys/poll.poll/'. <sys poll.h=""> is a non-standard synonym for <poll.h>. musl omits a warning when trying to include it.

It would be nice if the DOS-newlines in mod-dccp.c could be converted.

mod-tcp.c does not compile yet, because musl does not provide the TCPOPT* constants in <netinet tcp.h="">. Since apart from iptables this seems to be the only project using them, it is not clear whether they will be added. As the values of the TCP options don't randomly change, it would be nice if the code be

2; / TCPOPT_MAXSEG /

instead of

TCPOPT_MAXSEG; / 2 /

and likewise in the other places.

Discussion

  • Felix Janda

    Felix Janda - 2015-06-17

    Patch 1

     
  • Felix Janda

    Felix Janda - 2015-06-17

    Patch 2

     
  • Felix Janda

    Felix Janda - 2015-06-17

    Patch 3

     

    Last edit: Felix Janda 2015-06-17
  • Dmitry Butskoy

    Dmitry Butskoy - 2015-06-17

    Thanks.

    Agree with all except the TCPOPT_MAXSEG -- this macro is present in standard Linuxes for decade, it is a task for musl to include it.
    Moreover, since the "diet-like" libc libraries are useful for systems with "diet-like" resources, it is likely it might be used for some, say, low-level network controller, where the TCPOPT_* etc. macros might be needed.

    Anyway, is it possible with the musl just to compile with additional cflags "-D AI_IDN=0 -D NI_IDN=0 -D TCPOPT_MAXSEG=2" ? It could be better than to change code for the (currently) rare environment...

    I'll put uint, poll and DOS fixes to the next release.

     
  • Dmitry Butskoy

    Dmitry Butskoy - 2015-06-18

    OK, I'll resolve the macros issue as well.

     
  • Felix Janda

    Felix Janda - 2015-06-18

    Thank you very much.

     
  • Dmitry Butskoy

    Dmitry Butskoy - 2016-02-14

    According to http://git.musl-libc.org/cgit/musl/commit/?id=53f41fb568ae43034c9876cc9bd3961fd6d13671 musl is going to support TCPOPT... constants in netinet/tcp.h . Hence the traceroute code can be unchanged.

    What about AI_IDN and NI_IDN ?

     

    Last edit: Dmitry Butskoy 2016-02-14
  • Felix Janda

    Felix Janda - 2016-02-14

    Yes, the TCPOPT constants have been added.

    IDN is planned for musl-1.15. (musl-1.13 hasn't yet been released.)

     
  • Dmitry Butskoy

    Dmitry Butskoy - 2016-02-15

    IDN is planned for musl-1.15
    Well, whether it could be applicable to temporary use the additional cflags "-D AI_IDN=0 -D NI_IDN=0" until musl-1.15 is released?

     
  • Dmitry Butskoy

    Dmitry Butskoy - 2016-02-19

    Done in 2.0.22

    Thanks.

     
  • Dmitry Butskoy

    Dmitry Butskoy - 2016-02-19
    • status: open --> closed
     

Log in to post a comment.