DimStar already tried to enable v2 on Staging:O as he did before for v3 https://build.opensuse.org/projects/openSUSE:Factory:Staging:O/prjconf So far it says: Optflags: x86_64 -march=x86-64-v2 On Tue, 2022-09-27 at 10:55 +0000, Richard Biener wrote:
On Tue, 27 Sep 2022, Stefan Seyfried wrote:
Hi,
can someone describe what the exact changes in which OBS projects / packages will be to enable x86_64-v2-or-later-only?
There is mainly the project config and its 'Optflags' setting but in the past (mostly for non-x86 architectures) we have also hard- wired the lowest supported architecture in the GCC configuration. I now have a pending change there for x86-64-v2 which looks like
%if "%{TARGET_ARCH}" == "i586" %if 0%{?sle_version:%sle_version} >= 150000 %if %{suse_version} >= 1599 --with-arch-32=x86-64-v2 \ %else --with-arch-32=x86-64 \ %endif %else --with-arch-32=i586 \ %endif --with-tune=generic \ %endif %if "%{TARGET_ARCH}" == "x86_64" %ifnarch %{disable_multilib_arch} --enable-multilib \ %if %{suse_version} >= 1599 --with-arch-32=x86-64-v2 \ %else --with-arch-32=x86-64 \ %endif %endif
(mightly complicated - there's also still no sle_version in the ALP repositories I could use).
The above effectively means -march=x86-64-v2 will be default unless overridden on the command-line. It also means GCCs runtime is built with this setting.
Note on SLES 15 we build the 'i586' tree with -march=x86-64 to also get the 32bit multilibs benefit from features of x86-64 where applicable. In Factory we're building the 'i586' tree (and thus 32bit multilibs for x86_64) with -march=i586 so they are usable in a pure 32bit environment as well.
My idea is that I'd like to build a set of packages that allow "legacy" machines to still boot / be useful. My guess / hope is, that only a few packages actually need to be built with "legacy" flags enabled (glibc of course, maybe gcc?) and most others will just keep working. More packages can then be added if we see "SIGILL" crashes.
With the GCC change above you'd need to override Optflags in the project config with
Optflags: x86_64 -march=x86-64
but note that packages that do not use RPM_OPT_FLAGS appropriately will have x86-64-v2 uses left via GCCs default unless you re-build the compiler.
Richard.
-- Luboš Kocman (he/him) openSUSE Leap Release Manager SUSE +1 2345678910 www.suse.com