From 314d8f65bb97709aebcf72a299ba69ef52b5501b Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 5 Dec 2006 22:05:54 -0200 Subject: [PATCH] [MAKEFILE]: Use -fPIC in CFLAGS To fix this on parisc: acme@parisc:~/pahole$ make gcc -g -O2 -Wall -I. -I/usr/include/elfutils -c -o pahole.o pahole.c gcc -g -O2 -Wall -I. -I/usr/include/elfutils -c -o classes.o classes.c gcc -shared \ -o libclasses.so.1.0.0 classes.o /usr/bin/ld: classes.o: relocation R_PARISC_DPREL21L can not be used when making a shared object; recompile with -fPIC classes.o: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [libclasses.so] Error 1 acme@parisc:~/pahole$ Signed-off-by: Arnaldo Carvalho de Melo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 677beb3..39d9329 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ INSTALL_DATA = ${INSTALL} -m 644 CC = gcc LIBS = -L. -lclasses -ldw -lelf INCLUDES = -I. -I/usr/include/elfutils -CFLAGS = -g -O2 -Wall +CFLAGS = -g -O2 -Wall -fPIC CPPFLAGS += $(INCLUDES) LDFLAGS += $(LIBS) LINKFLAGS = -shared