[dpdk-dev] Changes to DPDK 17.02 to cross compile for Linux on Mac OS X

Raphael Cohn raphael.cohn at stormmq.com
Tue Mar 14 08:56:40 CET 2017


Hi,

If anyone's interested, there are a few small changes needed to pmdinfogen
to get it to cross-compile using Homebrew on Mac OS X. These aren't really
patch worthy, as my changes will break it for other BSD-based systems.

Firstly
local libelfPrefix="$(brew --prefix libelf)"
                local extra="-I${libelfPrefix}/include/libelf
-I${libelfPrefix}/include -isystem${dpdkSrcDir}/buildtools/pmdinfogen"
                sed -i -e 's;-g;-g '"$extra"';g'
buildtools/pmdinfogen/Makefile
                sed -i -e 's;#include <sys/endian\.h>;#include
"endian.h";g' buildtools/pmdinfogen/pmdinfogen.h

Secondly, create a simple endian.h file inside buildtools/pmdinfogen. There
are a few ones floating around on the web.

Thirdly, create a stripped down elf.h inside buildtools/pmdinfogen. There
are a few public domain ones floating around on the web. I'm not sure about
the copyright status of these, so I've not linked to them.

I'm using these changes currently as part of a Rust crate wrapping DPDK,
called `dpdk-sys` (it has a mid-level Rust wrapper called `dpdk`). It
compiles but it's early days - see https://github.com/lemonrock/dpdk .

Raph


More information about the dev mailing list