1 Without -fPIC, dmalloc does not build with:
3 /home/test/mips-4.4/bin/mips-linux-gnu-ld --sysroot=/home/test/outputs/test-35/staging -shared --whole-archive -soname libdmallocxx.so -o libdmallocxx.so.t libdmallocxx.a
4 /home/test/mips-4.4/bin/mips-linux-gnu-ld: libdmalloc.a(arg_check.o): relocation R_MIPS_HI16 against `_dmalloc_flags' can not be used when making a shared object; recompile with -fPIC
5 libdmalloc.a(arg_check.o): could not read symbols: Bad value
8 http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/dmalloc/files/dmalloc-5.2.4-fpic.patch?hideattic=0&view=markup,
9 fixes the problem by passing the -fPIC flag. It isn't passed through
10 the ./configure environment in order to not clutter the configuration
11 cache with incorrect values.
13 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
15 Makefile.in | 10 +++++-----
16 1 file changed, 5 insertions(+), 5 deletions(-)
21 # special _th versions of objects with the LOCK_THREADS variable defined to 1
22 chunk_th.o : $(srcdir)/chunk.c
24 - $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -DLOCK_THREADS=1 \
25 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -DLOCK_THREADS=1 \
26 -c $(srcdir)/chunk.c -o ./$@
28 error_th.o : $(srcdir)/error.c
30 - $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -DLOCK_THREADS=1 \
31 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -DLOCK_THREADS=1 \
32 -c $(srcdir)/error.c -o ./$@
34 malloc_th.o : $(srcdir)/malloc.c
36 - $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -DLOCK_THREADS=1 \
37 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -DLOCK_THREADS=1 \
38 -c $(srcdir)/malloc.c -o ./$@
40 tests : $(TEST) $(TEST_FC)
45 - $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
46 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
49 # .cc.o auto-target doesn't work on some systems.
52 dmallocc.o : $(srcdir)/dmallocc.cc
54 - $(CXX) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
55 + $(CXX) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \