Is there a way to pass '-march=znver2' to the compiler from
rpmbuild?
I don't know but you can change the line:
optflags: x86_64 %{__global_compiler_flags} -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
from the file /usr/lib/rpm/redhat/rpmrc