This is the mail archive of the
mailing list for the GCC project.
Re: GCC 4.7.2: Mudflap linker errors
Here is the output of (gcc -v):
Using built-in specs.
Configured with: ../configure --prefix=/home/user/installed/gcc
--enable-languages=c,c++ --disable-multilib --disable-multiarch
--enable-checking=runtime --enable-libmudflap --enable-libgomp
--disable-bootstrap --enable-static --disable-shared
--disable-decimal-float --with-system-zlib --disable-libitm
--without-cloog --without-ppl --disable-nls --enable-threads
Thread model: posix
gcc version 4.7.2 (GCC)
Thanks & Regards,
On 22 September 2012 04:33, Frank Ch. Eigler <email@example.com> wrote:
> bd satish <firstname.lastname@example.org> writes:
>> The following piece of code, gives "undefined references" to
>> __real_malloc, __real_free, etc.:
>> Compiled with:
>> g++ -fmudflap references.cc -lmudflap
>> /lib64/libmudflap.a(mf-runtime.o): In function `__mfu_check':
>> ../libmudflap/mf-runtime.c:912: undefined reference to `__real_malloc'
> According to libmudflap/mf-impl.h, since you're using ordinary
> archives rather than shared libraries (-fPIC) these __real_FOO
> functions are expected to be provided by the linker:
> (1) The static method involves a list of -wrap=foo flags being passed to
> the linker, which then links references to "foo" to the symbol
> "__wrap_foo", and links references to "__real_foo" to the symbol "foo".
> When compiled without -DPIC, libmudflap.a contains such __wrap_foo
> functions which delegate to __real_foo functions in libc to get their
> work done.
> So, something appears wrong with this wrapping mechanism in your case.
> Can you rerun g++ with -v to see how the linker is invoked? Perhaps
> there is something missing for the C++ static-linking case.
> - FChE