build: Strip the binaries before using/releasing them
Stripping the release build for glibc shrinks the size considerably: $ du -h target/release/cloud-hypervisor 8.5M target/release/cloud-hypervisor $ strip target/release/cloud-hypervisor $ du -h target/release/cloud-hypervisor 5.2M target/release/cloud-hypervisor Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
a4d23c3cf3
commit
6fde2d18a6
2 changed files with 10 additions and 0 deletions
|
|
@ -211,6 +211,10 @@ sudo ip tuntap add name vunet-tap0 mode tap
|
|||
sudo ip tuntap add name vunet-tap1 mode tap multi_queue
|
||||
|
||||
cargo build --release --target $BUILD_TARGET
|
||||
strip target/$BUILD_TARGET/release/cloud-hypervisor
|
||||
strip target/$BUILD_TARGET/release/vhost_user_net
|
||||
strip target/$BUILD_TARGET/release/ch-remote
|
||||
|
||||
sudo setcap cap_net_admin+ep target/$BUILD_TARGET/release/cloud-hypervisor
|
||||
sudo setcap cap_net_admin+ep target/$BUILD_TARGET/release/vhost_user_net
|
||||
|
||||
|
|
@ -242,6 +246,10 @@ RES=$?
|
|||
if [ $RES -eq 0 ]; then
|
||||
# virtio-mmio based testing
|
||||
cargo build --release --target $BUILD_TARGET --no-default-features --features "mmio"
|
||||
strip target/$BUILD_TARGET/release/cloud-hypervisor
|
||||
strip target/$BUILD_TARGET/release/vhost_user_net
|
||||
strip target/$BUILD_TARGET/release/ch-remote
|
||||
|
||||
sudo setcap cap_net_admin+ep target/$BUILD_TARGET/release/cloud-hypervisor
|
||||
|
||||
# Ensure test binary has the same caps as the cloud-hypervisor one
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue