Skip to content

Commit

Permalink
automatic commit at releng box
Browse files Browse the repository at this point in the history
  • Loading branch information
mc36 committed Jan 31, 2025
1 parent 0e2d9e0 commit 747c0b2
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 16 deletions.
53 changes: 41 additions & 12 deletions misc/native/c.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/sh
TR=../../binTmp
mkdir -p $TR
UM=`uname -m`
MF=""
AB="gnu"
SR="/"

MD="-O0 -g --analyze" #pretesting
MD="-O0 -g -fsanitize=address" #testing
Expand All @@ -11,12 +15,6 @@ MD="-O3" #release
#bt full
#p *((struct <type> *)(<addr>))

UM=`uname -m`
MF=""
if [ "$UM" = "x86_64" ]; then
MF="-march=corei7"
fi

if which clang > /dev/null ; then
CC="clang"
CS="llvm-strip"
Expand All @@ -29,20 +27,51 @@ if which clang > /dev/null ; then
BS="bpf-strip"
fi

echo arch=$UM, cc=$CC, cs=$CS, bc=$BC, bs=$BS, mode=$MD, flag=$MF, out=$TR
while [[ $# -gt 0 ]]; do
case $1 in
um)
UM=$2
;;
ab)
AB=$2
;;
sr)
SR=$2
;;
cc)
CC=$2
;;
cs)
CS=$2
;;
bc)
BC=$2
;;
bs)
BS=$2
;;
esac
shift 2
done

if [ "$UM" = "x86_64" ]; then
MF="-march=corei7"
fi

echo arch=$UM, abi=$AB, sys=$SR, cc=$CC, cs=$CS, bc=$BC, bs=$BS, mode=$MD, flag=$MF, out=$TR

compileBpf()
{
echo compiling $1.
$BC -Wall $MD -c -g -I /usr/include/ -I /usr/include/$UM-linux-gnu/ -o$TR/$1.bin $1.c
$BC -Wall $MD -c -g -I /usr/include/ -I /usr/include/$UM-linux-$AB/ -o$TR/$1.bin $1.c
$BS -d $TR/$1.bin || true
touch -c -d "2010-01-01 00:00:00" $TR/$1.bin || true
}

compileLib()
{
echo compiling $1.
$CC -fpic -shared -Wall -Wl,--build-id=none $MD $3 -o$TR/lib$1.so $2 $1.c
$CC --sysroot $SR -fpic -shared -Wall -Wl,--build-id=none $MD $3 -o$TR/lib$1.so $2 $1.c
chmod -x $TR/lib$1.so || true
$CS $TR/lib$1.so || true
touch -c -d "2010-01-01 00:00:00" $TR/lib$1.so || true
Expand All @@ -51,15 +80,15 @@ touch -c -d "2010-01-01 00:00:00" $TR/lib$1.so || true
linkTwoLibs()
{
echo linking $1.
$CC -Wall -Wl,-rpath='$ORIGIN/' -Wl,--build-id=none $MD -o$TR/$1.bin -L$TR -l$2 -l$3 $4
$CC --sysroot $SR -Wall -Wl,-rpath='$ORIGIN/' -Wl,--build-id=none $MD -o$TR/$1.bin -L$TR -l$2 -l$3 $4
$CS $TR/$1.bin || true
touch -c -d "2010-01-01 00:00:00" $TR/$1.bin || true
}

compileFile()
{
echo compiling $1.
$CC -Wall -Wl,--build-id=none $MD $4 -o$TR/$1.bin $2 $1.c $3
$CC --sysroot $SR -Wall -Wl,--build-id=none $MD $4 -o$TR/$1.bin $2 $1.c $3
$CS $TR/$1.bin || true
touch -c -d "2010-01-01 00:00:00" $TR/$1.bin || true
}
Expand All @@ -83,7 +112,7 @@ for fn in p4emu_full p4emu_tiny p4emu_huge p4emu_dbg p4emu_nocr p4emu_none p4emu
done

for fn in p4emu_dpdk; do
compileLib $fn "-I /usr/include/dpdk/ -I /usr/include/$UM-linux-gnu/dpdk" $MF
compileLib $fn "-I /usr/include/dpdk/ -I /usr/include/$UM-linux-$AB/dpdk" $MF
done

linkTwoLibs "p4emu" "p4emu_pcap" "p4emu_full" "-lpthread -lpcap -lcrypto"
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url;file;result;test
-;-;-;freeRouter v25.1.31-cur, done by sprscc13@mrn0b0dy.
-;-;-;2025-01-31 07:20:04, took 00:15:11, with 50 workers, on 3634 cases, 0 failed, 0 traces, 7 retries
-;-;-;2025-01-31 07:51:30, took 00:15:03, with 50 workers, on 3634 cases, 0 failed, 0 traces, 0 retries
-;-;-;./rtr.bin
http://sources.freertr.org/cfg/basic01.tst;basic01.tst;success;dummy test
http://sources.freertr.org/cfg/basic02.tst;basic02.tst;success;interface with slot
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v25.1.31-cur, done by sprscc13@mrn0b0dy.<br/>
tested: 2025-01-31 07:20:04, took 00:15:11, with 50 workers, on 3634 cases, 0 failed, 0 traces, 7 retries<br/>
tested: 2025-01-31 07:51:30, took 00:15:03, with 50 workers, on 3634 cases, 0 failed, 0 traces, 0 retries<br/>
jvm: ./rtr.bin<br/>
<br/>
<table><thead><tr><td><b>file</b></td><td><b>result</b></td><td><b>test</b></td></tr></thead><tbody>
Expand Down
2 changes: 1 addition & 1 deletion src/rtr8.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url;file;result;test
-;-;-;freeRouter v25.1.31-cur, done by sprscc13@mrn0b0dy.
-;-;-;2025-01-31 07:33:49, took 00:13:15, with 50 workers, on 700 cases, 0 failed, 0 traces, 0 retries
-;-;-;2025-01-31 08:06:12, took 00:14:12, with 50 workers, on 700 cases, 0 failed, 0 traces, 0 retries
-;-;-;./rtr.bin
http://sources.freertr.org/cfg/p4lang-acl001.tst;p4lang-acl001.tst;success;p4lang: copp
http://sources.freertr.org/cfg/p4lang-acl002.tst;p4lang-acl002.tst;success;p4lang: ingress access list
Expand Down
2 changes: 1 addition & 1 deletion src/rtr8.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v25.1.31-cur, done by sprscc13@mrn0b0dy.<br/>
tested: 2025-01-31 07:33:49, took 00:13:15, with 50 workers, on 700 cases, 0 failed, 0 traces, 0 retries<br/>
tested: 2025-01-31 08:06:12, took 00:14:12, with 50 workers, on 700 cases, 0 failed, 0 traces, 0 retries<br/>
jvm: ./rtr.bin<br/>
<br/>
<table><thead><tr><td><b>file</b></td><td><b>result</b></td><td><b>test</b></td></tr></thead><tbody>
Expand Down

0 comments on commit 747c0b2

Please sign in to comment.