summaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authortejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-13 04:59:14 +0000
committertejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-13 04:59:14 +0000
commit3d2ab4bc6d80e9779aa3c9657cb54ee26f36686e (patch)
tree82ac9f479b6edc66be72e9fef90299de5bc73430 /gcc/configure.ac
parentb97a68a81f7073eefc9beb91cb500aa22a6b95c7 (diff)
downloadgcc-3d2ab4bc6d80e9779aa3c9657cb54ee26f36686e.tar.gz
This fixes PR gcov-profile/54487 where the gcda files were not locked
by the profile-use read, enabling writes by other instrumented compiles to change the profile in the middle of the profile use read. The GCOV_LOCKED macro was not set because it was guarded by HOST_HAS_F_SETLKW, which was never set. The fix is to add a compile test in the configure to set it. 2012-09-12 Teresa Johnson <tejohnson@google.com> PR gcov-profile/54487 * configure.ac (HOST_HAS_F_SETLKW): Set based on compile test using F_SETLKW with fcntl. * configure, config.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191238 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 699c7904f7c..9f200c7a991 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1159,6 +1159,22 @@ if test $gcc_cv_type_clock_t = yes; then
[Define if <time.h> defines clock_t.])
fi
+# Check if F_SETLKW is supported by fcntl.
+AC_CACHE_CHECK(for F_SETLKW, ac_cv_f_setlkw, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <fcntl.h>]], [[
+struct flock fl;
+fl.l_whence = 0;
+fl.l_start = 0;
+fl.l_len = 0;
+fl.l_pid = 0;
+return fcntl (1, F_SETLKW, &fl);]])],
+[ac_cv_f_setlkw=yes],[ac_cv_f_setlkw=no])])
+if test $ac_cv_f_setlkw = yes; then
+ AC_DEFINE(HOST_HAS_F_SETLKW, 1,
+ [Define if F_SETLKW supported by fcntl.])
+fi
+
# Restore CFLAGS, CXXFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
CFLAGS="$saved_CFLAGS"
CXXFLAGS="$saved_CXXFLAGS"