[PATCH] memusagestat: use local glibc when linking [BZ #18465]

Mike Frysinger vapier@gentoo.org
Sun May 31 22:01:00 GMT 2015


On 31 May 2015 11:40, Andreas Schwab wrote:
> Mike Frysinger <vapier@gentoo.org> writes:
> > On 30 May 2015 22:20, Andreas Schwab wrote:
> >> Mike Frysinger <vapier@gentoo.org> writes:
> >> > The memusagestat is the only binary that has its own link line which
> >> > causes it to be linked against the existing installed C library.  It
> >> > has been this way since it was originally committed in 1999, but I
> >> > don't see any reason as to why.
> >> 
> >> Probably because $(objpfx)memusagestat.o is compiled specially.
> >
> > how so ?
> 
> # The configure.ac check for libgd and its headers did not use $SYSINCLUDES.
> # The directory specified by --with-headers usually contains only the basic
> # kernel interface headers, not something like libgd.  So the simplest thing
> # is to presume that the standard system headers will be ok for this file.
> $(objpfx)memusagestat.o: sysincludes = # nothing

i'm not sure how that is relevant to the linking phase.  if anything, the 
snippets i posted suggest we should be linking against the local glibc and
linking against the installed C is broken.  after all, it's using headers
from the local glibc, not the system.  there's no guarantee that the two
are compatible.  it seemingly works because people rarely run a host C lib
that isn't glibc while compiling glibc.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150531/f1ce4784/attachment.sig>


More information about the Libc-alpha mailing list