[Pkg-db-devel] Bug#260831: db3: FTBFS on amd64: Please remove '-lstdc++' from debian/rules

Andreas Jochens Andreas Jochens <aj@andaco.de>, 260831@bugs.debian.org
Thu, 22 Jul 2004 15:08:21 +0200


Package: db3
Severity: normal
Tags: patch

When building 'db3' with gcc-3.4 on amd64 I get the following error:

mv -f .libs/cxx_table.lo cxx_table.lo
/bin/sh ./libtool --mode=compile x86_64-linux-g++ -c -I. -I../dist/../include -D_REENTRANT  -fexceptions -D_GNU_SOURCE ../dist/../cxx/cxx_txn.cpp
rm -f .libs/cxx_txn.lo
x86_64-linux-g++ -c -I. -I../dist/../include -D_REENTRANT -fexceptions -D_GNU_SOURCE ../dist/../cxx/cxx_txn.cpp  -fPIC -DPIC -o .libs/cxx_txn.lo
In file included from /usr/include/c++/3.4/backward/iostream.h:31,
                 from ../dist/../include/db_cxx.h:52,
                 from ../dist/../cxx/cxx_txn.cpp:16:
/usr/include/c++/3.4/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
x86_64-linux-g++ -c -I. -I../dist/../include -D_REENTRANT -fexceptions -D_GNU_SOURCE ../dist/../cxx/cxx_txn.cpp -o cxx_txn.o >/dev/null 2>&1
mv -f .libs/cxx_txn.lo cxx_txn.lo
/bin/sh ./libtool --mode=link x86_64-linux-g++ -version-info 3:2 -rpath /usr/lib -o libdb3_cxx.la \
    cxx_app.lo cxx_except.lo cxx_lock.lo cxx_log.lo cxx_mpool.lo cxx_table.lo cxx_txn.lo  -lstdc++ -L.libs/ -ldb3
rm -fr .libs/libdb3_cxx.la .libs/libdb3_cxx.* .libs/libdb3_cxx.*
gcc -shared -Wl,-Bsymbolic -Wl,--version-script=Versions  cxx_app.lo cxx_except.lo cxx_lock.lo cxx_log.lo cxx_mpool.lo cxx_table.lo cxx_txn.lo  -lstdc++ -L.libs/ -ldb3 -lc  -Wl,-soname -Wl,libdb3_cxx.so.3 -o .libs/libdb3_cxx.so.3.0.2
/usr/bin/ld: /usr/lib/gcc/x86_64-linux/3.4.1/libstdc++.a(ios_init.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux/3.4.1/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libdb3_cxx.la] Error 1
make[1]: Leaving directory `/db3-3.2.9/build-tree/db-3.2.9/build_unix'
make: *** [stampdir/build-stamp] Error 2

With the attached patch 'db3' can be compiled using gcc-3.4 on amd64.

The patch removes an occurrence of '-lstdc++' from debian/rules which
causes libstdc++ to be linked in statically. This does not work on amd64 
because libstdc++.a is not compiled with -fPIC and is thus not allowed
to be used to create a shared library. 

The '-lstdc++' should not be necessary at all. It seems that it was 
introduced to fix an old libtool bug which must have been fixed long ago.

Regards
Andreas Jochens

diff -urN ../tmp-orig/db3-3.2.9/debian/rules ./debian/rules
--- ../tmp-orig/db3-3.2.9/debian/rules	2004-07-22 14:36:39.198719302 +0200
+++ ./debian/rules	2004-07-22 14:32:50.782816207 +0200
@@ -34,7 +34,7 @@
 
 $(STAMP_DIR)/pre-build-stamp: $(unpacked) $(patched) $(BUILD_TREE)/dist/configure
 	dh_testdir
-	cd $(BUILD_TREE)/build_unix && CFLAGS="$(CFLAGS)" CC="$(CC)" JAVAC="gcj -C" LIBXSO_LIBS="-lstdc++" \
+	cd $(BUILD_TREE)/build_unix && CFLAGS="$(CFLAGS)" CC="$(CC)" JAVAC="gcj -C" \
 		../dist/configure $(configure_args) --host=$(DEB_BUILD_GNU_TYPE)
 	touch $(STAMP_DIR)/pre-build-stamp