ok, I sat down and implemented what Hans Ottevanger told me to do :)
http://lev.vlakno.cz/~rdivacky/clang-gprof.patchThis patch does three things: 1) emits "call .mcount" at the begining of every function body 2) changes the driver to link in gcrt1.o instead of crt1.o 3) changes all -lfoo to -lfoo_p except when the foo ends with _s in the linker invocation I am not sure that I did the right thing, especially in (3). Anyway, the patch works for me (ie. produces a.out.gmon that seems to contain meaningful data). I would appreciate if you guys could test and review this. Letting me know if this is correct. Thank you! roman p.s. the patch is against TRUNK clang but there should not be any/much trouble applying it to contrib/llvm/tools/clang I hope
pgpYKUGB2g5Wo.pgp
Description: PGP signature
