I actually dont know it this is an error on my side. But it seems that the PKGBUILD apply the cflags twice. One from the system and another one from the config file.
export CFLAGS="${CFLAGS} ${_custom_opt_flags}"
export CPPFLAGS="${CPPFLAGS} ${_custom_opt_flags}"
export CXXFLAGS="${CXXFLAGS} ${_custom_opt_flags}"
Using 'CC' from environment with value: 'gcc -m32'
Using 'CFLAGS' from environment with value: '-O2 -pipe -march=native -fstack-protector-strong -fno-plt -march=native -fno-tree-vectorize -O3'
Using 'LDFLAGS' from environment with value: '-Wl,-O2,--sort-common,--as-needed,-z,relro'
Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2 -march=native -fno-tree-vectorize -O3'
Using 'CXX' from environment with value: 'g++ -m32'
Using 'CXXFLAGS' from environment with value: '-O2 -pipe -march=native -fstack-protector-strong -fno-plt -march=native -fno-tree-vectorize -O3'
Using 'LDFLAGS' from environment with value: '-Wl,-O2,--sort-common,--as-needed,-z,relro'
Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2 -march=native -fno-tree-vectorize -O3'
Using 'CC' from environment with value: 'gcc -m32'
Using 'CFLAGS' from environment with value: '-O2 -pipe -march=native -fstack-protector-strong -fno-plt -march=native -fno-tree-vectorize -O3'
Using 'LDFLAGS' from environment with value: '-Wl,-O2,--sort-common,--as-needed,-z,relro'
Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2 -march=native -fno-tree-vectorize -O3'
export CFLAGS=" ${_custom_opt_flags}"
export CPPFLAGS=" ${_custom_opt_flags}"
export CXXFLAGS=" ${_custom_opt_flags}"
Using 'CC' from environment with value: 'gcc -m32'
Using 'CFLAGS' from environment with value: '-march=native -fno-tree-vectorize -O3'
Using 'LDFLAGS' from environment with value: '-Wl,-O2,--sort-common,--as-needed,-z,relro'
Using 'CPPFLAGS' from environment with value: '-march=native -fno-tree-vectorize -O3'
Using 'CXX' from environment with value: 'g++ -m32'
Using 'CXXFLAGS' from environment with value: '-march=native -fno-tree-vectorize -O3'
Using 'LDFLAGS' from environment with value: '-Wl,-O2,--sort-common,--as-needed,-z,relro'
Using 'CPPFLAGS' from environment with value: '-march=native -fno-tree-vectorize -O3'
Using 'CC' from environment with value: 'gcc -m32'
Using 'CFLAGS' from environment with value: '-march=native -fno-tree-vectorize -O3'
Using 'LDFLAGS' from environment with value: '-Wl,-O2,--sort-common,--as-needed,-z,relro'
Using 'CPPFLAGS' from environment with value: '-march=native -fno-tree-vectorize -O3'
Compiler options Current Value Possible Values Description
---------------- ------------- --------------- -----------
c_args [-march=native, -fno-tree-vectorize, -O3, -march=native, -fno-tree-vectorize, -O3] Extra arguments passed to the c compiler
c_link_args [-march=native, -fno-tree-vectorize, -O3, -Wl,-O2,--sort-common,--as-needed,-z,relro] Extra arguments passed to the c linker
c_std c99 [none, c89, c99, c11, c17, c18, gnu89, gnu99, gnu11, gnu17, C language standard to use
gnu18]
cpp_args [-march=native, -fno-tree-vectorize, -O3, -march=native, -fno-tree-vectorize, -O3] Extra arguments passed to the cpp compiler
cpp_debugstl false [true, false] STL debug mode
cpp_eh default [none, default, a, s, sc] C++ exception handling type.
cpp_link_args [-march=native, -fno-tree-vectorize, -O3, -Wl,-O2,--sort-common,--as-needed,-z,relro]
So I dont know if thats intended. Maybe its also a bad idea to make -march=native the default system wide. On the other hand shouldnt be the intention of the config file to override my cflags?