From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29005 invoked by alias); 22 Mar 2007 22:01:37 -0000 Received: (qmail 28989 invoked by uid 22791); 22 Mar 2007 22:01:36 -0000 X-Spam-Check-By: sourceware.org Received: from e31.co.us.ibm.com (HELO e31.co.us.ibm.com) (32.97.110.149) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 Mar 2007 22:01:28 +0000 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e31.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2MM1MlA022451 for ; Thu, 22 Mar 2007 18:01:22 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2MM1LhT054648 for ; Thu, 22 Mar 2007 16:01:21 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2MM1LxN006195 for ; Thu, 22 Mar 2007 16:01:21 -0600 Received: from [9.10.86.122] (spokane1.rchland.ibm.com [9.10.86.122]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2MM1KNo006098; Thu, 22 Mar 2007 16:01:21 -0600 Message-ID: <4603005D.1010104@us.ibm.com> Date: Thu, 22 Mar 2007 22:01:00 -0000 From: Steven Munroe User-Agent: Mozilla/5.0 (X11; U; Linux ppc64; en-US; rv:1.8.0.9) Gecko/20060906 SUSE/1.8_seamonkey_1.0.7-1.1 SeaMonkey/1.0.7 MIME-Version: 1.0 To: Jakub Jelinek CC: Ulrich Drepper , Roland McGrath , Richard Henderson , libc-hacker@sourceware.org Subject: Re: [PATCH] Fix up ppc __cache_line_size References: <20070313201706.8D8351801C5@magilla.sf.frob.com> <45F71009.8020705@us.ibm.com> <20070320123958.GW1826@sunsite.mff.cuni.cz> In-Reply-To: <20070320123958.GW1826@sunsite.mff.cuni.cz> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-03/txt/msg00035.txt.bz2 Jakub Jelinek wrote: > On Tue, Mar 13, 2007 at 03:56:41PM -0500, Steven Munroe wrote: > >> Roland McGrath wrote: >> >>>> +#ifdef DL_PLATFORM_AUXV >>>> + DL_PLATFORM_AUXV >>>> +#endif >>>> >>>> >>> This looks ok to me, but make it # ifdef there inside another #ifdef. >>> >>> This will also affect powerpc, which AFAICT was also failing to set its >>> __cache_line_size in static programs. It looks to me like that will be fine. >>> >>> >>> >> hmmm looks like powerpc needs a >> sysdeps/unix/sysv/linux/powerpc/dl-support.c to define DL_PLATFORM_AUXV >> and include /elf/dl-support.c ? >> > > IMHO there is no reason to use weak_extern for __cache_line_size. > Code to check the weak references and only conditionally set it is > certainly bigger than just defining the hidden variables in libc-start.c > and dl-sysdep.c. > Additionally, if you build power4+ optimized ld.so, __cache_line_size > isn't defined at all and thus dl-machine.c will never use it. > Yup, on power4/5/6 processors we know the cache_line_size is 128 and for 970 the L:inux kernel always sets 128 byte cache lines. So we took the dynamic cache line size code out of the CPU tuned version. Unfortunately this also remove the definition of __cache_line_size for the CPU tuned stuff which we still need for dl-machine. So moving the definition of __cache_line_size to dl-sysdep.c is the correct answer. > The following patch works for me (though only tested with > binutils and gcc that support HAVE_ASM_PPC_REL16 (so __cache_line_size > references don't need runtime relocation). Not sure if we still support > older binutils. > HAVE_ASM_PPC_REL16 is required for -msecure-plt and this binutils is a prereq for -mlong-double-128 (GCC-4.1). So I suspect building with older binutils is not really an option any more. So this patch is Ok with me.