a5bd9f6
From 242ce139276b9de1e5f960070e433111a3ab5194 Mon Sep 17 00:00:00 2001
a5bd9f6
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
a5bd9f6
Date: Thu, 3 Jan 2013 21:34:34 +0100
a5bd9f6
Subject: [PATCH 081/364] 	* configure.ac: Extend -Wno-trampolines to
a5bd9f6
 host.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog    |  4 ++++
a5bd9f6
 configure.ac | 17 +++++++++++++++++
a5bd9f6
 2 files changed, 21 insertions(+)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index 2717f8a..087b5c3 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,5 +1,9 @@
a5bd9f6
 2013-01-03  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
 
a5bd9f6
+	* configure.ac: Extend -Wno-trampolines to host.
a5bd9f6
+
a5bd9f6
+2013-01-03  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
+
a5bd9f6
 	* grub-core/fs/iso9660.c (grub_iso9660_susp_iterate): Avoid hang if
a5bd9f6
 	entry->len = 0.
a5bd9f6
 
a5bd9f6
diff --git a/configure.ac b/configure.ac
a5bd9f6
index a41f117..dde954e 100644
a5bd9f6
--- a/configure.ac
a5bd9f6
+++ b/configure.ac
a5bd9f6
@@ -358,6 +358,23 @@ AC_CHECK_HEADER([util.h], [
a5bd9f6
 ])
a5bd9f6
 AC_SUBST([LIBUTIL])
a5bd9f6
 
a5bd9f6
+AC_CACHE_CHECK([whether -Wno-trampolines work], [grub_cv_host_cc_wnotrampolines], [
a5bd9f6
+  SAVED_CFLAGS="$CFLAGS"
a5bd9f6
+  # Test for -Wtrampolines rather than -Wno-trampolines to reduce confusion
a5bd9f6
+  # in the event of later failures (since -Wno-* is always accepted, but
a5bd9f6
+  # produces a diagnostic if something else is wrong).
a5bd9f6
+  CFLAGS="$HOST_CFLAGS -Wtrampolines"
a5bd9f6
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
a5bd9f6
+int va_arg_func (int fixed, va_list args);]], [[]])],
a5bd9f6
+      [grub_cv_host_cc_wnotrampolines=yes],
a5bd9f6
+      [grub_cv_host_cc_wnotrampolines=no])
a5bd9f6
+  CFLAGS="$SAVED_CFLAGS"
a5bd9f6
+])
a5bd9f6
+
a5bd9f6
+if test x"$grub_host_cv_cc_wnotrampolines" = xyes ; then
a5bd9f6
+  HOST_CFLAGS="$HOST_CFLAGS -Wno-trampolines"
a5bd9f6
+fi
a5bd9f6
+
a5bd9f6
 #
a5bd9f6
 # Check for host and build compilers.
a5bd9f6
 #
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6