diff --git a/qemu.spec b/qemu.spec index 097bdb0..40899bb 100644 --- a/qemu.spec +++ b/qemu.spec @@ -337,6 +337,12 @@ such as kvm_stat. extraldflags="-Wl,--build-id"; buildldflags="VL_LDFLAGS=-Wl,--build-id" +%ifarch s390 +# drop -g flag to prevent memory exhaustion by linker +%global optflags %(echo %{optflags} | sed 's/-g//') +sed -i.debug 's/-g//g' configure +%endif + %ifarch %{ix86} x86_64 # sdl outputs to alsa or pulseaudio depending on system config, but it's broken (#495964) # alsa works, but causes huge CPU load due to bugs @@ -347,7 +353,7 @@ buildldflags="VL_LDFLAGS=-Wl,--build-id" --audio-drv-list=pa,sdl,alsa,oss \ --disable-strip \ --extra-ldflags=$extraldflags \ - --extra-cflags="$RPM_OPT_FLAGS" \ + --extra-cflags="%{optflags}" \ %ifarch x86_64 --enable-spice \ %endif @@ -373,7 +379,7 @@ make clean --disable-kvm \ --disable-strip \ --extra-ldflags=$extraldflags \ - --extra-cflags="$RPM_OPT_FLAGS" \ + --extra-cflags="%{optflags}" \ --disable-xen \ %ifarch x86_64 --enable-spice \