Mailinglist Archive: opensuse-bugs (4283 mails)

< Previous Next >
[Bug 1037914] kyotokabinet builds with -march=native, which generates non portable binaries.
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Mon, 08 May 2017 07:39:30 +0000
  • Message-id: <>

--- Comment #3 from Richard Biener <rguenther@xxxxxxxx> ---
You clearly may not use -march=native (or any -march switch) when compiling
packages. RPM_OPT_FLAGS use the correct architecture specific flags to use
(and in fact GCC has those as default anyway).

A rpmlint check could look at debuginfo:

readelf -w a.out | grep DW_AT_producer | grep -- -march= && exit 1

for -march=native on my local machine you'd get

<167> DW_AT_producer : (indirect string, offset: 0x168): GNU C11 6.3.1
20170131 [gcc-6-branch revision 245058] -march=haswell -mmmx -mno-3dnow -msse
-msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul
-mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx
-mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase
-mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f
-mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt
-mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl
-mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-mwaitx -mno-clzero -mno-pku
--param l1-cache-size=32 --param l1-cache-line-size=64 --param
l2-cache-size=10240 -mtune=haswell -g -O2

it should possibly be a warning only given code may intentionally provide
optimized paths guarded with cpuid() checks.

You are receiving this mail because:
You are on the CC list for the bug.
< Previous Next >