summaryrefslogtreecommitdiff
path: root/debian/patches/verbose-lto-linker.diff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-11-18 15:53:29 +0300
committerIgor Pashev <pashev.igor@gmail.com>2019-11-18 15:53:29 +0300
commit8f6c4b0033c72f8ac14694c419a99458339dd6a9 (patch)
tree06c106e622a58100aa85a381b9b65d222b076df4 /debian/patches/verbose-lto-linker.diff
parent42156b5190f4fa150e1fab6777eb81e69d4db8c9 (diff)
downloadgcc-9-debian.tar.gz
Import gcc-9 (9.2.1-19)debian/9.2.1-19debian
Diffstat (limited to 'debian/patches/verbose-lto-linker.diff')
-rw-r--r--debian/patches/verbose-lto-linker.diff97
1 files changed, 97 insertions, 0 deletions
diff --git a/debian/patches/verbose-lto-linker.diff b/debian/patches/verbose-lto-linker.diff
new file mode 100644
index 0000000..2e5bc74
--- /dev/null
+++ b/debian/patches/verbose-lto-linker.diff
@@ -0,0 +1,97 @@
+# DP: Emit some stderr output while doing the LTO Links
+
+Index: b/src/gcc/lock-and-run.sh
+===================================================================
+--- a/src/gcc/lock-and-run.sh
++++ b/src/gcc/lock-and-run.sh
+@@ -1,7 +1,8 @@
+-#! /bin/sh
++#! /bin/bash
+ # Shell-based mutex using mkdir.
+
+ lockdir="$1" prog="$2"; shift 2 || exit 1
++cmd=$(echo $prog "$@" | sed 's,^[^ ]*/,,;s, .*\( -o [^ ]*\) .*,\1,')
+
+ # Remember when we started trying to acquire the lock.
+ count=0
+@@ -11,24 +12,72 @@ trap 'rm -r "$lockdir" lock-stamp.$$' 0
+
+ until mkdir "$lockdir" 2>/dev/null; do
+ # Say something periodically so the user knows what's up.
+- if [ `expr $count % 30` = 0 ]; then
++ if [ `expr $count % 60` = 0 ]; then
+ # Reset if the lock has been renewed.
+ if [ -n "`find \"$lockdir\" -newer lock-stamp.$$`" ]; then
+ touch lock-stamp.$$
+ count=1
+- # Steal the lock after 5 minutes.
+- elif [ $count = 300 ]; then
+- echo removing stale $lockdir >&2
++ # Steal the lock after 30 minutes.
++ elif [ $count = 1800 ]; then
++ echo "removing stale $lockdir ($cmd)" >&2
+ rm -r "$lockdir"
+ else
+- echo waiting to acquire $lockdir >&2
++ echo "waiting to acquire $lockdir ($cmd)" >&2
+ fi
+ fi
+- sleep 1
+- count=`expr $count + 1`
++ sleep 6
++ count=`expr $count + 6`
+ done
+
+ echo $prog "$@"
+-$prog "$@"
++$prog "$@" &
++pid=$!
++
++count=0
++# once the "stale" locks are released, everything runs in
++# parallel, so be gentle with the timeout
++max_count=$((10 * 60 * 60))
++
++while true; do
++ status=$(jobs -l | sed -n "/ $pid /s/^.* $pid //p")
++ case "x$status" in
++ xRunning*)
++ : echo >&2 "running ..."
++ ;;
++ xExit*)
++ : echo >&2 "exit ..."
++ rv=$(echo $status | awk '{print $2}')
++ break
++ ;;
++ xDone*)
++ rv=0
++ break
++ ;;
++ x)
++ : echo >&2 "??? ..."
++ pstatus=$(ps $pid)
++ if [ "$?" -ne 0 ]; then
++ rv=0
++ break
++ fi
++ ;;
++ *)
++ echo >&2 "$(basename $0): PID $pid ($cmd): unknown: $status"
++ rv=48
++ break
++ esac
++ sleep 2
++ count=$(($count + 6))
++ if [ "$(($count % 300))" -eq 0 ]; then
++ echo >&2 "$(basename $0): PID $pid ($cmd) running for $count seconds"
++ fi
++ if [ $count -ge $max_count ]; then
++ echo >&2 "$(basename $0): PID $pid ($cmd) timeout after $count seconds"
++ kill -1 $pid
++ rv=47
++ fi
++done
++echo >&2 "$(basename $0): PID $pid ($cmd) finished after $count seconds"
+
+ # The trap runs on exit.
++exit $rv