uclibc: fix two more regressions introduced in 1.0.18
[buildroot-gz.git] / package / dmalloc / 0001-add-fpic.patch
blob230a9e15f1372785845f1bb19bf5a5fab3c3b38f
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
7 This patch, taken from
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>
14 ---
15 Makefile.in | 10 +++++-----
16 1 file changed, 5 insertions(+), 5 deletions(-)
18 --- a/Makefile.in
19 +++ b/Makefile.in
20 @@ -318,17 +318,17 @@
21 # special _th versions of objects with the LOCK_THREADS variable defined to 1
22 chunk_th.o : $(srcdir)/chunk.c
23 rm -f $@
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
29 rm -f $@
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
35 rm -f $@
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)
41 @@ -360,7 +360,7 @@
43 .c.o :
44 rm -f $@
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.
50 @@ -368,7 +368,7 @@
52 dmallocc.o : $(srcdir)/dmallocc.cc
53 rm -f $@
54 - $(CXX) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
55 + $(CXX) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
56 -o ./$@