Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 135201

Summary: sys-libs/glibc-2.4 tls/xen-support request (-mno-tls-direct-seg-refs)
Product: Gentoo Linux Reporter: Daniel Webert <rockoo>
Component: New packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: enhancement CC: chrb
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Daniel Webert 2006-06-01 14:07:45 UTC
sys-libs/glibc-2.4 tls/xen-support request

<snip>
http://wiki.xensource.com/xenwiki/XenSpecificGlibc
It is possible to rebuild glibc so that it only uses segments such that there is no performance penalty. To do this, you need to apply the patch below to the glibc sources and then rebuild glibc with the -mno-tls-direct-seg-refs option.

This patch is not needed for glibc-2.4. It automatically accesses the segments correctly when it detects that it is compiled with the -mno-tls-direct-seg-refs option.
</snip>
Comment 1 Chris Bainbridge (RETIRED) gentoo-dev 2006-06-01 15:05:02 UTC
Well, you can compile with -mno-tls-direct-seg-refs already in CFLAGS.

I don't maintain glibc, so passing this over. As you say, you could just use glibc-2.4.
Comment 2 SpanKY gentoo-dev 2006-06-04 02:13:23 UTC
those fixes are already in glibc-2.3.5 and glibc-2.3.6
http://sourceware.org/ml/glibc-cvs/2005-q1/msg00206.html
http://sources.redhat.com/bugzilla/show_bug.cgi?id=737

we arent supporting anything older than 2.3.6 now

as for adding -mno-tls-direct-seg-refs to all glibc CFLAGS, the answer is no
Comment 3 Daniel Webert 2006-06-05 08:41:45 UTC
ups - spank me - i explained the issue inadequate :( 
as mentioned in comment #1 we can use 'no-tls-direct' in the cflags - so what a about a einfo in the xen-ebuild howto ...
Comment 4 Chris Bainbridge (RETIRED) gentoo-dev 2006-06-05 11:54:43 UTC
It's already mentioned in the xen gentoo wiki which you ebuild points you to.
Comment 5 Chris Bainbridge (RETIRED) gentoo-dev 2006-07-30 03:24:06 UTC
Perhaps something like the following could be added to the glibc ebuild?

if [[ -e /proc/xen ]] && ! is-flag -mno-tls-direct-seg-refs; then ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS. This will result in a 50% performance penalty, which is probably not what you want."; fi

Some people are obviously still tripping over this bug, maybe this would help.
Comment 6 SpanKY gentoo-dev 2006-07-30 10:31:01 UTC
post a diff
Comment 7 SpanKY gentoo-dev 2006-09-24 02:56:25 UTC
added warning to cvs