dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0082-configure.ac-Extend-Wno-trampolines-to-host.patch

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