[bug-gnutls] gnutls-2.8.6 build comments

Simon Josefsson simon at josefsson.org
Sun May 2 22:20:35 CEST 2010


"Nelson H. F. Beebe" <beebe at math.utah.edu> writes:

> A build attempt for gnutls-2.8.6 fails on Red Hat 4 AMD64 for two
> reasons: incorrect handling of libraries at configure time, and a C++
> error in the doc/examples/ex-cxx.cpp file.
>
> The library problem arises because the gnutls configure script erroneously
> inserts explicit paths to shared libraries, instead of relying on the normal
> shared library search mechanism, and the setting of LDFLAGS.
>
> On both Red Hat and OpenSuSE GNU/Linux on AMD64, the default world is a 64-bit
> one, and 64-bit libraries go into /usr/lib64 and /usr/local/lib64.  The /usr/lib
> and /usr/local/lib directories are reserved for 32-bit libraries.  Unfortunately,
> the configure puts /usr/local/lib in front of shared library names.

Can you post a config.log when that happens?  I'd like to understand
what part of configure.ac is responsible.

> I was able to resolve that problem by temporarily renaming several shared
> and static libraries in /usr/local/lib, but that was possible only because
> the system on which I did that is a single-user machine over which I have
> complete control; it would not be possible on most of our GNU/Linux systems
> that are accessible to thousands of our users.

Of course, that's never a good solution.

> Recommendation: do not insert explicit directory paths for libraries,
> but instead, use the LDFLAGS settings to guide the loader to their
> proper location.

You mean -R or -Wl,-rpath or similar?  That is what should be happening,
I think.

> With the above changes, I was able to get most of the compilations to succeed,
> but I'm stymied by a C++ compilation error in doc/examples/ex-cxx.cpp.  I have
> dozens of versions of the gcc family installed in my environment, and I tried
> g++ (4.3.0 20070209), g++-4.3.4, g++-4.4.1, g++-4.5.0, and g++-4.6.0, each
> time doing the build in a clean freshly-unpacked gnutls-2.8.6 directory.
>
> Here is an example of the failures that I see:
>
> libtool: link: g++-4.6 -g -O2 -Wl,-rpath -Wl,/usr/local/lib64 -o
> 	ex-cxx ex-cxx.o -L/usr/local/lib64 ./.libs/libexamples.a
> 	../../lib/.libs/libgnutls.so
> 	../../libextra/.libs/libgnutls-extra.so
> 	../../gl/.libs/libgnu.a ../../lib/.libs/libgnutlsxx.so
> 	-Wl,-rpath -Wl,/local/build/bare/gnutls-2.8.6/lib/.libs
> 	-Wl,-rpath -Wl,/local/build/bare/gnutls-2.8.6/libextra/.libs
> 	-Wl,-rpath -Wl,/usr/local/lib
>
> ex-cxx.o(.text+0xa9): In function `main':
>
> /usr/local/ashare/x86_64-linux/gcc-4.6-20100416/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/ostream:513:
> 	undefined reference to `std::basic_ostream<char,
> 	std::char_traits<char> >& std::__ostream_insert<char,
> 	std::char_traits<char> >(std::basic_ostream<char,
> 	std::char_traits<char> >&, char const*, long)'
>
> ex-cxx.o(.text+0x135):/usr/local/ashare/x86_64-linux/gcc-4.6-20100416/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/ostream:513:
> 	undefined reference to `std::basic_ostream<char,
> 	std::char_traits<char> >& std::__ostream_insert<char,
> 	std::char_traits<char> >(std::basic_ostream<char,
> 	std::char_traits<char> >&, char const*, long)'
>
> ex-cxx.o(.text+0x157):/usr/local/ashare/x86_64-linux/gcc-4.6-20100416/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/ostream:513:
> 	undefined reference to `std::basic_ostream<char,
> 	std::char_traits<char> >& std::__ostream_insert<char,
> 	std::char_traits<char> >(std::basic_ostream<char,
> 	std::char_traits<char> >&, char const*, long)'
>
> ex-cxx.o(.text+0x25c): In function `main':
>
> /usr/local/ashare/x86_64-linux/gcc-4.6-20100416/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/locale_facets.h:868:
> 	undefined reference to `std::ctype<char>::_M_widen_init()
> 	const'
>
> ex-cxx.o(.text+0x2bc): In function `main':
>
> /usr/local/ashare/x86_64-linux/gcc-4.6-20100416/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/basic_string.h:232:
> 	undefined reference to `std::basic_string<char,
> 	std::char_traits<char>, std::allocator<char>
> 	>::_Rep::_S_empty_rep_storage'
>
> ex-cxx.o(.text+0x324):/usr/local/ashare/x86_64-linux/gcc-4.6-20100416/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/basic_string.h:232:
> 	undefined reference to `std::basic_string<char,
> 	std::char_traits<char>, std::allocator<char>
> 	>::_Rep::_S_empty_rep_storage'
>
> ex-cxx.o(.text+0x344): In function `main':
>
> /usr/local/ashare/x86_64-linux/gcc-4.6-20100416/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/locale_facets.h:868:
> 	undefined reference to `std::ctype<char>::_M_widen_init()
> 	const'
>
> ex-cxx.o(.text+0x364):/usr/local/ashare/x86_64-linux/gcc-4.6-20100416/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/locale_facets.h:868:
> 	undefined reference to `std::ctype<char>::_M_widen_init()
> 	const'
>
> ex-cxx.o(.text+0x3c9): In function `main':
>
> /usr/local/ashare/x86_64-linux/gcc-4.6-20100416/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/basic_string.h:232:
> 	undefined reference to `std::basic_string<char,
> 	std::char_traits<char>, std::allocator<char>
> 	>::_Rep::_S_empty_rep_storage'

I don't recognize this and I don't have any suggestions on what to test.
Are there any C++ experts out there who can answer this one?

/Simon





More information about the Gnutls-devel mailing list