Bug#265025: pwlib: FTBFS on amd64: Missing '-fPIC'

Andreas Jochens Andreas Jochens <aj@andaco.de>, 265025@bugs.debian.org
Wed, 11 Aug 2004 14:51:08 +0200


Package: pwlib
Severity: normal
Tags: patch

When building 'pwlib' on amd64 I get the following error:

g++ -shared -Wl,-soname,libpt_d.so.1.6.6 -o /pwlib-1.6.6.4/lib/libpt_d.so.1.6.6   -L/pwlib-1.6.6.4/lib    /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/asner.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/ipacl.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/modem.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/qchannel.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/delaychan.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/memfile.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/cypher.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/random.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/socks.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/httpsvc.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/snmpclnt.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/snmpserv.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/psnmp.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pasn.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/httpform.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/httpclnt.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/httpsrvr.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/http.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/html.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/ftpclnt.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/ftpsrvr.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/ftp.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/inetmail.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/inetprot.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/telnet.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pwavfile.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/dtmf.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/ptts.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pstun.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pdns.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pssl.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/shttpsvc.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pldap.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pils.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/vfakeio.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/videoio.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/vconvert.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/getdate.tab.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pxml.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pxmlrpc.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pxmlrpcs.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/psoap.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/vxml.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/uicmp.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/sound.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pluginmgr.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/sockets.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/qos.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pvidchan.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/socket.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/svcproc.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/remconn.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/config.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/udll.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/ptime.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/pipechan.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/serchan.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/sfile.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/channel.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/osutil.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/osutils.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/safecoll.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/tlib.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/switch.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/assert.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/collect.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/contain.o  /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/object.o  -lpthread -lldap -lldap_r -llber -lsasl2 -lssl -lcrypto -lexpat -lresolv -ldl
/usr/bin/ld: /pwlib-1.6.6.4/lib/obj_linux_x86_64_d/getdate.tab.o: relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC
/pwlib-1.6.6.4/lib/obj_linux_x86_64_d/getdate.tab.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [/pwlib-1.6.6.4/lib/libpt_d.so.1.6.6] Error 1

With the attached patch 'pwlib' can be compiled on amd64.

Regards
Andreas Jochens

diff -urN ../tmp-orig/pwlib-1.6.6.4/debian/patches/03_src_ptlib_unix_Makefile.dpatch ./debian/patches/03_src_ptlib_unix_Makefile.dpatch
--- ../tmp-orig/pwlib-1.6.6.4/debian/patches/03_src_ptlib_unix_Makefile.dpatch	2004-08-11 14:25:47.820466266 +0200
+++ ./debian/patches/03_src_ptlib_unix_Makefile.dpatch	2004-08-11 14:16:21.771823466 +0200
@@ -29,7 +29,7 @@
  
  $(OBJDIR)/getdate.tab.o: $(GETDATE_SOURCE)
 -	$(CC) $(CFLAGS) $(STDCCFLAGS) -c $< -o $@
-+	$(CC) $(CFLAGS) -c $< -o $@
++	$(CC) $(CFLAGS) -fPIC -c $< -o $@
  
  $(DEPDIR)/getdate.tab.dep: $(GETDATE_SOURCE)
  	$(CC) $(STDCCFLAGS) -M $< >> $@