This file is indexed.

/usr/src/gcc-8/debian/patches/ada-acats.diff is in gcc-8-source 8-20180414-1ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# DP: - When running the ACATS, look for the gnat tools in their new
# DP:   directory (build/gnattools), and for the shared libraries in
# DP:   build/gcc/ada/rts and build/libgnatvsn.

--- a/src/gcc/testsuite/ada/acats/run_acats.sh
+++ b/src/gcc/testsuite/ada/acats/run_acats.sh
@@ -22,45 +22,25 @@
 
 # Set up environment to use the Ada compiler from the object tree
 
-host_gnatchop=`which gnatchop`
-host_gnatmake=`which gnatmake`
 ROOT=`${PWDCMD-pwd}`
 BASE=`cd $ROOT/../../..; ${PWDCMD-pwd}`
 
 PATH=$BASE:$ROOT:$PATH
-ADA_INCLUDE_PATH=$BASE/ada/rts
-LD_LIBRARY_PATH=$ADA_INCLUDE_PATH:$BASE:$LD_LIBRARY_PATH
-ADA_OBJECTS_PATH=$ADA_INCLUDE_PATH
 
-if [ ! -d $ADA_INCLUDE_PATH ]; then
-   echo gnatlib missing, exiting.
-   exit 1
-fi
+TARGET=`${GCC_DRIVER} -v  2>&1 |grep '^Target:' | cut -d' ' -f2`
+GNATTOOLS=`cd $BASE/../gnattools; ${PWDCMD-pwd}`
+LIBGNATVSN=`cd $BASE/../${TARGET}/libgnatvsn; ${PWDCMD-pwd}`
 
-if [ ! -f $BASE/gnatchop ]; then
-   echo gnattools missing, exiting.
-   exit 1
-fi
-
-if [ ! -f $BASE/gnatmake ]; then
-   echo gnattools missing, exiting.
-   exit 1
-fi
+export GNATTOOLS LIBGNATVSN LIBGNATPRJ
 
 export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH BASE LD_LIBRARY_PATH
 
 echo '#!/bin/sh' > host_gnatchop
-echo PATH=`dirname $host_gnatchop`:'$PATH' >> host_gnatchop
-echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatchop
-echo export PATH >> host_gnatchop
 echo exec gnatchop '"$@"' >> host_gnatchop
 
 chmod +x host_gnatchop
 
 echo '#!/bin/sh' > host_gnatmake
-echo PATH=`dirname $host_gnatmake`:'$PATH' >> host_gnatmake
-echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatmake
-echo export PATH >> host_gnatmake
 echo exec gnatmake '"$@"' >> host_gnatmake
 
 chmod +x host_gnatmake
--- a/src/gcc/testsuite/ada/acats/run_all.sh
+++ b/src/gcc/testsuite/ada/acats/run_all.sh
@@ -14,6 +14,10 @@
 
 # End of customization section.
 
+RTS=`cd $GNATTOOLS/../gcc/ada/rts; ${PWDCMD-pwd}`
+LD_LIBRARY_PATH=$RTS:$LIBGNATVSN
+export LD_LIBRARY_PATH
+
 # Perform arithmetic evaluation on the ARGs, and store the result in the
 # global $as_val. Take advantage of shells that can avoid forks. The arguments
 # must be portable across $(()) and expr.
@@ -56,12 +60,16 @@
 GCC="$BASE/xgcc -B$BASE/"
 
 target_gnatchop () {
-  $BASE/gnatchop --GCC="$BASE/xgcc" $*
+  ADA_INCLUDE_PATH=$GNATTOOLS/../../src/gcc/ada \
+  $GNATTOOLS/gnatchop --GCC="$BASE/xgcc" $*
 }
 
 target_gnatmake () {
-  echo $BASE/gnatmake --GNATBIND=$BASE/gnatbind --GNATLINK=$BASE/gnatlink --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
-  $BASE/gnatmake --GNATBIND=$BASE/gnatbind --GNATLINK=$BASE/gnatlink --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
+  EXTERNAL_OBJECTS="$EXTERNAL_OBJECTS $RTS/adaint.o $RTS/sysdep.o $RTS/init.o $RTS/raise-gcc.o"
+  $GNATTOOLS/gnatmake -I- -I$RTS -I. \
+      --GCC="$GCC" --GNATBIND="$GNATTOOLS/gnatbind" \
+      --GNATLINK="$GNATTOOLS/gnatlink" $gnatflags $gccflags $* \
+      -bargs -static -largs $EXTERNAL_OBJECTS --GCC="$GCC -I- -I$RTS -I."
 }
 
 target_gcc () {
@@ -98,8 +106,8 @@
 display `$GCC -v 2>&1`
 display host=`gcc -dumpmachine`
 display target=$target
-display `type gnatmake`
-gnatls -v >> $dir/acats.log
+display `type $GNATTOOLS/gnatmake`
+$GNATTOOLS/gnatls -I- -I$RTS -v >> $dir/acats.log
 display ""
 
 if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ]; then
@@ -130,7 +138,7 @@
    exit 1
 fi
 target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
-target_bit=`cat $dir/support/impbit.out`
+target_bit=`cat $dir/support/impbit.out | sed -e 's/ //g' -e 's/\r//g'`
 echo target_bit="$target_bit" >> $dir/acats.log
 
 # Find out a suitable asm statement
--- a/src/gcc/testsuite/lib/gnat.exp
+++ b/src/gcc/testsuite/lib/gnat.exp
@@ -88,18 +88,24 @@
     global GNAT_UNDER_TEST
     global TOOL_EXECUTABLE
     global gnat_target_current
+    global ld_library_path
 
     set gnat_target_current ""
 
     if { $gnat_initialized == 1 } { return }
 
-    if ![info exists GNAT_UNDER_TEST] then {
-	if [info exists TOOL_EXECUTABLE] {
-	    set GNAT_UNDER_TEST "$TOOL_EXECUTABLE"
-	} else {
-	    set GNAT_UNDER_TEST "[local_find_gnatmake]"
-	}
-    }
+    set target [target_info name]
+    set GNAT_UNDER_TEST "$rootme/../gnattools/gnatmake -I$rootme/ada/rts --GCC=$rootme/xgcc --GNATBIND=$rootme/../gnattools/gnatbind --GNATLINK=$rootme/../gnattools/gnatlink -cargs -B$rootme -largs --GCC=$rootme/xgcc -B$rootme -margs"
+    append ld_library_path ":$rootme/ada/rts"
+    append ld_library_path ":$rootme/../$target/libgnatvsn"
+    set_ld_library_path_env_vars
+
+    # gnatlink looks for system.ads itself and has no --RTS option, so
+    # specify via environment
+    verbose -log "ADA_INCLUDE_PATH=$rootme/ada/rts"
+    verbose -log "ADA_OBJECTS_PATH=$rootme/ada/rts"
+    setenv ADA_INCLUDE_PATH "$rootme/ada/rts"
+    setenv ADA_OBJECTS_PATH "$rootme/ada/rts"
 
     if ![info exists tmpdir] then {
 	set tmpdir /tmp
@@ -121,31 +127,6 @@
 	return [gcc_target_compile $source $dest $type $options]
     }
 
-    # If we detect a change of target, we need to recompute both
-    # GNAT_UNDER_TEST and the appropriate RTS.
-    if { $gnat_target_current!="[current_target_name]" } {
-	set gnat_target_current "[current_target_name]"
-	if [info exists TOOL_OPTIONS] {
-	    set rtsdir "[get_multilibs ${TOOL_OPTIONS}]/libada"
-	} else {
-	    set rtsdir "[get_multilibs]/libada"
-	}
-	if [info exists TOOL_EXECUTABLE] {
-	    set GNAT_UNDER_TEST "$TOOL_EXECUTABLE"
-	} else {
-	    set GNAT_UNDER_TEST "[local_find_gnatmake]"
-	}
-        set GNAT_UNDER_TEST "$GNAT_UNDER_TEST --RTS=$rtsdir"
-
-	# gnatlink looks for system.ads itself and has no --RTS option, so
-	# specify via environment
-	setenv ADA_INCLUDE_PATH "$rtsdir/adainclude"
-	setenv ADA_OBJECTS_PATH "$rtsdir/adainclude"
-	# Always log so compilations can be repeated manually.
-	verbose -log "ADA_INCLUDE_PATH=$rtsdir/adainclude"
-	verbose -log "ADA_OBJECTS_PATH=$rtsdir/adainclude"
-    }
-
     lappend options "compiler=$GNAT_UNDER_TEST -q -f"
     lappend options "timeout=[timeout_value]"