DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Compiling DPDK 17.02 using musl instead of glibc
@ 2017-03-14  7:45 Raphael Cohn
  0 siblings, 0 replies; only message in thread
From: Raphael Cohn @ 2017-03-14  7:45 UTC (permalink / raw)
  To: dev

Hi,

I've managed to compile DPDK 17.02 for musl instead of glibc. In essence, I
had to change a number of files. I've not prepared a patch at this stage,
but I wanted to share my changes with the list so that others can benefit.

Firstly, I apply the following minor sed edits:-

    # Assumes glibc
    sed -i -e 's;#include <rte_per_lcore.h>;#include <sched.h>\n#include
<rte_per_lcore.h>;g' lib/librte_eal/common/include/rte_lcore.h
    sed -i -e 's;#include <string.h>;#include <string.h>\n#include
<fcntl.h>;g' lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
    sed -i -e 's;#include <errno.h>;#include <errno.h>\n#include
<fcntl.h>;g' lib/librte_eal/linuxapp/eal/eal_memory.c
    sed -i -e 's;#include <string.h>;#include <string.h>\n#include
<sys/sysmacros.h>\n;g' lib/librte_eal/linuxapp/eal/eal_pci_uio.c
    sed -i -e 's;#define PAGE_SIZE;#undef PAGE_SIZE\n#define PAGE_SIZE;g'
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
    sed -i -e 's;#include <string.h>;#include <string.h>\n#include
<fcntl.h>;g' app/test/test_eal_flags.c

    # ?
    sed -i -e 's;uint hash_key_len;uint8_t hash_key_len;g'
app/test-pmd/testpmd.c app/test-pmd/testpmd.h app/t

Secondly, I replaced these files with dummies as they use glibc
functionality without equivalence:-
lib/librte_eal/linuxapp/eal/eal_debug.c
lib/librte_eal/linuxapp/eal/eal_log.c
lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c

That's not ideal

Lastly, I also had to modify musl itself:-
- Musl does not ship sys/queue.h. Perhaps in future DPDK could ship its own
copy of this? Musl will not be shipping it, either
- Musl lacks some functions in bits/io.h for x86_64. They seem open to
adding them, but need a contribution from someone knowledgeable (
http://www.openwall.com/lists/musl/2015/11/10/1). There is a patch shipped
with OSv for it.

Raph

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-14  7:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14  7:45 [dpdk-dev] Compiling DPDK 17.02 using musl instead of glibc Raphael Cohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).