scc-patches

scc patches
Log | Files | Refs | README

0011-tests-Temp-fix.patch (2579B)


      1 From dd5e3daf78fd6c0938bc3d5c45107da84d4666ef Mon Sep 17 00:00:00 2001
      2 From: zerous Naveen Narayanan <zerous@nocebo.space>
      3 Date: Fri, 1 Nov 2019 20:50:33 +0100
      4 Subject: [PATCH 11/11] [tests] Temp fix
      5 
      6 ---
      7  tests/libc/execute/Makefile   |  4 ++--
      8  tests/libc/execute/cc.sh      | 18 ++++++++++--------
      9  tests/libc/execute/chktest.sh |  4 ++--
     10  3 files changed, 14 insertions(+), 12 deletions(-)
     11 
     12 diff --git a/tests/libc/execute/Makefile b/tests/libc/execute/Makefile
     13 index 00595eaa..8f81322c 100644
     14 --- a/tests/libc/execute/Makefile
     15 +++ b/tests/libc/execute/Makefile
     16 @@ -1,6 +1,6 @@
     17  .POSIX:
     18  
     19 -ROOT   = ../../../root
     20 +ROOT   = ../../..
     21  CFLAGS =
     22  CC     = SCCPREFIX=$(ROOT) ./cc.sh
     23  
     24 @@ -10,7 +10,7 @@ CC     = SCCPREFIX=$(ROOT) ./cc.sh
     25  all: tests
     26  
     27  tests:
     28 -	@CFLAGS='' SCCPREFIX=$(ROOT) chktest.sh libc-tests.lst
     29 +	@CFLAGS='' SCCPREFIX=$(ROOT) ./chktest.sh libc-tests.lst
     30  
     31  clean:
     32  	rm -f *.o *core a.out test.log
     33 diff --git a/tests/libc/execute/cc.sh b/tests/libc/execute/cc.sh
     34 index 1b2460c3..cfa1a264 100755
     35 --- a/tests/libc/execute/cc.sh
     36 +++ b/tests/libc/execute/cc.sh
     37 @@ -1,6 +1,7 @@
     38  #!/bin/sh
     39  
     40  set -e
     41 +set -x
     42  
     43  for i
     44  do
     45 @@ -29,22 +30,23 @@ do
     46  done
     47  
     48  sys=${sys:-`uname | tr 'A-Z' 'a-z'`}
     49 -abi=${abi:-amd64-sysv}
     50 +abi=${abi:-i386}
     51  out=${out:-a.out}
     52  root=${root:-$SCCPREFIX}
     53 -inc=$root/include/scc
     54 -arch_inc=$root/include/scc/bits/$abi
     55 -sys_inc=$root/include/scc/bits/$sys
     56 +inc=$root/include
     57 +arch_inc=$inc/bits/$abi
     58 +sys_inc=$inc/bits/$sys
     59  lib=$root/lib/scc/${abi}-${sys}
     60  obj=${1%.c}.o
     61  
     62  includes="-nostdinc -I$inc -I$arch_inc -I$sys_inc"
     63  flags="-std=c99 -g -w -fno-stack-protector --freestanding -static"
     64  
     65 -if ! gcc -nopie 2>&1 | grep unrecogn >/dev/null
     66 +# TODO: find a better way to handle CROSS_COMPILE
     67 +if ! i686-pc-linux-gnu-gcc -nopie 2>&1 | grep unrecogn >/dev/null
     68  then
     69 -	pie=-nopie
     70 +	pie=-no-pie
     71  fi
     72  
     73 -gcc $flags $pie $includes -c $1
     74 -ld -g $pie -z nodefaultlib -static -L$lib $lib/crt.o $obj -lc -o $out
     75 +i686-pc-linux-gnu-gcc $flags $pie $includes -c $1
     76 +i686-pc-linux-gnu-ld -g -z nodefaultlib -static -L$lib $lib/crt.o $obj -lc -o $out
     77 diff --git a/tests/libc/execute/chktest.sh b/tests/libc/execute/chktest.sh
     78 index ffafe66d..cbbf8d10 100755
     79 --- a/tests/libc/execute/chktest.sh
     80 +++ b/tests/libc/execute/chktest.sh
     81 @@ -13,9 +13,9 @@ do
     82  	rm -f a.out *.o $tmp1 $tmp2
     83  
     84  	(echo $i
     85 -	 ./cc.sh $CFLAGS $i.c
     86 +	 ./cc.sh $CFLAGS -o $i $i.c
     87  	 echo '/^output:$/+;/^end:$/-'w $tmp1 | ed -s $i.c
     88 -	 ./a.out > $tmp2
     89 +	 ./$i > $tmp2
     90  	 diff -u $tmp1 $tmp2) >> test.log 2>&1 &&
     91  	printf '[PASS]' || printf '[FAIL]'
     92  	printf "$state\t%s\n" $i
     93 -- 
     94 2.23.0
     95