I''m trying to patch gentoo/glibc-2.3.5 with the tls patch from the wiki. What I have so far (for sysdeps/unix/sysv/linux/i386/sysdeps.h): 0:SETUP_PIC_REG (dx); \ addl $_GLOBAL_OFFSET_TABLE_, %edx; \ movl %gs:0, %ecx; \ addl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%edx), %ecx; \ xorl %edx, %edx; \ subl %eax, %edx; \ --------------------------------------------------------------------------- It''s the last lines of the original patch that I don''t know how to apply: - movl %edx, %gs:0(%ecx); \ + movl %edx, (%ecx); \ They belong somewhere in the following snippet: SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx); \ orl $-1, %eax; \ jmp L(pseudo_end); # ifndef NO_TLS_DIRECT_SEG_REFS # define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \ movl src, %gs:(destoff) # else # define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \ addl %gs:0, destoff; \ movl src, (destoff) # endif Any help is greatly appreciated. Brian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
It looks like your glibc has already been patched. Just compile having defined NO_TLS_DIRECT_SEG_REFS Ian> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of B.G. Bruce > Sent: 27 July 2005 23:21 > To: xen-devel > Subject: [Xen-devel] Gentoo/glibc-2.3.5 tls patch: Need HELP > > I''m trying to patch gentoo/glibc-2.3.5 with the tls patch > from the wiki. > > > What I have so far (for sysdeps/unix/sysv/linux/i386/sysdeps.h): > 0:SETUP_PIC_REG (dx); > \ > addl $_GLOBAL_OFFSET_TABLE_, %edx; > \ > movl %gs:0, %ecx; > \ > addl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%edx), %ecx; > \ > xorl %edx, %edx; > \ > subl %eax, %edx; > \ > > -------------------------------------------------------------- > ------------- > > It''s the last lines of the original patch that I don''t know > how to apply: > - movl %edx, %gs:0(%ecx); > \ > + movl %edx, (%ecx); > \ > > They belong somewhere in the following snippet: > > SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx); > \ > orl $-1, %eax; > \ > jmp L(pseudo_end); > # ifndef NO_TLS_DIRECT_SEG_REFS > # define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) > \ > movl src, %gs:(destoff) > # else > # define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) > \ > addl %gs:0, destoff; > \ > movl src, (destoff) > # endif > > Any help is greatly appreciated. > > Brian. > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian, I''ve hand applied most of the patch already, that''s why the code looks okay. It''s the last line of the patch that I''m having trouble with. - movl %edx, %gs:0(%ecx); + movl %edx, (%ecx); Instead of "movl %edx, %gs:0(%ecx);" I''ve got the following: SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx); and that code (SYSCALL_ERROR_HANDLER_TLS_STORE) looks like: < I THINK I NEED TO CHANGE SOMETHING BELOW THIS LINE> ------------------------------------------------------ # ifndef NO_TLS_DIRECT_SEG_REFS # define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \ movl src, %gs:(destoff) # else # define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \ addl %gs:0, destoff; \ movl src, (destoff) # endif ----------------------------------------------------- < I THINK I NEED TO CHANGE SOMETHING ABOVE THIS LINE> So, what, if anything do I need to change? Regards, Brian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian, Or are you telling me that if my glibc source has IFDEF/IFNDEF for NO_TLS_DIRECT_SEG_REFS, it should be XEN ready without any further patching? - meaning NO NEED for the patch from the wiki - that I''m probably about to break something in a very bad way if I apply that patch. Regards, Brian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 28 Jul 2005, at 00:11, B.G. Bruce wrote:> Or are you telling me that if my glibc source has IFDEF/IFNDEF for > NO_TLS_DIRECT_SEG_REFS, it should be XEN ready without any further > patching? - meaning NO NEED for the patch from the wiki - that I''m > probably about to break something in a very bad way if I apply that > patch.Yes, this is what he means. The piece of code you pointed at in your previous email (the macro definition) will do the correct, Xen-friendly thing if it is built with NO_TLS_DIRECT_SEG_REFS defined. So define that and don''t apply the wiki patch. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel