From d17a5cf9d6927a694445569115ee42eef819ff66 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 16 Jul 2022 13:14:53 +0200 Subject: [PATCH] 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. --- debian/changelog | 5 +++++ debian/rules | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8e579aa..5e016d2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sat, 16 Jul 2022 13:12:46 +0200 diff --git a/debian/rules b/debian/rules index 4fb76dd..360c7fd 100755 --- a/debian/rules +++ b/debian/rules @@ -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