Blame SOURCES/gcc44-pr54487.patch

f28b6a
2012-09-12  Teresa Johnson  <tejohnson@google.com>
f28b6a
f28b6a
	PR gcov-profile/54487
f28b6a
	* configure.ac (HOST_HAS_F_SETLKW): Set based on compile
f28b6a
	test using F_SETLKW with fcntl.
f28b6a
	* configure, config.in: Regenerate.
f28b6a
f28b6a
--- gcc/configure.ac	(revision 191237)
f28b6a
+++ gcc/configure.ac	(revision 191238)
f28b6a
@@ -1146,6 +1146,22 @@ if test $gcc_cv_type_clock_t = yes; then
f28b6a
   [Define if <time.h> defines clock_t.])
f28b6a
 fi
f28b6a
 
f28b6a
+# Check if F_SETLKW is supported by fcntl.
f28b6a
+AC_CACHE_CHECK(for F_SETLKW, ac_cv_f_setlkw, [
f28b6a
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
f28b6a
+#include <fcntl.h>]], [[
f28b6a
+struct flock fl;
f28b6a
+fl.l_whence = 0;
f28b6a
+fl.l_start = 0;
f28b6a
+fl.l_len = 0;
f28b6a
+fl.l_pid = 0;
f28b6a
+return fcntl (1, F_SETLKW, &fl);]])],
f28b6a
+[ac_cv_f_setlkw=yes],[ac_cv_f_setlkw=no])])
f28b6a
+if test $ac_cv_f_setlkw = yes; then
f28b6a
+  AC_DEFINE(HOST_HAS_F_SETLKW, 1,
f28b6a
+  [Define if F_SETLKW supported by fcntl.])
f28b6a
+fi
f28b6a
+
f28b6a
 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
f28b6a
 CFLAGS="$saved_CFLAGS"
f28b6a
 
f28b6a
--- gcc/configure	(revision 191237)
f28b6a
+++ gcc/configure	(revision 191238)
f28b6a
@@ -13271,6 +13271,76 @@ _ACEOF
f28b6a
 
f28b6a
 fi
f28b6a
 
f28b6a
+# Check if F_SETLKW is supported by fcntl.
f28b6a
+echo "$as_me:$LINENO: checking for F_SETLKW" >&5
f28b6a
+echo $ECHO_N "checking for F_SETLKW... $ECHO_C" >&6
f28b6a
+if test "${ac_cv_f_setlkw+set}" = set; then
f28b6a
+  echo $ECHO_N "(cached) $ECHO_C" >&6
f28b6a
+else
f28b6a
+
f28b6a
+cat >conftest.$ac_ext <<_ACEOF
f28b6a
+/* confdefs.h.  */
f28b6a
+_ACEOF
f28b6a
+cat confdefs.h >>conftest.$ac_ext
f28b6a
+cat >>conftest.$ac_ext <<_ACEOF
f28b6a
+/* end confdefs.h.  */
f28b6a
+
f28b6a
+#include <fcntl.h>
f28b6a
+int
f28b6a
+main ()
f28b6a
+{
f28b6a
+
f28b6a
+struct flock fl;
f28b6a
+fl.l_whence = 0;
f28b6a
+fl.l_start = 0;
f28b6a
+fl.l_len = 0;
f28b6a
+fl.l_pid = 0;
f28b6a
+return fcntl (1, F_SETLKW, &fl);
f28b6a
+  ;
f28b6a
+  return 0;
f28b6a
+}
f28b6a
+_ACEOF
f28b6a
+rm -f conftest.$ac_objext
f28b6a
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
f28b6a
+  (eval $ac_compile) 2>conftest.er1
f28b6a
+  ac_status=$?
f28b6a
+  grep -v '^ *+' conftest.er1 >conftest.err
f28b6a
+  rm -f conftest.er1
f28b6a
+  cat conftest.err >&5
f28b6a
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
f28b6a
+  (exit $ac_status); } &&
f28b6a
+	 { ac_try='test -z "$ac_c_werror_flag"
f28b6a
+			 || test ! -s conftest.err'
f28b6a
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
f28b6a
+  (eval $ac_try) 2>&5
f28b6a
+  ac_status=$?
f28b6a
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
f28b6a
+  (exit $ac_status); }; } &&
f28b6a
+	 { ac_try='test -s conftest.$ac_objext'
f28b6a
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
f28b6a
+  (eval $ac_try) 2>&5
f28b6a
+  ac_status=$?
f28b6a
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
f28b6a
+  (exit $ac_status); }; }; then
f28b6a
+  ac_cv_f_setlkw=yes
f28b6a
+else
f28b6a
+  echo "$as_me: failed program was:" >&5
f28b6a
+sed 's/^/| /' conftest.$ac_ext >&5
f28b6a
+
f28b6a
+ac_cv_f_setlkw=no
f28b6a
+fi
f28b6a
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
f28b6a
+fi
f28b6a
+echo "$as_me:$LINENO: result: $ac_cv_f_setlkw" >&5
f28b6a
+echo "${ECHO_T}$ac_cv_f_setlkw" >&6
f28b6a
+if test $ac_cv_f_setlkw = yes; then
f28b6a
+
f28b6a
+cat >>confdefs.h <<\_ACEOF
f28b6a
+#define HOST_HAS_F_SETLKW 1
f28b6a
+_ACEOF
f28b6a
+
f28b6a
+fi
f28b6a
+
f28b6a
 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
f28b6a
 CFLAGS="$saved_CFLAGS"
f28b6a
 
f28b6a
--- gcc/config.in	(revision 191237)
f28b6a
+++ gcc/config.in	(revision 191238)
f28b6a
@@ -1398,6 +1398,12 @@
f28b6a
 #endif
f28b6a
 
f28b6a
 
f28b6a
+/* Define if F_SETLKW supported by fcntl. */
f28b6a
+#ifndef USED_FOR_TARGET
f28b6a
+#undef HOST_HAS_F_SETLKW
f28b6a
+#endif
f28b6a
+
f28b6a
+
f28b6a
 /* Define as const if the declaration of iconv() needs const. */
f28b6a
 #ifndef USED_FOR_TARGET
f28b6a
 #undef ICONV_CONST