]> gcc.gnu.org Git - gcc.git/commitdiff
libgomp: Fix up FLOCK fallback handling [PR113192]
authorJakub Jelinek <jakub@redhat.com>
Wed, 10 Jan 2024 12:29:47 +0000 (13:29 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 20 Jun 2024 10:02:49 +0000 (12:02 +0200)
My earlier change broke Solaris testing, because @FLOCK@ isn't substituted
just into libgomp/Makefile where it worked, but also the
testsuite/libgomp-site-extra.exp file where Make variables aren't present
and can't be substituted.

The following patch instead computes the absolute srcdir path and uses it
for FLOCK.

2024-01-10  Jakub Jelinek  <jakub@redhat.com>

PR libgomp/113192
* configure.ac (FLOCK): Use $libgomp_abs_srcdir/testsuite/flock
instead of \$(abs_top_srcdir)/testsuite/flock.
* configure: Regenerated.

(cherry picked from commit 2fb3ee3ee82874e160309344bc3e52afeed8f26a)

libgomp/configure
libgomp/configure.ac

index 6aee94291ea350a005ff333b05c13c43d1d2025d..07a0efef8eaf1d75611fb49a87114d37c65fa5f6 100755 (executable)
@@ -16690,6 +16690,13 @@ done
 
 # Fallback if 'perl' is available.
 if test -z "$FLOCK"; then
+  # These need to be absolute paths, yet at the same time need to
+  # canonicalize only relative paths, because then amd will not unmount
+  # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
+  case $srcdir in
+    [\\/$]* | ?:[\\/]*) libgomp_abs_srcdir=${srcdir} ;;
+    *) libgomp_abs_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+  esac
   # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -16707,7 +16714,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_FLOCK="$srcdir/testsuite/flock"
+    ac_cv_prog_FLOCK="$libgomp_abs_srcdir/testsuite/flock"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
index 78a253c0f934b1a9d5c16b29fd4e68e92723fb26..16860255229f396621025acfbfb9d8ad87ef9121 100644 (file)
@@ -335,7 +335,16 @@ AC_MSG_NOTICE([checking for flock implementation])
 AC_CHECK_PROGS(FLOCK, flock)
 # Fallback if 'perl' is available.
 if test -z "$FLOCK"; then
-  AC_CHECK_PROG(FLOCK, perl, $srcdir/testsuite/flock)
+  # These need to be absolute paths, yet at the same time need to
+  # canonicalize only relative paths, because then amd will not unmount
+  # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
+  case $srcdir in
+changequote(,)dnl
+    [\\/$]* | ?:[\\/]*) libgomp_abs_srcdir=${srcdir} ;;
+changequote([,])dnl
+    *) libgomp_abs_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+  esac
+  AC_CHECK_PROG(FLOCK, perl, $libgomp_abs_srcdir/testsuite/flock)
 fi
 
 # Get target configury.
This page took 0.06796 seconds and 5 git commands to generate.