Bug 723

Summary: clone should align stack to 16 bytes
Product: glibc Reporter: Roland McGrath <roland>
Component: libcAssignee: Roland McGrath <roland>
Status: RESOLVED FIXED    
Severity: normal CC: glibc-bugs
Priority: P2    
Version: 2.3.4   
Target Milestone: ---   
Host: i386-*-linux Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 724    

Description Roland McGrath 2005-02-16 04:16:57 UTC
This trunk change should go into 2.3 as well.

2004-12-21  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/i386/clone.S (__clone): Make sure %esp when
	calling fn is 16 byte aligned.
	* sysdeps/i386/tst-stack-align.h: New file.
nptl/
	* sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
	%esp.
	* Makefile (tests): Add tst-align2.
	* tst-align2.c: New test.
	* sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
	-mpreferred-stack-boundary=4.
linuxthreads/
	* Makefile (tests): Add tst-align.
	* tst-align.c: New test.
	* sysdeps/i386/Makefile (CFLAGS-tst-align.c): Add
	-mpreferred-stack-boundary=4.
Comment 1 Sourceware Commits 2005-02-16 08:45:59 UTC
Subject: Bug 723

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_3-branch
Changes by:	roland@sources.redhat.com	2005-02-16 08:45:40

Modified files:
	sysdeps/unix/sysv/linux/i386: clone.S 
Added files:
	sysdeps/i386   : tst-stack-align.h 

Log message:
	2004-12-21  Jakub Jelinek  <jakub@redhat.com>
	
	[BZ #723]
	* sysdeps/unix/sysv/linux/i386/clone.S (__clone): Make sure %esp when
	calling fn is 16 byte aligned.
	* sysdeps/i386/tst-stack-align.h: New file.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/tst-stack-align.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=NONE&r2=1.1.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/i386/clone.S.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.23&r2=1.23.2.1

Comment 2 Sourceware Commits 2005-02-16 08:46:12 UTC
Subject: Bug 723

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_3-branch
Changes by:	roland@sources.redhat.com	2005-02-16 08:45:57

Modified files:
	nptl/sysdeps/i386: Makefile tls.h 
	nptl           : Makefile 
Added files:
	nptl           : tst-align2.c 

Log message:
	2004-12-21  Jakub Jelinek  <jakub@redhat.com>
	
	[BZ #723]
	* sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
	%esp.
	* Makefile (tests): Add tst-align2.
	* tst-align2.c: New test.
	* sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
	-mpreferred-stack-boundary=4.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/nptl/sysdeps/i386/Makefile.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.6&r2=1.6.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/nptl/sysdeps/i386/tls.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.26&r2=1.26.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/nptl/tst-align2.c.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=NONE&r2=1.1.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/nptl/Makefile.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.165&r2=1.165.2.1

Comment 3 Sourceware Commits 2005-02-16 08:46:35 UTC
Subject: Bug 723

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_3-branch
Changes by:	roland@sources.redhat.com	2005-02-16 08:46:16

Modified files:
	linuxthreads/sysdeps/i386: Makefile 
	linuxthreads   : Makefile 
Added files:
	linuxthreads   : tst-align.c 

Log message:
	2004-12-21  Jakub Jelinek  <jakub@redhat.com>
	
	[BZ #723]
	* Makefile (tests): Add tst-align.
	* tst-align.c: New test.
	* sysdeps/i386/Makefile (CFLAGS-tst-align.c): Add
	-mpreferred-stack-boundary=4.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/linuxthreads/sysdeps/i386/Makefile.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.5&r2=1.5.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/linuxthreads/tst-align.c.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=NONE&r2=1.1.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/linuxthreads/Makefile.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.96&r2=1.96.2.1

Comment 4 Roland McGrath 2005-04-05 23:59:08 UTC
These changes are in the 2.3 branch as well as the trunk now.