This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Potential breakage of static build.


On 24 Jan 2000, Ulrich Drepper wrote:

> Date: 24 Jan 2000 20:22:55 -0800
> From: Ulrich Drepper <drepper@cygnus.com>
> To: Kaz Kylheku <kaz@ashi.footprints.net>
> Cc: libc-alpha@sourceware.cygnus.com
> Subject: Re: Potential breakage of static build.
> 
> Kaz Kylheku <kaz@ashi.footprints.net> writes:
> 
> > It was a complete, self-contained rebuild from the glibc-2-1-branch sources
> > that I checked out some time ago. I must have done something wrong.
> 
> I meant where were the object files of the application generated.
> They might introduce problems.

Basically I cobbed together a test environment; whereby I told the compiler
(gcc 2.91) to not use any standard includes or libraries, and set up its entire
command line myself, pointing to all the include paths in the libc build tree,
feeding it all the right crt modules, etc.

The undefined reference came from within libc.a itself, which I confirmed
by looking at it with nm. 

The source of the problem is quite obvious.  The source file oldstdfiles.c, and
a couple others, make blatant references to _IO_old_file_jumps.

The definition of _IO_old_file_jumps is in oldfileops.c,  which is an
empty translation unit unless PIC is defined, and DO_VERSIONING expands
to a non-zero constant.

The other old*.c modules are not wrapped this way; yet they make references to
_IO_old_file_jumps, via the extern declaration pulled in from libioP.h.
This is more or less obvious upon inspection: take a look.

What puzzles me is why others don't seem to have a problem with static linking.
Maybe your static libc.a was compiled with PIC defined. The difference could be
due to my aforementioned use of --enable-shared=no .  I imagine that this
configuration variant is not widely tested, since most people want shared libs,
and wouldn't think of doing --enable-shared=no.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]