Package: libaria
Version: 2.7.5.2+repack-3
Severity: normal
Tags: patch
User: [email protected]
Usertags: unresolved-symbols-so
The Ubuntu toolchain is a bit stricter (I think "ld --as-needed" is the
relevant thing) and fails to link programs against libAria.so as
follows:
g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -g -Wall -D_REENTRANT
-fno-exceptions -DFOR_ARIA -Iinclude utils/genCommandLineOptionDocs.cpp -o
utils/genCommandLineOptionDocs -Wl,-Bsymbolic-functions -Wl,-z,relro -Llib
-lAria -lpthread -ldl -lrt
lib/libAria.so: undefined reference to `pthread_mutexattr_destroy'
lib/libAria.so: undefined reference to `pthread_create'
lib/libAria.so: undefined reference to `dlopen'
lib/libAria.so: undefined reference to `pthread_mutex_trylock'
lib/libAria.so: undefined reference to `dlclose'
lib/libAria.so: undefined reference to `dlerror'
lib/libAria.so: undefined reference to `dlsym'
lib/libAria.so: undefined reference to `pthread_sigmask'
lib/libAria.so: undefined reference to `pthread_mutexattr_settype'
lib/libAria.so: undefined reference to `pthread_join'
lib/libAria.so: undefined reference to `pthread_cancel'
lib/libAria.so: undefined reference to `pthread_detach'
lib/libAria.so: undefined reference to `pthread_mutexattr_init'
collect2: error: ld returned 1 exit status
The proper thing to do here is to make sure that libAria.so is itself
adequately linked for the symbols it uses directly.
* Link libAria.so with -lpthread -ldl -lrt, rather than passing those
options only when linking the objects that are linked with libAria.
diff -Nru libaria-2.7.5.2+repack/debian/patches/linkage.patch
libaria-2.7.5.2+repack/debian/patches/linkage.patch
--- libaria-2.7.5.2+repack/debian/patches/linkage.patch 1970-01-01
01:00:00.000000000 +0100
+++ libaria-2.7.5.2+repack/debian/patches/linkage.patch 2013-10-15
15:40:41.000000000 +0100
@@ -0,0 +1,40 @@
+Index: b/Makefile
+===================================================================
+--- a/Makefile
++++ b/Makefile
+@@ -27,7 +27,7 @@
+ CXXFLAGS+=$(CPPFLAGS) $(BARECXXFLAGS) -fno-exceptions
+
+ CXXINC:=-Iinclude
+-CXXLINK:=$(LDFLAGS) -Llib -lAria -lpthread -ldl -lrt
++CXXLINK:=$(LDFLAGS) -Llib -lAria
+
+ CXXSTATICLINK:=$(LDFLAGS) -Llib -Xlinker -Bstatic -lAria -Xlinker -Bdynamic
-lpthread -ldl -lrt -Xlinker -Bstatic -lstdc++ -Xlinker -Bdynamic
+
+@@ -468,7 +468,7 @@
+ cd python; $(SWIG) -Wall -c++ -python -modern -module AriaPy -Dlinux
-DAREXPORT -o AriaPy_wrap.cpp -I../include ../include/wrapper.i
+
+ python/_AriaPy.so: obj/AriaPy_wrap.o lib/libAria.so Makefile.dep
+- $(CXX) -shared -o $(@) obj/AriaPy_wrap.o $(LDFLAGS) -Llib -lAria
-lpthread -ldl -lrt
++ $(CXX) -shared -o $(@) obj/AriaPy_wrap.o $(LDFLAGS) -Llib -lAria
+
+ obj/AriaPy_wrap.o: python/AriaPy_wrap.cpp
+ mkdir -p obj
+@@ -495,7 +495,7 @@
+ -rm -r java/Aria.jar java/com/mobilerobots/Aria
+
+ lib/libAriaJava.so: obj/AriaJava_wrap.o lib/libAria.so Makefile.dep
+- $(CXX) -shared -o $(@) obj/AriaJava_wrap.o -lpthread -ldl -lrt -Llib
-lAria
++ $(CXX) -shared -o $(@) obj/AriaJava_wrap.o -Llib -lAria
+
+ obj/AriaJava_wrap.o: java/AriaJava_wrap.cpp
+ @ if test -z "$(JAVA_INCLUDE)"; then echo "Error: JAVA_INCLUDE is not
set, compiling AriaJava_wrap.cpp will fail!"; fi
+@@ -538,7 +538,7 @@
+ ####
+
+ lib/libAria.so: $(OFILES) Makefile.dep
+- $(CXX) -shared -Wl,-soname,libAria.so.2 $(LDFLAGS) -o $(@).2.7.5.2
$(OFILES)
++ $(CXX) -shared -Wl,-soname,libAria.so.2 $(LDFLAGS) -o $(@).2.7.5.2
$(OFILES) -lpthread -ldl -lrt
+ ln -s libAria.so.2.7.5.2 lib/libAria.so.2
+ ln -s libAria.so.2 lib/libAria.so
+
diff -Nru libaria-2.7.5.2+repack/debian/patches/series
libaria-2.7.5.2+repack/debian/patches/series
--- libaria-2.7.5.2+repack/debian/patches/series 2013-06-19
10:19:18.000000000 +0100
+++ libaria-2.7.5.2+repack/debian/patches/series 2013-10-15
15:15:38.000000000 +0100
@@ -5,3 +5,4 @@
python.patch
examples.patch
test.patch
+linkage.patch
Thanks,
--
Colin Watson [[email protected]]
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]