From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10971 invoked by alias); 19 Dec 2007 21:08:14 -0000 Received: (qmail 10955 invoked by uid 22791); 19 Dec 2007 21:08:13 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Dec 2007 21:08:07 +0000 Received: from Relay2.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 3C6462DF55; Wed, 19 Dec 2007 22:08:04 +0100 (CET) From: Andreas Schwab To: "H.J. Lu" Cc: GDB Subject: Re: gdb 6.7.50.20071219-cvs doesn't build on Linux/ia64 References: <20071219174232.GA1094@lucon.org> <20071219175049.GA1132@lucon.org> <20071219184137.GB9968@caradoc.them.org> X-Yow: Yow! Are you the self-frying president? Date: Wed, 19 Dec 2007 21:08:00 -0000 In-Reply-To: <20071219184137.GB9968@caradoc.them.org> (Daniel Jacobowitz's message of "Wed\, 19 Dec 2007 13\:41\:37 -0500") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00155.txt.bz2 Daniel Jacobowitz writes: > On Wed, Dec 19, 2007 at 09:50:49AM -0800, H.J. Lu wrote: >> This regression was introduced by >> >> 2007-11-01 Daniel Jacobowitz >> >> * linux-low.c (linux_tracefork_grandchild): New. >> (linux_tracefork_child): Use clone. >> (linux_test_for_tracefork): Use clone; allocate and free a >> stack. >> >> Daniel, can you look into it? > > It is an otherwise trivial use of clone. Could someone with access > to an ia64-linux system try adding a clone2 case? This seems to work: 2007-12-19 Andreas Schwab * linux-low.c (STACK_SIZE): Define. (linux_tracefork_child): Use it. Use __clone2 on ia64. (linux_test_for_tracefork): Likewise. --- linux-low.c 19 Dez 2007 21:34:04 +0100 1.68 +++ linux-low.c 19 Dez 2007 22:05:14 +0100 @@ -1743,12 +1743,20 @@ linux_tracefork_grandchild (void *arg) _exit (0); } +#define STACK_SIZE 4096 + static int linux_tracefork_child (void *arg) { ptrace (PTRACE_TRACEME, 0, 0, 0); kill (getpid (), SIGSTOP); - clone (linux_tracefork_grandchild, arg, CLONE_VM | SIGCHLD, NULL); +#ifdef __ia64__ + __clone2 (linux_tracefork_grandchild, arg, STACK_SIZE, + CLONE_VM | SIGCHLD, NULL); +#else + clone (linux_tracefork_grandchild, (char *) arg + STACK_SIZE, + CLONE_VM | SIGCHLD, NULL); +#endif _exit (0); } @@ -1776,13 +1784,18 @@ linux_test_for_tracefork (void) { int child_pid, ret, status; long second_pid; - char *stack = malloc (8192); + char *stack = malloc (STACK_SIZE * 4); linux_supports_tracefork_flag = 0; /* Use CLONE_VM instead of fork, to support uClinux (no MMU). */ - child_pid = clone (linux_tracefork_child, stack + 2048, - CLONE_VM | SIGCHLD, stack + 6144); +#ifdef __ia64__ + child_pid = __clone2 (linux_tracefork_child, stack, STACK_SIZE, + CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2); +#else + child_pid = clone (linux_tracefork_child, stack + STACK_SIZE, + CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2); +#endif if (child_pid == -1) perror_with_name ("clone"); Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."