drop -march=native from CXXFLAGS

TL;DR: never ever use -march=native in CXXFLAGS for distro builds.

-march=native optimizes the build for the specific hardware it is
built on; this means that, for example, newer hardware features such
as AVX on x86_64, may be used, rendering the resulting binaries
completely unusable on hardware without the build-time bits used.
Because of this, -march=native is a giant no-no in distribution builds,
as you never want to optimize something based on the specific buildd
used, but rather make sure it will work on the architecture in general,
in a way compatible with the architecture baseline.
ci/unstable
Pino Toscano 2 years ago
parent c1ba03846d
commit d17a5cf9d6

5
debian/changelog vendored

@ -1,5 +1,10 @@
qt6-base (6.3.1+dfsg-4) UNRELEASED; urgency=medium
[ Pino Toscano ]
* Drop -march=native from the CXXFLAGS, as it will optimize the build for the
hardware it is built on (i.e. a specific buildd for each architecture),
making the binaries unusable (SIGBUS, "Illegal instruction") on hardware
without the build-time features.
-- Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org> Sat, 16 Jul 2022 13:12:46 +0200

3
debian/rules vendored

@ -19,9 +19,6 @@ else
extra_cmake_args += -DFEATURE_sctp=OFF
endif
# Prevent "Error: selected processor does not support `yield' in ARM mode"
export DEB_CXXFLAGS_MAINT_APPEND = -march=native
%:
dh $@ --with pkgkde_symbolshelper --buildsystem=cmake+ninja

Loading…
Cancel
Save