kumquat-buildroot/package/dmalloc/0003-fix-shlibs.patch
Fabrice Fontaine 19ec872f16 package/dmalloc: needs -fPIC
Drop first patch and pass -fPIC to configure to fix the following build
failure on ARC:

ERROR: architecture for "/usr/lib/libdmalloc.so" is "ARCompact", should be "ARCv2"
ERROR: architecture for "/usr/lib/libdmallocth.so" is "ARCompact", should be "ARCv2"
ERROR: architecture for "/usr/lib/libdmallocthcxx.so" is "ARCompact", should be "ARCv2"
ERROR: architecture for "/usr/lib/libdmallocxx.so" is "ARCompact", should be "ARCv2"

This build failure is due to the following configure error:

checking shared library link args... ./configure: line 4467: 10229 Segmentation fault      ( ${LD-ld} -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a ) 2>&5
/home/buildroot/autobuild/run/instance-0/output-1/host/bin/arc-buildroot-linux-gnu-ld -G -o $@.t

This configure error is due to missing -fPIC:

configure:4392: checking shared library link args
configure:4398: /home/buildroot/autobuild/run/instance-0/output-1/host/bin/arc-buildroot-linux-gnu-gcc -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g2  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.c >&5
configure:4404: $? = 0
configure:4408: test -z
			 || test ! -s conftest.err
configure:4411: $? = 0
configure:4414: test -s conftest.o
configure:4417: $? = 0
/home/buildroot/autobuild/run/instance-0/output-1/host/bin/arc-buildroot-linux-gnu-ld: conftest.a(conftest.o): relocation R_ARC_32_ME against `__stack_chk_guard' can not be used when making a shared object; recompile with -fPIC
/home/buildroot/autobuild/run/instance-0/output-1/host/bin/arc-buildroot-linux-gnu-ld: BFD (GNU Binutils) 2.33.50.20191002 assertion fail elf32-arc.c:1805
/home/buildroot/autobuild/run/instance-0/output-1/host/bin/arc-buildroot-linux-gnu-ld: unrecognized option '-all'
/home/buildroot/autobuild/run/instance-0/output-1/host/bin/arc-buildroot-linux-gnu-ld: use the --help option for usage information
configure:4475: result: /home/buildroot/autobuild/run/instance-0/output-1/host/bin/arc-buildroot-linux-gnu-ld -G -o $@.t

Fixes:
 - http://autobuild.buildroot.org/results/65677d889c27649e1f3ca1f3b6c70df7c89779f6

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-05-01 15:04:30 +02:00

47 lines
1.3 KiB
Diff

Fix shared library rules
dmalloc uses ld -shared --whole-archive -o lib.so lib.a,
but for some reason lists regular objects in addition
to the archive, ending up with two copies of each symbol.
Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
--- a/Makefile.in
+++ b/Makefile.in
@@ -257,7 +257,7 @@ shlib : $(BUILD_SL)
# via: http://256.com/gray/email.html
$(LIB_SL) : $(LIBRARY)
rm -f $@ $@.t
- @shlinkargs@ $(LIBRARY) $(OBJS) $(NORMAL_OBJS)
+ @shlinkargs@ $(LIBRARY)
mv $@.t $@
$(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
@@ -270,7 +270,7 @@ $(LIB_TH) : $(OBJS) $(THREAD_OBJS)
$(LIB_TH_SL) : $(LIB_TH)
rm -f $@ $@.t
- @shlinkargs@ $(LIB_TH) $(OBJS) $(THREAD_OBJS)
+ @shlinkargs@ $(LIB_TH)
mv $@.t $@
$(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
@@ -279,7 +279,7 @@ $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
$(LIB_CXX_SL) : $(LIB_CXX)
rm -f $@ $@.t
- @shlinkargs@ $(LIB_CXX) $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
+ @shlinkargs@ $(LIB_CXX)
mv $@.t $@
$(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
@@ -288,7 +288,7 @@ $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
$(LIB_TH_CXX_SL) : $(LIB_TH_CXX)
rm -f $@ $@.t
- @shlinkargs@ $(LIB_TH_CXX) $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
+ @shlinkargs@ $(LIB_TH_CXX)
mv $@.t $@
threadssl : $(LIB_TH_SL)