This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
compiling with mudflap changes linking behaviour
- From: "Franz Reinhardt" <franz dot reinhardt at wenglor dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 3 Jan 2013 08:21:28 +0100
- Subject: compiling with mudflap changes linking behaviour
Hi,
for a project which consists of a dynamic library and an exectuable I need
to use
mudflap. Since this is delivered software, building is working out of the
box without mudflap.
Now I'd like to use mudflap:
I added -fmudflapth to the compiler and linker options, and -lmudflapth to
the linker options.
The build of the dynamic library works. the build of the executable fails
with some linker
error "undefined reference to typeinfo "
When I compare the library symbols from both configuration (with or
without mudflap)
I discover that with mudflap more symbols show up as undefined, when I
examine the dynamic library with nm, especially from classes where no
instances
are requested in libraries translation unit.
Unfortunately, the mudflap doc doesn't mention such a side effect.
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i586-suse-linux/4.7/lto-wrapper
Target: i586-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.7
--enable-ssp --disable-libssp --disable-libitm --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --with-slibdir=/lib --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new
--disable-libstdcxx-pch --enable-version-specific-runtime-libs
--enable-linker-build-id --program-suffix=-4.7 --enable-linux-futex
--without-system-libunwind --with-arch-32=i586 --with-tune=generic
--build=i586-suse-linux
Thread model: posix
gcc version 4.7.1 20120723 [gcc-4_7-branch revision 189773] (SUSE Linux)
error message (incomplete)
../bin/libsdk.so: undefined reference to `typeinfo name for
boost::re_detail::abstract_protected_call'
../bin/libsdk.so: undefined reference to `vtable for
boost::exception_detail::error_info_container'
../bin/libsdk.so: undefined reference to `mpl_::integral_c<unsigned int,
4u>::value'
../bin/libsdk.so: undefined reference to `mpl_::int_<7>::value'
../bin/libsdk.so: undefined reference to `typeinfo for
boost::io::out_of_range'
../bin/libsdk.so: undefined reference to `mpl_::int_<5>::value'
../bin/libsdk.so: undefined reference to
`boost::re_detail::cpp_regex_traits_implementation<char>::mask_unicode'
The C++ libraries, which I'm linking to(qt and boost), are compiled with
gcc 4.1.x. I know that this may lead to trouble,
but I don't believe that it should do a change in the visibility of
symbols.
So if anyone can give hints, I would really appreciate it.
Franz