This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
static link on MIPS
- From: Atsushi Nemoto <anemo at mba dot ocn dot ne dot jp>
- To: libc-ports at sourceware dot org
- Cc: drow at false dot org, macro at linux-mips dot org
- Date: Wed, 24 Dec 2008 02:28:10 +0900 (JST)
- Subject: static link on MIPS
As glibc bugzilla #1048 show, static linking on MIPS is somewhat
broken for years. For example,
$ cat foo.c
#include <netdb.h>
int main(int argc, char **argv)
{
gethostbyname("localhost");
return 0;
}
$ gcc -o foo foo.c -static
/tmp/ccSCPyxW.o: In function `main':
foo.c:(.text+0x2c): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
$ ./foo
foo: ../sysdeps/unix/sysv/linux/ia64/getpagesize.c:35: __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0' failed.
Floating point exception
(Note that mips getpagesize.c includes ia64/getpagesize.c)
Up to glibc 2.8, glibc-2.3.90-20050704-mips-dl-static.patch by Maciej
could be used to fix the problem. But with glibc 2.9, it causes
segfaults.
Did someone already fixed this for recent glibc?
If no, I want to forward-port the patch. Can anybody suggests where
to fix? I suppose the patch was broken since this commit
(http://sourceware.org/ml/libc-ports/2008-10/msg00000.html), but not
sure yet.
On Wed, 1 Oct 2008 09:30:40 -0400, Daniel Jacobowitz <drow@false.org> wrote:
> I have checked in this patch, which adds support for the new PLT
> format recently added to binutils and gcc.
>
> This patch also fixes a bug in dlsym on MIPS, even with current GCC
> and binutils; dlsym would sometimes return lazy binding stubs. That's
> what the copy of dl-lookup.c and the trick in do-lookup.h are for.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>
> 2008-10-01 Mark Shinwell <shinwell@codesourcery.com>
> Daniel Jacobowitz <dan@codesourcery.com>
> Richard Sandiford <rdsandiford@googlemail.com>
Any suggestions are welcome. Thanks.
---
Atsushi Nemoto