From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14110 invoked by alias); 3 Jan 2013 07:19:28 -0000 Received: (qmail 14102 invoked by uid 22791); 3 Jan 2013 07:19:27 -0000 X-SWARE-Spam-Status: No, hits=1.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,TW_CX,TW_DC,TW_GC,TW_GX X-Spam-Check-By: sourceware.org Received: from proxy-01.wenglor.de (HELO mail-01.wenglor.de) (80.149.179.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Jan 2013 07:19:23 +0000 Received: from lnx-notes01.wenglor.com (unknown [172.16.0.9]) by mail-01.wenglor.de (Postfix) with ESMTP id 1A24E19205E for ; Thu, 3 Jan 2013 08:19:37 +0100 (CET) To: gcc-help@gcc.gnu.org MIME-Version: 1.0 Subject: compiling with mudflap changes linking behaviour X-KeepSent: 6B92256A:48385BBD-C1257AE8:00285AE3; type=4; name=$KeepSent Message-ID: From: "Franz Reinhardt" Date: Thu, 03 Jan 2013 07:19:00 -0000 Content-Type: text/plain; charset="US-ASCII" Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00005.txt.bz2 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::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::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