[Top][All Lists]

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

glibc in Hurd

From: zhengda
Subject: glibc in Hurd
Date: Thu, 05 Jun 2008 01:15:41 +0200
User-agent: Thunderbird (X11/20080421)


I have some troubles with glibc.
First, I'm not sure I get the right source code of glibc for Hurd.
I download glibc from cvs -d:pserver:anoncvs@sources.redhat.com:/cvs/glibc co -r glibc-2_7-branch glibc, and patched it with the patches in http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/
but I still cannot compile it.
I got the error like:
/root/storage/glibc_build/rt/librt_pic.a(clock_settime.os): In function `clock_ settime': /root/storage/glibc-2_7-branch/rt/../sysdeps/unix/clock_settime.c:113: undefine d reference to `CPUCLOCK_WHICH' /root/storage/glibc-2_7-branch/rt/../sysdeps/unix/clock_settime.c:113: undefine d reference to `CPUCLOCK_WHICH'
Do I use the right patches?
So I just simply comment the code as follow:
     retval = hp_timing_settime (clock_id, tp);

Now I can compile the source code.
My goal is to modify the code of glibc, and to allows the user specify the pfinet server with the environment variable.
I modified _hurd_socket_server() and my code is like this:
 if (domain > max_domain || servers[domain] == MACH_PORT_NULL)
     char *sock_serv_path=NULL;
     int len;
     char *name=NULL;
     char *np=NULL;
     if(sock_serv_path == NULL){
     name=(char *)malloc(len+100);
     *--np = '\0';
     np = _itoa (domain, np, 10, 0);
     *--np = '/';

     np -= len;
     memcpy (np, sock_serv_path , len);

     printf("socket path: %s\n" , np);
     server = __file_name_lookup (np, 0, 0);
     if (domain <= max_domain)
       servers[domain] = server;

I want to try the modified glibc. I compile it again, but I don't want to install it in my system directly.
I write a very simple test program which only calls socket().
I want to compile the test program with the modified glibc.
but I don't know exactly how to do it. What I did is as follow:
#gcc -o test test.c
# ld -o test glibc_build/csu/crt0.o glibc_build/csu/init-first.o test.o -lc -Lglibc_build
but I got the error:
/lib/ld.so.1:(.data+0x590): multiple definition of `__hurd_threadvar_stack_offset@@GLIBC_2.2.6' ld: /lib/ld.so.1: indirect symbol `__hurd_threadvar_stack_offset' to `__hurd_threadvar_stack_offset@@GLIBC_2.2.6' is a loop
/lib/ld.so.1: could not read symbols: Invalid operation

I don't understand why there are multiple definition of __hurd_threadvar_stack_offset?
Do I still link to the glibc in my system?

Zheng Da

reply via email to

[Prev in Thread] Current Thread [Next in Thread]