Bug 216211

Summary: Mudflap doesn't work
Product: [Fedora] Fedora Reporter: Nigel Horne <njh>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-11-17 20:32:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.