Skip to content

Commit

Permalink
debian packaging: disable LTO build profile
Browse files Browse the repository at this point in the history
Fixes the build on Ubuntu distributions with aggressive enabling of LTO
for all builds.

This build profile sets CFLAGS and CXXFLAGS in a way that prevents cargo
tests from linking. This manifests as errors like:

= note: make[5]: *** read jobs pipe: Bad file descriptor.  Stop.
        make[5]: *** Waiting for unfinished jobs....
        lto-wrapper: fatal error: make returned 2 exit status
        compilation terminated.
        /usr/bin/ld: error: lto-wrapper failed
        collect2: error: ld returned 1 exit status
  • Loading branch information
zanchey committed May 17, 2024
1 parent 3d648e6 commit f4a79cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# The LTO profile sets CFLAGS/CXXFLAGS which confuse the compilation process; disable it
# LTO is still performed by rustc based on Cargo.toml
export DEB_BUILD_MAINT_OPTIONS=optimize=-lto

%:
dh $@
Expand Down

0 comments on commit f4a79cc

Please sign in to comment.