This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix up ppc __cache_line_size


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]