Fix build of regress/

This commit is contained in:
pancake 2015-09-04 07:56:35 -04:00
parent bb27c4c6af
commit e89174c3f1
3 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
CFLAGS += -I../include
LDFLAGS = -L.. -lunicorn
LDFLAGS += ../libunicorn.a $(shell pkg-config --libs glib-2.0) -lpthread -lm
TESTS = map_crash map_write
TESTS += sigill sigill2
@ -16,4 +16,7 @@ all: $(TESTS)
clean:
rm -f $(TESTS)
%: %.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
.PHONY: all clean

View File

@ -1,5 +1,6 @@
#include <sys/types.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@ -13,7 +14,7 @@ static int count = 1;
// @size: size of machine instruction being executed
// @user_data: user data passed to tracing APIs.
void cb_hookblock(ucengine *uc, uint64_t address, uint32_t size, void *user_data) {
fprintf(stderr, "# >>> Tracing basic block at 0x%llx, block size = 0x%x\n", address, size);
fprintf(stderr, "# >>> Tracing basic block at 0x%"PRIx64", block size = 0x%x\n", address, size);
if (address != 0x1000000 && address != 0x1000200) {
fprintf(stderr, "not ok %d - address != 0x1000000 && address != 0x1000200\n", count++);
_exit(1);

View File

@ -7,7 +7,7 @@ LIBNAME = unicorn
# Find GLIB
ifndef GLIB
GLIB = `pkg-config --libs glib-2.0`
GLIB = $(shell pkg-config --libs glib-2.0)
endif
UNICORN_DEP_LIBS_STATIC += -lpthread -lm $(GLIB)