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


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: Potential issue with strstr on x86 with sse4.2 in glibc-2.18


On Tue, Aug 20, 2013 at 05:47:57PM +1000, Allan McRae wrote:
> On 20/08/13 17:11, Andreas Schwab wrote:
> > Rich Felker <dalias@aerifal.cx> writes:
> > 
> >> What may be viable is globally using -mpreferred-stack-boundary=2
> > 
> > Please take a look at sysdeps/i386/Makefile.
> > 
> 
> So is a viable solution to add:
> 
> sysdep-CFLAGS += -mpreferred-stack-boundary=4
> 
> to in the string directory section of sysdeps/i386/i686/multiarch/Makefile?

No, -mpreferred-stack-boundary=4 is really a near-nop. All it does is
cause GCC to generate code that _preserves_ the value of esp%16 across
calls. So if esp%16 was 0 when your function was called, it will be 0
at calls you make. But if esp%16 was 4 when your function was called,
it will be 4 at calls you make. In order to get gcc to re-align, you
need to also use -mincoming-stack-boundary=2.

Rich


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