• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/dmalloc/0001-add-fpic.patch
Alex SuykovAlex Suykov committed db7b7fe0ee107 Jan 2015
Raw file
Source viewDiff to previous
 
1
Without -fPIC, dmalloc does not build with:
2
​
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
6
​
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.
12
​
13
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
14
---
15
 Makefile.in |   10 +++++-----
16
 1 file changed, 5 insertions(+), 5 deletions(-)
17
​
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 ./$@
27
 
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 ./$@
33
 
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 ./$@
39
 
40
 tests : $(TEST) $(TEST_FC)
41
@@ -360,7 +360,7 @@
42
 
43
 .c.o :
44
    rm -f $@
45
-   $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
46
+   $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
47
 
48
 #
49
 # .cc.o auto-target doesn't work on some systems. 
50
@@ -368,7 +368,7 @@
51
 #
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 ./$@
57
 
58
 #
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.