This is the mail archive of the libc-help@sourceware.org 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]
Other format: [Raw text]

MIPS port fails to compile with --disable-shared?


Maybe I'm doing something wrong, but I get a failure to link against a glibc (2.13, ports 2.13) that was compiled for MIPS using the --disable-shared configure option.

The error is in a subsequent configure script (for gcc) that tries to link a small test program against libc.a.

Here is the relevant error:

/home/bji/buildtools/output/install/stage1/mips-unknown-linux-gnu/usr/lib/libc.a(dl-open.o): In function `_dl_open':
dl-open.c:(.text+0xe00): undefined reference to `_dl_static_init'
dl-open.c:(.text+0xe04): undefined reference to `_dl_static_init'
collect2: ld returned 1 exit status


I did some investigation and I see that this header file names a dependency on the function _dl_static_init:

ports/sysdeps/unix/sysv/linux/mips/ldsodefs.h

It has this content:

/* We need special support to initialize DSO loaded for statically linked
extern void _dl_static_init (struct link_map *map);
#undef DL_STATIC_INIT
#define DL_STATIC_INIT(map) _dl_static_init (map)

The only place that _dl_static_init would be defined would be in:

ports/sysdeps/unix/sysv/linux/mips/dl-static.c

However, the definition of this symbol in that file is guarded by this:

#ifdef SHARED
...
#endif

It would appear that if SHARED is not defined, then a dependency on _dl_static_init is created that is not satisfied.

I don't really know the purpose of this _dl_static_init function; does it need to have a definition if SHARED is not defined? Or should, instead, the code that declares the function as an external symbol in ldsodefs.h also be guarded with #ifdef SHARED?

I am currently trying the latter as a workaround; I'll post the results to this list.

For what its worth, the ia64 port looks like it would be subject to the same problem, but I have not verified this with a build.

Thanks,
Bryan



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