From 6b991786ab182140e7d04bb29e9f79716b9dfc29 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 14 Aug 2012 01:48:39 +0200 Subject: [PATCH] Show git-tip hash in r2 -v dist now contains r2-bindings directory use more parse locks in mk files do not add invalid functions at UT64_MAX Use -j8 in sys/install.sh again --- Makefile | 2 +- binr/radare2/Makefile | 2 +- binr/radare2/radare2.c | 3 +++ config-user.mk.acr | 2 ++ configure.hook | 5 ++++- libr/config.mk.head | 3 +++ libr/config.mk.tail | 3 +++ libr/core/anal.c | 4 ++++ libr/rules.mk | 3 +++ sys/build.sh | 2 +- 10 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index dcc608492a..7af6e11476 100644 --- a/Makefile +++ b/Makefile @@ -170,7 +170,7 @@ r2-bindings-dist: dist: git log $$(git show-ref `git tag |tail -n1`)..HEAD > ChangeLog VERSION=${VERSION} ; \ - FILES=`git ls-files | grep -v r2-bindings | sed -e s,^,radare2-${VERSION}/,` ; \ + FILES=`git ls-files | sed -e s,^,radare2-${VERSION}/,` ; \ cd .. && mv radare2 radare2-${VERSION} && \ ${TAR} radare2-${VERSION}.tar.gz $${FILES} radare2-${VERSION}/ChangeLog ;\ mv radare2-${VERSION} radare2 diff --git a/binr/radare2/Makefile b/binr/radare2/Makefile index a67db36ecd..2869a32bb6 100644 --- a/binr/radare2/Makefile +++ b/binr/radare2/Makefile @@ -4,7 +4,7 @@ BINDEPS+=r_bin r_debug r_anal r_diff r_reg r_bp r_io r_cmd r_fs BINDEPS+=r_sign r_print r_lang r_asm r_syscall r_db r_hash r_line BINDEPS+=r_magic r_socket r_flags r_util r_th r_egg -CFLAGS+=-DR2_BIRTH=\"`date +%Y-%m-%d`\" +CFLAGS+=-DR2_BIRTH=\"`date +%Y-%m-%d`\" -DR2_GITTIP=\"$(GIT_TIP)\" include ../binr.mk diff --git a/binr/radare2/radare2.c b/binr/radare2/radare2.c index ccd065bc47..d0fd158066 100644 --- a/binr/radare2/radare2.c +++ b/binr/radare2/radare2.c @@ -57,7 +57,10 @@ static int main_help(int line) { } static int main_version() { + const char *gittip = R2_GITTIP; printf ("radare2 "R2_VERSION" @ "R_SYS_OS"-"R_SYS_ENDIAN"-"R_SYS_ARCH"-%d build "R2_BIRTH"\n", R_SYS_BITS&8?64:32); + if (*gittip) + printf ("commit: %s\n", gittip); return 0; } diff --git a/config-user.mk.acr b/config-user.mk.acr index 6edf61c1b4..5e54e06b84 100644 --- a/config-user.mk.acr +++ b/config-user.mk.acr @@ -49,3 +49,5 @@ USE_LIB_MAGIC=@USE_LIB_MAGIC@ SSL_CFLAGS=@SSL_CFLAGS@ SSL_LDFLAGS=@SSL_LDFLAGS@ + +GIT_TIP=$(shell git log HEAD^..HEAD|head -n1|cut -d ' ' -f2) diff --git a/configure.hook b/configure.hook index f9748718d0..c8790e6a5a 100755 --- a/configure.hook +++ b/configure.hook @@ -6,6 +6,9 @@ case "$1" in *) [ plugins.def.cfg -nt ./plugins.cfg ] && rm -f plugins.cfg [ ! -e plugins.cfg ] && ./configure-plugins $@ - r2-bindings/configure-langs $@ + [ -e r2-bindings/configure-langs ] && \ + r2-bindings/configure-langs $@ + TIP=`git log HEAD^..HEAD|head -n1|cut -d ' ' -f2` + echo ;; esac diff --git a/libr/config.mk.head b/libr/config.mk.head index 00b683b1fe..e65e8133d1 100644 --- a/libr/config.mk.head +++ b/libr/config.mk.head @@ -1,3 +1,6 @@ +ifeq ($(_INCLUDE_CONFIG_MK_),) +_INCLUDE_CONFIG_MK_=1 + CFLAGS_APPEND= GNULINUX=1 BSD=0 diff --git a/libr/config.mk.tail b/libr/config.mk.tail index 497f460115..cc384ab105 100644 --- a/libr/config.mk.tail +++ b/libr/config.mk.tail @@ -140,3 +140,6 @@ else libname=-shared -o $1.${EXT_SO} ${LDFLAGS_SONAME}$1.${EXT_SO}.${LIBVERSION} endif endif + +# -- singleton +endif diff --git a/libr/core/anal.c b/libr/core/anal.c index b44c99de15..9995ccfd6d 100644 --- a/libr/core/anal.c +++ b/libr/core/anal.c @@ -276,6 +276,10 @@ error: free (buf); // ugly hack to free fcn if (fcn) { + if (fcn->addr == UT64_MAX) { + r_anal_fcn_free (fcn); + return R_FALSE; + } // TODO: mark this function as not properly analyzed eprintf ("Analysis of function at 0x%08"PFMT64x" has failed\n", fcn->addr); if (!fcn->name) { diff --git a/libr/rules.mk b/libr/rules.mk index bb17e3011a..4c2ffa4b41 100644 --- a/libr/rules.mk +++ b/libr/rules.mk @@ -1,3 +1,5 @@ +ifeq ($(_INCLUDE_RULES_MK_),) +_INCLUDE_RULES_MK_=1 LIBR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST)))) include $(LIBR)/config.mk @@ -136,3 +138,4 @@ endif #------------------------------- # TODO: deprecate RTDEBUG and R_DEBUG +endif diff --git a/sys/build.sh b/sys/build.sh index a00e94826a..3299fa4084 100755 --- a/sys/build.sh +++ b/sys/build.sh @@ -1,6 +1,6 @@ #!/bin/sh -MAKE_JOBS=1 +MAKE_JOBS=8 MAKE=make gmake --help >/dev/null 2>&1