Skip to contentSkip to conversation

__clone not defined??

Linux-ia64 Ray Bryant 2 participants 2 messages Feb 12, 2002

lore
Share & tools
lore

Ray Bryant

author
#0 lore raw

I was trying to compile the chat_c benchmark under IA64 Linux (RedHat 7.1) and I get an undefined reference to __clone. (chat_c calls __clone() directly.) Anyone have any tips on how to fix this?

Signature · 9 lines
Best Regards,
Ray
-----------------------------------------------
Ray Bryant               SGI
512-453-9679 (work)      512-507-7807 (cell)
[email protected]           [email protected]
     Computers are like air conditioners.
   They stop working when you open Windows.
-----------------------------------------------
#1 lore raw

The problem is that the __clone interface assumed that the location of the stack for a new thread could be specified with a single stack pointer. On Itanium, this is not true, since the register stack engine needs its own stack and stack pointer.

The corresponding call is __clone2().

The interface is

/* int __clone2(int (*fn) (void *arg), void *child_stack_base, */
/* size_t child_stack_size, int flags, void *arg) */

Note the extra child_stack_size argument, which allows the implementation to divide the region into the two needed stacks. Otherwise it's identical to __clone(). The source is at

http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/ia
64/clone2.S?rev=1.3&content-type=text/x-cvsweb-markup&cvsroot=glibc

There is some discussion at

http://sources.redhat.com/ml/libc-hacker/2000-06/msg00129.html

I admit a man page would be nice.

(In 99.9% of cases, user code should really call pthread_create() instead, which does the right thing.)

Hans

Quoted 26 lines

-----Original Message-----
From: Ray Bryant [mailto:[email protected]]
Sent: Tuesday, February 12, 2002 10:02 AM
To: linux-ia64
Subject: [Linux-ia64] __clone not defined??

I was trying to compile the chat_c benchmark under IA64 Linux (RedHat 7.1) and I get an undefined reference to __clone. (chat_c calls __clone() directly.) Anyone have any tips on how to fix this?

Signature · 14 lines
Best Regards,
Ray
-----------------------------------------------
Ray Bryant               SGI
512-453-9679 (work)      512-507-7807 (cell)
[email protected]           [email protected]
     Computers are like air conditioners.
   They stop working when you open Windows.
-----------------------------------------------

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64