From: Pierre-Marc Fournier Date: Mon, 14 Dec 2009 07:08:45 +0000 (-0500) Subject: Force -fPIC build of libust-initializer.o X-Git-Tag: v0.1~32 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ec96d08c68e986340f95b70ebe3aa359922abd9c;p=ust.git Force -fPIC build of libust-initializer.o This is needed for linking it to shared libraries. --- diff --git a/Makefile.am b/Makefile.am index be14587..9385116 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,5 +18,7 @@ CLEANFILES = $(ldscripts_DATA) ./tests/libust-initializer.Po libust.so: libust.ldscript.in $(SED) -e "s@\@FORMAT\@@$(LIBFORMAT)@" -e "s@\@PATH\@@${libdir}@g" < $< > $@ +# It is very important to compile the initializer with PIC otherwise we +# may get obscure errors when linking to shared libraries. libust-initializer.o: libust-initializer.c - $(CC) $(CFLAGS) -c -I$(top_srcdir)/include -o $@ $< + $(CC) $(CFLAGS) -fPIC -c -I$(top_srcdir)/include -o $@ $<