SCIENTIFIC-LINUX-DEVEL Archives

February 2012

SCIENTIFIC-LINUX-DEVEL@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Steven Haigh <[log in to unmask]>
Reply To:
Steven Haigh <[log in to unmask]>
Date:
Wed, 15 Feb 2012 02:52:54 +1100
Content-Type:
multipart/signed
Parts/Attachments:
text/plain (1152 bytes) , avx-fix.patch (1999 bytes) , smime.p7s (4 kB)
On 15/02/2012 2:00 AM, Pat Riehecky wrote:
> On 02/14/2012 07:25 AM, Steven Haigh wrote:
>> On 15/02/2012 12:15 AM, Bart Swedrowski wrote:
>>> I came across this problem. Have managed to get around for now by
>>> recompiling latest glibc SRPM with patch from Debian to solve that
>>> problem[1].
>>>
>>> Bart
>>>
>>> [1]
>>> [log in to unmask]" target="_blank">http:[log in to unmask]
>>>
>>
>> Great find! I've added a link to it in the RH Bugzilla.
>
> Good catch!
>
> Has anyone opened a RHEL specific bug so that the RHEL packagers are
> made aware?

Out of interest, is there any way to see (easily) if the patch attached 
applies cleanly to the build environment used to rebuild the SL packages?

My machine for building RPMs is really hacked together for a specific 
set of RPMs - and I don't really want to upset its design task to make 
it happy enough to attempt a glibc rebuild! :)

Its taken directly from the Debian patch to fix the bug on their 
packages. I can't find anything directly relating to Fedora or EL* at 
this point.

--
Steven Haigh

Email: [log in to unmask]
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299




diff -ur eglibc-2.11.2//sysdeps/x86_64/dl-trampoline.S eglibc-2.11.2.changed//sysdeps/x86_64/dl-trampoline.S --- eglibc-2.11.2//sysdeps/x86_64/dl-trampoline.S 2009-08-26 05:17:41.000000000 +0300 +++ eglibc-2.11.2.changed//sysdeps/x86_64/dl-trampoline.S 2011-10-25 01:10:36.153062354 +0300 @@ -139,16 +139,26 @@ movl $1, %eax cpuid movq %r11,%rbx # Restore rbx - movl $1, %eax - testl $(1 << 28), %ecx + xorl %eax, %eax + // AVX and XSAVE supported? + andl $((1 << 28) | (1 << 27)), %ecx + cmpl $((1 << 28) | (1 << 27)), %ecx jne 2f - negl %eax -2: movl %eax, L(have_avx)(%rip) + xorl %ecx, %ecx + // Get XFEATURE_ENABLED_MASK + xgetbv + andl $0x6, %eax + cmpl $0x6, %eax + // Nonzero if SSE and AVX state saving is enabled. + sete %al +2: leal -1(%eax,%eax), %eax + movl %eax, L(have_avx)(%rip) cmpl $0, %eax 1: js L(no_avx) # define RESTORE_AVX +# define MORE_CODE # include "dl-trampoline.h" .align 16 @@ -176,11 +186,20 @@ movl $1, %eax cpuid movq %r11,%rbx # Restore rbx - movl $1, %eax - testl $(1 << 28), %ecx + xorl %eax, %eax + // AVX and XSAVE supported? + andl $((1 << 28) | (1 << 27)), %ecx + cmpl $((1 << 28) | (1 << 27)), %ecx jne 2f - negl %eax -2: movl %eax, L(have_avx)(%rip) + xorl %ecx, %ecx + // Get XFEATURE_ENABLED_MASK + xgetbv + andl $0x6, %eax + cmpl $0x6, %eax + // Nonzero if SSE and AVX state saving is enabled. + sete %al +2: leal -1(%eax,%eax), %eax + movl %eax, L(have_avx)(%rip) cmpl $0, %eax 1: js L(no_avx5) diff -ur eglibc-2.11.2//sysdeps/x86_64/dl-trampoline.h eglibc-2.11.2.changed//sysdeps/x86_64/dl-trampoline.h --- eglibc-2.11.2//sysdeps/x86_64/dl-trampoline.h 2009-08-09 17:33:15.000000000 +0300 +++ eglibc-2.11.2.changed//sysdeps/x86_64/dl-trampoline.h 2011-10-25 01:15:09.501060129 +0300 @@ -267,3 +267,10 @@ # (eats the reloc index and link_map) cfi_adjust_cfa_offset(-48) retq + +#ifdef MORE_CODE + cfi_adjust_cfa_offset(48) + cfi_rel_offset(%rbx, 0) + cfi_def_cfa_register(%rbx) +# undef MORE_CODE +#endif

ATOM RSS1 RSS2