28 Jul 2008 11:42
mcount.c / profile.h and fatal assembler warnings
Havard Eidnes <he <at> NetBSD.org>
2008-07-28 09:42:34 GMT
2008-07-28 09:42:34 GMT
Hi, as should be well-known by now, the compilation of mcount.c now fails on all our mips ports. The reason this has recently started happning is that assembler warnings have were recently made fatal errors, through a change to <bsd.sys.mk>. The warning emitted is: /var/tmp//ccXs67rq.s: Assembler messages: /var/tmp//ccXs67rq.s:9: Warning: No .cprestore pseudo-op used in PIC code /var/tmp//ccXs67rq.s:219: Error: 1 warnings, treating warnings as errors --- mcount.o --- This traces back to the assembly code in the MCOUNT macro in sys/arch/mips/include/profile.h, which defines the _mcount symbol and which calls the __mcount function, which is implemented in C, and which is in common/lib/libc/gmon/mcount.c. Now, if one were to just blindly follow the warnings from the assembler, one would quickly discover that once you insert ".cprestore 24" into the assembly code, it next complains there is no ".frame", and then that there is no ".ent", and lastly that there is no ".end". I have "fixed" all those things in my local source tree, but since I'm no MIPS assembly expert, I suspect that _mcount() is no longer working as it should, as it is now more or less a full- fledged function, and I think the point of the assembly code is to *not* be a full-fledged function.(Continue reading)
Probably at least something related
to the link register isn't right. However, it served it's
purpose, which was to get the build bug fixed.
> I've committed a workaround to gmon/Makefile.inc to disable
> assembler warnings for mcount.c on mips.
Thanks!
Regards,
- Håvard
RSS Feed