| Summary: | Compiling with gcc -pg produces immediately crashing executables | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Ronald F. Guilmette <rfg> |
| Component: | gnu | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 7.0-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->feedback Does this patch help? http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/include/profile.h On Wed, Aug 13, 2008 at 05:10:27PM -0700, Ronald F. Guilmette wrote: > In message <200808130143.m7D1hXIl090476@freefall.freebsd.org>, you wrote: > > >Synopsis: Compiling with gcc -pg produces immediately crashing executables > > > >State-Changed-From-To: open->feedback > >State-Changed-By: edwin > >State-Changed-When: Wed Aug 13 01:43:17 UTC 2008 > >State-Changed-Why: > >Does this patch help? > >http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/include/profile.h > > > >http://www.freebsd.org/cgi/query-pr.cgi?pr=126488 > > Probably. Do you need me to check for sure? > > Do I need to rebuild & reinstall the kernel in order to do that? I think you need a full rebuild (at least kernel) for this. Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/ State Changed From-To: feedback->closed Closed on submitters request in favour of bin/119709. |
Compiling & linking just about any program with "gcc -pg" produces either an executable that crashes instantly, just inside of main() or else an executable where the argc and argv values are hopelessly hosed (which can be almost as bad). Fix: Beats me. I haven't been working on the compiler in some time now. I'll help to sort this out, but only if you can't find anybody else who's been grunging around in the GCC code more recently than me. How-To-Repeat: Save the following trivial source file as "test.c" and then compile and execute it thusly: gcc -pg -o test test.c ./test #include <stdlib.h> int main (register int const argc, register char **const argv) { if (!argv) { abort (); return 1; } else return 0; } ...then stand back and watch as the program core dumps.