Bug 216211 - Mudflap doesn't work
Summary: Mudflap doesn't work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 6
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-17 20:18 UTC by Nigel Horne
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-17 20:32:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Nigel Horne 2006-11-17 20:18:17 UTC
Description of problem:
[njh@philips tmp]$ cc -fmudflap f.c
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `__wrap_main'
/tmp/ccMZcidj.o: In function `main':
f.c:(.text+0x19): undefined reference to `__mfwrap_printf'
/tmp/ccMZcidj.o: In function `global constructors keyed to 0_main':
f.c:(.text+0x2d): undefined reference to `__mf_init'
f.c:(.text+0x51): undefined reference to `__mf_register'
collect2: ld returned 1 exit status
[njh@philips tmp]$ cat f.c
#include <stdio.h>

main()
{
        printf("hello, world\n");
}
[njh@philips tmp]$ 


Version-Release number of selected component (if applicable):

libmudflap-4.1.1-30
How reproducible:
everytime

Steps to Reproduce:
1. create hello world program
2. cc -fmudflap program
3.
  
Actual results:
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `__wrap_main'
/tmp/ccMZcidj.o: In function `main':
f.c:(.text+0x19): undefined reference to `__mfwrap_printf'
/tmp/ccMZcidj.o: In function `global constructors keyed to 0_main':
f.c:(.text+0x2d): undefined reference to `__mf_init'
f.c:(.text+0x51): undefined reference to `__mf_register'
collect2: ld returned 1 exit status


Expected results:
Should link

Additional info:

Comment 1 Jakub Jelinek 2006-11-17 20:32:44 UTC
It works just fine, but you forgot to link with -lmudflap or -lmudflapth.
See
http://gcc.gnu.org/wiki/Mudflap%20Pointer%20Debugging
for details.


Note You need to log in before you can comment on or make changes to this bug.