[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#530005: libphobos-4.1-dev: libgphobos cannot be linked by a shared library



Package: libphobos-4.1-dev
Version: 0.25-4.1.2-23.2
Severity: normal


Here is the relevant VERBOSE=1 output (with line wrapping and separating
invidual commands by <return>) from a make command that has been
configured with cmake to build a shared D library.

[100%] Building D object bindings/d/CMakeFiles/plplotdmdd.dir/plplot.o

cd /home/software/plplot_cvs/HEAD/build_dir/bindings/d && /usr/bin/gdc
-fversion=Posix  -fPIC -I/home/software/qtsdk-2009.02/qt/include
-I/home/software/qtsdk-2009.02/qt/include/QtSvg
-I/home/software/qtsdk-2009.02/qt/include/QtGui
-I/home/software/qtsdk-2009.02/qt/include/QtCore   -DUSINGDLL -o
CMakeFiles/plplotdmdd.dir/plplot.o -c
/home/software/plplot_cvs/HEAD/plplot_cmake_qt/bindings/d/plplot.d
Linking D shared library libplplotdmdd.so

cd /home/software/plplot_cvs/HEAD/build_dir/bindings/d &&
/home/software/cmake/install-2.6.4/bin/cmake -E cmake_link_script
CMakeFiles/plplotdmdd.dir/link.txt --verbose=1

/usr/bin/gdc  -fPIC  -fversion=Posix   -shared  -o libplplotdmdd.so
CMakeFiles/plplotdmdd.dir/plplot.o ../../src/libplplotd.so.9.6.2
/usr/lib/libltdl.so /usr/lib/libdl.so ../../lib/csa/libcsirocsa.so.0.0.1
.../../lib/nn/libcsironn.so.0.0.1 /usr/lib/libqhull.so
.../../lib/qsastime/libqsastime.so.0.0.1 /usr/lib/libm.so
/usr/lib/libfreetype.so
-Wl,-rpath,/home/software/plplot_cvs/HEAD/build_dir/src:/home/software/plplot_cvs/HEAD/build_dir/lib/csa:/home/software/plplot_cvs/HEAD/build_dir/lib/nn:/home/software/plplot_cvs/HEAD/build_dir/lib/qsastime

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.1.3/libgphobos.a(deh.o):
relocation R_X86_64_32 against
_D39TypeInfo_AS3gcc3deh18OurUnwindException6__initZ' can not be used when
making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.1.3/libgphobos.a: could not read symbols:
Bad value
collect2: ld returned 1 exit status

My working hypothesis is the solution to the problem is simply to build
libgphobos.a with the -fPIC option (so the compiled objects in that library
can be included in a shared library). In any case, I notice a number of
other libraries in /usr/lib/gcc/x86_64-linux-gnu/4.1. Most of them are
static, but I have never run into this sort of linking issue before with one
of the other gcc compiler components.  So whatever is done for those other
static libraries is probably what should be done for libgphobos.a to allow
shared linking with gdc.

If any additional tests are necessary to help you figure out this linking
issue, I would be happy to perform them.

Alan W. Irwin

-- System Information:
Debian Release: 5.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libphobos-4.1-dev depends on:
ii  gdc-4.1                0.25-4.1.2-23.2   The D compiler
ii  zlib1g-dev             1:1.2.3.3.dfsg-12 compression library - development

libphobos-4.1-dev recommends no packages.

libphobos-4.1-dev suggests no packages.

-- debconf-show failed



Reply to: