demikernel-dpdk-bindings build.rs uses x86-only -mavx flag unconditionally, breaks build on AArch64
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- rust
- Domain
- build-system
Research direction
Start in demikernel-dpdk-bindings/build.rs around the binding-generation failure reported at line 314, and inspect where -mavx and other ISA-specific flags are added. Reproduce the AArch64 build with the listed environment and make command, then verify the build completes without unsupported x86 flags.
Written by the indexing model from the issue text.
Description
Description
When building demikernel-dpdk-bindings on AArch64, the build script fails because it unconditionally adds the x86-only compiler flag -mavx. Clang rejects this flag on non-x86 architectures.
How to Reproduce
-
export PKG_CONFIG_PATH=${DPDK_PREFIX}/lib/aarch64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$DPDK_PREFIX/lib/aarch64-linux-gnu:$LD_LIBRARY_PATH
export CFLAGS="-I$DPDK_PREFIX/include"
export LIBDPDK_PATH="$DPDK_PREFIX"
export CC="$(which clang)" # demikernel often builds bindings fine with clang
export INSTALL_PREFIX=/data/work/install/demikernel
make LIBOS=catnip PKG_CONFIG_PATH=$DPDK_PREFIX/lib/aarch64-linux-gnu/pkgconfig RUST_BACKTRACE=1 -
Results in the following output:
mkdir -p /data/work/demikernel/lib git config --local core.hooksPath .githooks LD_LIBRARY_PATH: /data/work/install/dpdk/lib/aarch64-linux-gnu:/data/work/install/dpdk/lib/aarch64-linux-gnu: PKG_CONFIG_PATH: /data/work/install/dpdk/lib/aarch64-linux-gnu/pkgconfig /home/supratim/.cargo/bin/cargo build --lib --features=catnip-libos --no-default-features --features=mlx4 --profile release
...
error: failed to run custom build command fordemikernel-dpdk-bindings v1.1.8
Caused by: process didn't exit successfully:/data/work/demikernel/target/release/build/demikernel-dpdk-bindings-f5a218369eb03f72/build-script-build (exit status: 101) -
Also, see this error message :
error: unsupported option '-mavx' for target 'aarch64-unknown-linux-gnu' thread 'main' panicked at .../demikernel-dpdk-bindings-1.1.8/build.rs:314:29: Failed to generate bindings
Expected Behavior
-mavx and other ISA-specific flags should only be added when:
CARGO_CFG_TARGET_ARCH == "x86_64"
Suggested Fix
change in build.rs :
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
if arch == "x86_64" {
cc.flag("-mavx");
}
- Dominant language
- Rust
- Stars
- 1.2k
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/demikernel
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
microsoft/demikernel#1637 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 65/100
microsoft/demikernel#1629 ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/demikernel#1634 ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/demikernel#1632 ·
-
feature
Difficulty 5/5 Over a week Newbie friendliness 35/100
microsoft/demikernel#1627 ·
All issues in microsoft/demikernel
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·