[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Get rid of libc_g.a



Vincent Rivière wrote:
Furthermore, the profile library libc_p suffers about the same issues.

I have made further experiments.

It is quite simple. When you compile your program with -pg, gprof shows your functions. If, additionally, you link with libc_g.a, gprof shows the libc functions as well.

On Debian, gcc never automatically tries to link with libc_p.a.
That library is provided in an additional package named libc6-prof.
To use it, just explicitly add -lc_p along with -pg on the command line (more or less).
This is very simple, we should do the same.

So I propose:

1) GCC: Disable the automatic usage of libc_g.a and libc_p.a. If someone wants to debug or profile the MiNTLib, he will have to do that explicitly by specifying those libs on the command line.

2) MiNTLib: Disable the build of libc_g.a and libc_p by default, and don't include them in the binary packages. In the rare case someone wants to debug or profile the MiNTLib, he will have to build that version himself, for its favorite processor variant.

That way, things will be simpler and we will have a lot less trouble especially with -g.

I'm going to:
- patch binutils/gprof to fix its call count bug
- patch gcc to disable automatic usage of libc_g.a and libc_p.a
- provide patches for the MiNTLib to disable the build of libc_g.a and libc_p.a by default.

--
Vincent Rivière