Skip to content

Commit

Permalink
Patch a bug in dpdk which caused build failures in rare cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Kryl committed Oct 23, 2019
1 parent fcaf10b commit 26865ef
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions nix/pkgs/libspdk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ stdenv.mkDerivation rec {
CONFIGURE_OPTS = ''
--enable-debug --without-isal --with-iscsi-initiator --with-rdma
--with-internal-vhost-lib --disable-tests --with-dpdk-machine=native
--with-crypto
--with-crypto
'';

enableParallelBuilding = true;

postPatch = ''
patchShebangs ./.
substituteInPlace dpdk/config/defconfig_x86_64-native-linux-gcc --replace native default
substituteInPlace Makefile --replace examples ""
substituteInPlace Makefile --replace app ""
# Do not build examples and app directories
substituteInPlace Makefile --replace "examples app" ""
# A workaround for https://bugs.dpdk.org/show_bug.cgi?id=356
substituteInPlace dpdk/lib/Makefile --replace 'DEPDIRS-librte_vhost :=' 'DEPDIRS-librte_vhost := librte_hash'
'';

NIX_CFLAGS_COMPILE = "-mno-movbe -mno-lzcnt -mno-bmi -mno-bmi2 -march=corei7";
Expand All @@ -59,19 +61,18 @@ stdenv.mkDerivation rec {
'';

buildPhase = ''
TARGET_ARCHITECTURE=corei7 make -j4
# this should not be needed in the future as fixes are upstream that
# are supposed to fix the shared lib building.
TARGET_ARCHITECTURE=corei7 make -j $NIX_BUILD_CORES
# see README in spdk-sys why this needs to be done
find . -type f -name 'libspdk_ut_mock.a' -delete
find . -type f -name 'librte_vhost.a' -delete
$CC -shared -o libspdk_fat.so \
-lc -lrdmacm -laio -libverbs -liscsi -lnuma -ldl -lrt -luuid -lpthread -lcrypto \
-Wl,--whole-archive $(find build/lib -type f -name 'libspdk_*.a*' -o -name 'librte_*.a*') \
-Wl,--whole-archive $(find dpdk/build/lib -type f -name 'librte_*.a*') \
-Wl,--whole-archive $(find intel-ipsec-mb -type f -name 'libIPSec_*.a*') \
-Wl,--whole-archive \
$(find build/lib -type f -name 'libspdk_*.a*' -o -name 'librte_*.a*') \
$(find dpdk/build/lib -type f -name 'librte_*.a*') \
$(find intel-ipsec-mb -type f -name 'libIPSec_*.a*') \
-Wl,--no-whole-archive
'';

Expand Down

0 comments on commit 26865ef

Please sign in to comment.