diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2011-04-05 16:00:58 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2011-04-05 17:43:40 +0100 |
commit | dba5ba62bbf36c95879c4dea560721f2e970fbc5 (patch) | |
tree | 8b20435f150335e07404abaef65a9fd7abc249fc /m4 | |
parent | Avoid compiler warnings about int -> void * casts (diff) | |
download | libvirt-dba5ba62bbf36c95879c4dea560721f2e970fbc5.tar.gz libvirt-dba5ba62bbf36c95879c4dea560721f2e970fbc5.tar.bz2 libvirt-dba5ba62bbf36c95879c4dea560721f2e970fbc5.zip |
Don't try to enable stack protector on Win32
The GCC Win32 compiler will claim to support -fstack-protector,
but if it actually gets triggered by a suitable code pattern,
linking will fail. Other non-Linux OS likely suffer the same
way with gcc.
* m4/virt-compile-warnings.m4: Only use stack protector when
the build target is Linux.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/virt-compile-warnings.m4 | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index 7e252d551..819da8fc7 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -98,11 +98,17 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ # Extra special flags gl_WARN_ADD([-Wp,-D_FORTIFY_SOURCE=2]) - dnl Fedora only uses -fstack-protector, but doesn't seem to - dnl be great overhead in adding -fstack-protector-all instead - dnl gl_WARN_ADD([-fstack-protector]) - gl_WARN_ADD([-fstack-protector-all]) - gl_WARN_ADD([--param=ssp-buffer-size=4]) + dnl -fstack-protector stuff passes gl_WARN_ADD with gcc + dnl on Mingw32, but fails when actually used + case $host in + *-*-linux*) + dnl Fedora only uses -fstack-protector, but doesn't seem to + dnl be great overhead in adding -fstack-protector-all instead + dnl gl_WARN_ADD([-fstack-protector]) + gl_WARN_ADD([-fstack-protector-all]) + gl_WARN_ADD([--param=ssp-buffer-size=4]) + ;; + esac gl_WARN_ADD([-fexceptions]) gl_WARN_ADD([-fasynchronous-unwind-tables]) gl_WARN_ADD([-fdiagnostics-show-option]) |