Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch a bug in dpdk which caused build failures in rare cases #22

Merged
merged 1 commit into from
Oct 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Patch a bug in dpdk which caused build failures in rare cases
  • Loading branch information
Jan Kryl committed Oct 23, 2019
commit 26865ef37365f2e988d5d2c7c3ac7c357271dcf9
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