summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>2016-10-25 10:43:59 -0200
committerJeff Moyer <jmoyer@redhat.com>2016-10-28 14:26:05 -0400
commit451979cbf799bc321dc5c2040ba4142b67998d7d (patch)
tree684f8751fec02f4e0069a55150e485f8a802cabe
parent98127d2b408879ae71349dbb1e0a59cb7c2cce06 (diff)
downloadlibaio-451979cbf799bc321dc5c2040ba4142b67998d7d.tar.gz
libaio: harness: fix build error due to linker search order
Move '-lpthread' after 'main.c' in the compiler command line, so that the linker can search unresolved symbols from the test in the library. cases/18.t:98: undefined reference to `pthread_create' cases/18.t:103: undefined reference to `pthread_join' collect2: error: ld returned 1 exit status Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
-rw-r--r--harness/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/harness/Makefile b/harness/Makefile
index 01ccfd3..f477737 100644
--- a/harness/Makefile
+++ b/harness/Makefile
@@ -6,13 +6,13 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS)
HARNESS_SRCS:=main.c
# io_queue.c
-CFLAGS+=-Wall -Werror -I../src -g -O2 -lpthread -DPAGE_SIZE=$(shell getconf PAGESIZE)
+CFLAGS+=-Wall -Werror -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE)
#-lpthread -lrt
all: $(PROGS)
$(PROGS): %.p: %.t $(HARNESS_SRCS)
- $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c ../src/libaio.a
+ $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c ../src/libaio.a -lpthread
clean:
rm -f $(PROGS) *.o runtests.out rofile wofile rwfile