* Fix farm

This commit is contained in:
pancake 2011-09-26 02:10:25 +02:00
parent 76941ca843
commit 4e3358a522
23 changed files with 74 additions and 37 deletions

View File

@ -9,4 +9,4 @@ ALL_TARGETS+=${TARGET_MIPS}
STATIC_OBJ+=${OBJ_MIPS}
${TARGET_MIPS}: ${OBJ_MIPS}
${CC_LIB} ${TARGET_MIPS} $(call libname,asm_mips) ${LDFLAGS} ${CFLAGS} ${OBJ_MIPS}
${CC} $(call libname,asm_mips) ${LDFLAGS} ${CFLAGS} ${OBJ_MIPS}

View File

@ -6,4 +6,4 @@ TARGET_ANY=bin_any.${EXT_SO}
ALL_TARGETS+=${TARGET_ANY}
${TARGET_ANY}: ${OBJ_ANY}
${CC_LIB} ${TARGET_ANY} $(call libname,bin_any) ${CFLAGS} ${OBJ_ANY}
${CC} $(call libname,bin_any) ${CFLAGS} ${OBJ_ANY}

View File

@ -7,4 +7,4 @@ TARGET_ELF=bin_elf.${EXT_SO}
ALL_TARGETS+=${TARGET_ELF}
${TARGET_ELF}: ${OBJ_ELF}
${CC_LIB} ${TARGET_ELF} $(call libname,bin_elf) ${CFLAGS} ${OBJ_ELF}
${CC} $(call libname,bin_elf) ${CFLAGS} ${OBJ_ELF}

View File

@ -7,4 +7,4 @@ TARGET_ELF64=bin_elf64.${EXT_SO}
ALL_TARGETS+=${TARGET_ELF64}
${TARGET_ELF64}: ${OBJ_ELF64}
${CC_LIB} ${TARGET_ELF64} $(call libname,bin_elf64) -shared ${CFLAGS} ${OBJ_ELF64}
${CC} $(call libname,bin_elf64) -shared ${CFLAGS} ${OBJ_ELF64}

View File

@ -6,4 +6,4 @@ TARGET_JAVA=bin_java.${EXT_SO}
ALL_TARGETS+=${TARGET_JAVA}
${TARGET_JAVA}: ${OBJ_JAVA}
${CC_LIB} ${TARGET_JAVA} $(call libname,bin_java) ${CFLAGS} ${OBJ_JAVA}
${CC} $(call libname,bin_java) ${CFLAGS} ${OBJ_JAVA}

View File

@ -6,4 +6,4 @@ TARGET_MACH0=bin_mach0.${EXT_SO}
ALL_TARGETS+=${TARGET_MACH0}
${TARGET_MACH0}: ${OBJ_MACH0}
${CC_LIB} ${TARGET_MACH0} $(call libname,bin_mach0) ${CFLAGS} ${OBJ_MACH0}
${CC} $(call libname,bin_mach0) ${CFLAGS} ${OBJ_MACH0}

View File

@ -6,4 +6,4 @@ TARGET_PE=bin_pe.${EXT_SO}
ALL_TARGETS+=${TARGET_PE}
${TARGET_PE}: ${OBJ_PE}
${CC_LIB} ${TARGET_PE} $(call libname,bin_pe) ${CFLAGS} ${OBJ_PE}
${CC} $(call libname,bin_pe) ${CFLAGS} ${OBJ_PE}

View File

@ -6,4 +6,4 @@ TARGET_PE64=bin_pe64.${EXT_SO}
ALL_TARGETS+=${TARGET_PE64}
${TARGET_PE64}: ${OBJ_PE64}
${CC_LIB} ${TARGET_PE64} $(call libname,bin_pe64) ${CFLAGS} ${OBJ_PE64}
${CC} $(call libname,bin_pe64) ${CFLAGS} ${OBJ_PE64}

View File

@ -91,5 +91,9 @@ endif
LIB=lib${NAME}
LIBAR=${LIB}.${EXT_AR}
LIBSO=${LIB}.${EXT_SO}
libname=-shared ${LDFLAGS_SONAME}$1.${EXT_SO}.${LIBVERSION}
ifeq (${OSTYPE},android)
libname=-shared -o ${LDFLAGS_SONAME}$1.${EXT_SO}
else
libname=-shared -o ${LDFLAGS_SONAME}$1.${EXT_SO}.${LIBVERSION}
endif

View File

@ -106,7 +106,8 @@ static int r_debug_native_reg_write(int pid, int tid, int type, const ut8* buf,
#include <sys/wait.h>
#include <limits.h>
#ifdef __ANDROID__
# define R_DEBUG_REG_T struct user_regs
// #if __arm__
# define R_DEBUG_REG_T struct pt_regs
#else
#include <sys/user.h>
# if __i386__ || __x86_64__
@ -121,8 +122,6 @@ typedef unsigned long mips64_regs_t [4096];
# endif
#else // OS
//#undef R_DEBUG_REG_T
//#define R_DEBUG_REG_T struct pt_regs
#warning Unsupported debugging platform
#undef DEBUGGER
@ -218,11 +217,11 @@ static int r_debug_native_step(RDebug *dbg) {
ret = R_FALSE;
} else ret = R_TRUE;
#else // linux
ut32 addr = 0; /* should be eip */
ut64 addr = 0; /* should be eip */
//ut32 data = 0;
//printf("NATIVE STEP over PID=%d\n", pid);
addr = r_debug_reg_get (dbg, "pc");
ret = ptrace (PTRACE_SINGLESTEP, pid, addr, 0); //addr, data);
ret = ptrace (PTRACE_SINGLESTEP, pid, (void*)(size_t)addr, 0); //addr, data);
if (ret == -1) {
perror ("native-singlestep");
ret = R_FALSE;
@ -1337,7 +1336,7 @@ return R_FALSE;
// eprintf ("EFLAGS =%x\n", ctx.EFlags);
return SetThreadContext (tid2handler (pid, tid), &ctx)? R_TRUE: R_FALSE;
#elif __linux__
int ret = ptrace (PTRACE_SETREGS, pid, 0, buf);
int ret = ptrace (PTRACE_SETREGS, pid, 0, (void*)buf);
if (sizeof (R_DEBUG_REG_T) < size)
size = sizeof (R_DEBUG_REG_T);
return (ret != 0) ? R_FALSE: R_TRUE;

View File

@ -27,4 +27,4 @@ TARGET_GDB=debug_gdb.${EXT_SO}
ALL_TARGETS+=${TARGET_GDB}
${TARGET_GDB}: ${OBJ_GDB}
${CC_LIB} ${TARGET_GDB} $(call libname,debug_gdb) ${OBJ_GDB} ${CFLAGS} ${LDFLAGS}
${CC_LIB} $(call libname,debug_gdb) ${OBJ_GDB} ${CFLAGS} ${LDFLAGS}

View File

@ -778,6 +778,9 @@ static void gdbwrap_writeregister2(gdbwrap_t *desc, ureg32 regNum, la32 val) {
reg = gdbwrap_readgenreg (desc);
ret = gdbwrap_lastmsg (desc);
ASSERT (reg != NULL && ret != NULL);
if (reg == NULL) {
fprintf (stderr, "gdbwrap_writeregister: Fail\n");
}
snprintf (locreg, sizeof(locreg), "%08x", gdbwrap_little_endian(val));
memcpy (ret + offset, locreg, 2 * sizeof (ureg32));

View File

@ -6,7 +6,7 @@ TARGET_PTRACE=debug_native.${EXT_SO}
ALL_TARGETS+=${TARGET_PTRACE}
${TARGET_PTRACE}: ${OBJ_PTRACE}
${CC_LIB} ${TARGET_PTRACE} $(call libname,debug_native) ${CFLAGS} \
${CC} $(call libname,debug_native) ${CFLAGS} \
${LDFLAGS_LINKPATH}.. -L.. \
${LDFLAGS_LINKPATH}../../lib -L../../lib -lr_lib \
${LDFLAGS_LINKPATH}../../io -L../../io -lr_io \

View File

@ -23,5 +23,5 @@ LINKFLAGS+=${SSL_LDFLAGS}
endif
${TARGET_IODBG}: ${OBJ_IODBG}
${CC_LIB} ${TARGET_IODBG} $(call libname,io_debug) ${CFLAGS} ${LDFLAGS_LIB} \
${CC} $(call libname,io_debug) ${CFLAGS} ${LDFLAGS_LIB} \
${LINKFLAGS} ${LDFLAGS_LINKPATH}.. -L.. -lr_io ${OBJ_IODBG}

View File

@ -38,5 +38,5 @@ endif
# TODO : link against gdbwrapper
${TARGET_GDB}: ${OBJ_GDB}
${CC_LIB} ${TARGET_GDB} $(call libname,io_gdb) ${OBJ_GDB} ${CFLAGS} ${LDFLAGS} \
${CC} $(call libname,io_gdb) ${OBJ_GDB} ${CFLAGS} ${LDFLAGS} \
${GDBWRAPFILES} ${LINKFLAGS} ${LDFLAGS_LIB}

View File

@ -21,4 +21,4 @@ LINKFLAGS+=${SSL_LDFLAGS}
endif
${TARGET_HARET}: ${OBJ_HARET}
${CC_LIB} ${TARGET_HARET} $(call libname,io_haret) ${CFLAGS} ${OBJ_HARET} ${LINKFLAGS}
${CC} $(call libname,io_haret) ${CFLAGS} ${OBJ_HARET} ${LINKFLAGS}

View File

@ -5,8 +5,8 @@ TARGET_PROCPID=io_procpid.${EXT_SO}
ALL_TARGETS+=${TARGET_PROCPID}
${TARGET_PROCPID}: ${OBJ_PROCPID}
${CC_LIB} ${TARGET_PROCPID} ${CFLAGS} ${LDFLAGS_LIB} \
$(call libname,io_procpid) \
${CC} $(call libname,io_procpid) \
${CFLAGS} ${LDFLAGS_LIB} \
${LDFLAGS_LINKPATH}../../util -L../../util -lr_util \
${LDFLAGS_LINKPATH}.. -L.. -L../../lib -lr_lib -lr_io \
${OBJ_PROCPID}

View File

@ -5,4 +5,4 @@ ALL_TARGETS+=${TARGET_MREPLACE}
STATIC_OBJ+=${OBJ_MREPLACE}
${TARGET_MREPLACE}: ${OBJ_MREPLACE}
${CC_LIB} ${TARGET_MREPLACE} $(call libname,parse_mreplace) ${CFLAGS} ${OBJ_MREPLACE}
${CC} $(call libname,parse_mreplace) ${CFLAGS} ${OBJ_MREPLACE}

View File

@ -66,7 +66,7 @@ R_API int r_th_kill(struct r_th_t *th, int force) {
r_th_wait(th);
#if HAVE_PTHREAD
#ifdef __ANDROID__
kill (th->tid, 9);
pthread_kill (th->tid, 9);
#else
pthread_cancel (th->tid);
#endif

View File

@ -20,8 +20,8 @@ fi
NDKPATH_ARM=`echo ${NDK}/toolchains/arm-*/prebuilt/${OS}-x86/bin/`
NDKPATH_X86=`echo ${NDK}/toolchains/x86-*/prebuilt/${OS}-x86/bin/`
INCDIR=${NDK}/platforms/android-8/arch-arm/usr/include/
CFLAGS=-I${INCDIR}
#INCDIR=${NDK}/platforms/android-8/arch-arm/usr/include/
#CFLAGS=-I${INCDIR}
PATH=$SDK/tools:$SDK/platform-tools:$NDK:${NDKPATH_X86}:${NDKPATH_ARM}:$PATH
export PATH

View File

@ -4,11 +4,25 @@
for a in log/*.log ; do
b=$(echo $a|sed -e 's,.log$,.html,')
r=$(echo $a|sed -e 's,.log$,.ret,')
t=$(echo $a|sed -e 's,.log$,.time,')
c=$(echo $a|sed -e 's,.log$,.cpu,')
echo "<html><body style=background-color:black;color:white;font-family:Verdana>" > $b
echo "<h1><a href=./>index</a></h1>" >> $b
echo "<h1>$a</h1>" >> $b
warnings=$(cat $a|grep warning: |wc -l)
errors=$(cat $a|grep error: |wc -l)
if [ -f $t ]; then
echo "<h2>time:</h2>" >> $b
echo "<pre>" >> $b
cat $t >> $b
echo "</pre>" >> $b
fi
if [ -f $c ]; then
echo "<h2>cpu:</h2>" >> $b
echo "<pre>" >> $b
cat $c >> $b
echo "</pre>" >> $b
fi
echo "<h2>warnings: $warnings</h2>" >> $b
echo "<h2>errors: $errors</h2>" >> $b
echo "<h2>return: "`cat $r`"</h2>" >> $b
@ -41,10 +55,12 @@ for a in log/*.html ; do
[ $a = log/index.html ] && continue
f=$(echo $a | sed -e 's,log/,,')
l=log/$(echo $f | sed -e 's,.html,.log,')
ft=log/$(echo $f | sed -e 's,.html,.time,')
n=$(echo $f | sed -e 's,.html,,' | sed -e 's,-, ,g')
t=$(cat $ft |grep real|awk '{print $2}')
warnings=$(cat $l|grep warning: |wc -l)
errors=$(cat $l|grep error: |wc -l)
echo "<h2><a href=$f>$n</a> (w:$warnings e:$errors)</h2>" >> log/index.html
echo "<h2><a href=$f>$n</a> (<font color=yellow>w:</font>$warnings <font color=red>e:</font>$errors $t)</h2>" >> log/index.html
done
cat <<EOF >> log/index.html

View File

@ -15,11 +15,23 @@ logfile() {
echo "log/${PACKAGE}-`tstamp`-`revision`-$1"
}
getcpu() {
uname -a
cat /proc/cpuinfo | grep "model name" | head -n1
printf "cpus: "
cat /proc/cpuinfo | grep processor | tail -n 1 | awk '{print $3}'
printf "bogomips: "
cat /proc/cpuinfo | grep bogomips | tail -n 1 | awk '{print $3}'
}
mkdir -p farm/log
for a in ${TARGETS} ; do
L=farm/`logfile $a`
T=$L.time
C=$L.cpu
getcpu > $C
echo "= $a" | tee $L.log
./${a}.sh 2>&1 | tee -a $L.log
(time ./${a}.sh 2>&1 | tee -a $L.log) 2> $T
echo $? > $L.ret
done
echo `revision` > farm/last-revision

View File

@ -18,23 +18,26 @@ if [ "${ARCH}" = "arm" ]; then
ANDROID_SDK_VERSION=8
NDKPFX=${ARCH}-linux-androideabi
else
NDKPFX=i686-android-linux
ANDROID_SDK_VERSION=9 #x86
NDKPFX=i686-android-linux
fi
PLATFORM=android-${ANDROID_SDK_VERSION}
PLATFORM_PATH=${PROGDIR}/platforms/${PLATFORM}/arch-${ARCH}/usr/
PLATFORM_ROOT=${PROGDIR}/platforms/${PLATFORM}/arch-${ARCH}
PLATFORM_PATH=${PLATFORM_ROOT}/usr
NDK_BINS=`echo ${PROGDIR}/toolchains/${ARCH}-*/prebuilt/${OS}-x86/bin`
CFLAGS=-I${PLATFORM_PATH}/include
CFLAGS="--sysroot=${PLATFORM_ROOT}"
CFLAGS="${CFLAGS} -I${PLATFORM_PATH}/include"
LDFLAGS=-L${PLATFORM_PATH}/lib
LDFLAGS="${LDFLAGS} -nostdlib"
LDFLAGS="${LDFLAGS} -lc -ldl"
LDFLAGS="${LDFLAGS} -Wl,-dynamic-linker=/system/bin/linker"
#LDFLAGS="${LDFLAGS} -nostdlib"
#LDFLAGS="${LDFLAGS} -lc -ldl"
#LDFLAGS="${LDFLAGS} -Wl,-dynamic-linker=/system/bin/linker"
if [ -z "`echo $@ | grep shared`" ]; then
LDFLAGS="${LDFLAGS} ${PLATFORM_PATH}/lib/crtbegin_dynamic.o"
fi
LDFLAGS="${LDFLAGS} --sysroot=${PLATFORM_ROOT}"
#if [ -z "`echo $@ | grep shared`" ]; then
#LDFLAGS="${LDFLAGS} ${PLATFORM_PATH}/lib/crtbegin_dynamic.o"
#fi
CC=${NDKPFX}-gcc
EXT_SO=so