Hi,
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:[EMAIL PROTECTED]:/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:
if (CPUCLOCK_WHICH (clock_id) == CLOCK_PROCESS_CPUTIME_ID
|| CPUCLOCK_WHICH (clock_id) == CLOCK_THREAD_CPUTIME_ID)
retval = hp_timing_settime (clock_id, tp);
else
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;
sock_serv_path=getenv("SOCK_SERV_PATH");
if(sock_serv_path == NULL){
sock_serv_path=_SERVERS_SOCKET;
}
len=strlen(sock_serv_path);
name=(char *)malloc(len+100);
np=&name[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;
free(name);
}
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?
Best,
Zheng Da