summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-04-30 09:07:58 +0200
committerGuido Günther <agx@sigxcpu.org>2013-04-30 09:07:58 +0200
commit60e9fd43eb68089a3c367c20a31d64db5dcd03fa (patch)
tree17370f7a75a8a24e9f52f767fbb0cb5fb6da454d /m4
parent95adca0059888a2aa16cd9330cfa7cc22b8cf11f (diff)
New upstream version 1.0.5~rc1
Diffstat (limited to 'm4')
-rw-r--r--m4/virt-compile-pie.m435
-rw-r--r--m4/virt-compile-warnings.m41
-rw-r--r--m4/virt-linker-relro.m432
3 files changed, 68 insertions, 0 deletions
diff --git a/m4/virt-compile-pie.m4 b/m4/virt-compile-pie.m4
new file mode 100644
index 000000000..cceb495df
--- /dev/null
+++ b/m4/virt-compile-pie.m4
@@ -0,0 +1,35 @@
+dnl
+dnl Check for support for position independent executables
+dnl
+dnl Copyright (C) 2013 Red Hat, Inc.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([LIBVIRT_COMPILE_PIE],[
+ PIE_CFLAGS=
+ PIE_LDFLAGS=
+ case "$host" in
+ *-*-mingw* | *-*-msvc* | *-*-cygwin* )
+ ;; dnl All code is position independent on Win32 target
+ *)
+ gl_COMPILER_OPTION_IF([-fPIE -DPIE], [
+ PIE_CFLAGS="-fPIE -DPIE"
+ PIE_LDFLAGS="-pie"
+ ])
+ esac
+ AC_SUBST([PIE_CFLAGS])
+ AC_SUBST([PIE_LDFLAGS])
+])
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index a08fcac9f..e05491308 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -93,6 +93,7 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
if test $lv_cv_gcc_pragma_push_works = no; then
dontwarn="$dontwarn -Wmissing-prototypes"
dontwarn="$dontwarn -Wmissing-declarations"
+ dontwarn="$dontwarn -Wcast-align"
fi
dnl Check whether strchr(s, char variable) causes a bogus compile
diff --git a/m4/virt-linker-relro.m4 b/m4/virt-linker-relro.m4
new file mode 100644
index 000000000..9bca90ec8
--- /dev/null
+++ b/m4/virt-linker-relro.m4
@@ -0,0 +1,32 @@
+dnl
+dnl Check for -z now and -z relro linker flags
+dnl
+dnl Copyright (C) 2013 Red Hat, Inc.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([LIBVIRT_LINKER_RELRO],[
+ AC_MSG_CHECKING([for how to force completely read-only GOT table])
+
+ RELRO_LDFLAGS=
+ `$LD --help 2>&1 | grep -- "-z relro" >/dev/null` && \
+ RELRO_LDFLAGS="-Wl,-z -Wl,relro"
+ `$LD --help 2>&1 | grep -- "-z now" >/dev/null` && \
+ RELRO_LDFLAGS="$RELRO_LDFLAGS -Wl,-z -Wl,now"
+ AC_SUBST([RELRO_LDFLAGS])
+
+ AC_MSG_RESULT([$RELRO_LDFLAGS])
+])