[PATCH v3] build/x86: fix support for older compilers

Thomas Monjalon thomas at monjalon.net
Thu Jul 3 15:23:02 CEST 2025


03/07/2025 12:21, Bruce Richardson:
> Some older compilers e.g. gcc 8.5, do not support overriding
> -march=native with another architecture, leading to build warnings such
> as reported in Bugzilla (link below). Add a check for that case, and
> explicitly add the avx512 flags if necessary.
> 
> Note: it appears that it is only the "native" flag that isn't
> overridden, which makes the issue hard to reproduce e.g. using
> godbolt.org, or on a modern machine. For example, testing with gcc 8.5
> on a haswell machine, using 'native' vs explicit 'haswell':
> 
> gcc -march=native -march=skylake-avx512 -dM -E - < /dev/null | grep AVX512 | wc -l
> 0
> 
> gcc -march=haswell -march=skylake-avx512 -dM -E - < /dev/null | grep AVX512 | wc -l
> 5
> 
> Bugzilla ID: 1736
> Fixes: e361ae3f59d3 ("build: reduce use of AVX compiler flags")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>

Applied, thanks.





More information about the dev mailing list