You can do a diff betwen my ebuild and the ebuild in portage to see what I've changed. Any suggestions are welcome!

How do I use it?

1. Emerge subversion if you don't have it.
2. Pull the overlay by running svn co http://svn.evolution-mission.org/toolchain_overlay/sys-libs/glibc/. If you want you can also pull the whole overlay by running svn co http://svn.evolution-mission.org/toolchain_overlay. That'll get you glibc and a binutils that supports -Bdirect.
2. Put it in /usr/local/toolchain_overlay/sys-libs/
3. Edit make.conf and make sure you have PORTDIR_OVERLAY="/usr/local/toolchain_overlay/"
4. Backup your old glibc with quickpkg
6. Unmask =sys-libs/glibc-2.4* (~arch keyword for 2.5, -* keyword for 2.5.90.2006XXXX).
(7.) If you want to use hashstyle you need to unmask and install binutils 2.17.50.0.3.
(8.) If you´re using stable unmask and install the ~arch linux-headers.
9. emerge glibc

No rebuilding or anything should be needed unless you've enabled hashstyle or -Bdirect for the first time (Don't forget to add appropriate LDFLAGS!).

Enhancements

* --enable-kernel bumped to 2.6.16 or 2.6.17.
This prevents glibc from compiling in compatibility cruft making it leaner and meaner. Of course you need to be running a 2.6.16 or 2.6.17 kernel at least.

* Added back the nomalloccheck USE-flag.
Disable malloccheck. There is a reason why this is on by default. Use with care!

* Glibc madvise support.
Allows glibc to tell the kernel about loaded libraries that are expected to be needed in the near future. Might improve performance somewhat.

* Binutils --hash-style= support
Enables support for --hash-style= in LDFLAGS. It can speed up dynamic loading of libraries quite a bit and obsoletes some of the earlier optimization experiments (-hashvals, -z,dynsort). It probably doesn't work with -Bdirect (yet?).

If you use prelink you need to use at least a 20060712 snapshot.

* Binutils -Bdirect support for faster dynamic loading of libraries.
Adds support for the -Bdirect ld-flag to speed up dynamic loading of libraries. As much as possible should be compiled with this flag for best effect. It can coexist with prelink and other LDFLAGS but probably not --hash-style. You should also edit the file /etc/env.d/00basic and add LD_BIND_DIRECT="1". This feature is experimental!

Bdirect requires a binutils overlay. For more info about about -hashvals, -Bdirect and -z,dynsort check bug #114008.

Questions and answers

Will this break my system?
2.4 and 2.5 are stable relesases so probably not. But there might be some problems with the snapshots. Anyway, what's the fun of never breaking anything?

What arches does it run on?
It should at least run on x86_64 and x86 but probably others too.

Are there any known problems?
Some packages might fail to build against 2.5 if you are on stable, use package.keywords for those!

Is the changelog also included in the overlay?
Yes, check files/changelog.overlay.

Build settings?
Only nptlonly is supported in glibc 2.4 and later.

I recomend that you set the glibc-omitfp USE-flag, it builds all the libs twice, once with extra optimizations and once with the standard settings for debuging purposes. The optimized libraries are used by default.

2006-10-22
*Synced with portage.
*New snapshot.
*New version of the -Bdirect patch.

2006-10-10
*Synced with portage.
*New snapshot (2.5.90).

2006-10-05
*Removed the hash-style USE from 2.4-r4, the patches are now always applied.
*Added the latest -Bdirect patch to all ebuilds, also always applied.
*Hashvals is no longer supported, use either --hash-style or -Bdirect (but using both will probably break).
*New snapshot.

2006-10-02
*Synced with portage, now using the 2.5 release!
*2.5 now uses the 2.6.17 headers.
*Removed some old files.

2006-09-20
*Fixed -Bdirect support in the 2.4-r4 ebuild.

2006-09-15
*Synced with portage.
*All ebuild now uses the 2.6.16 headers.
*New snapshot (for once nothing needs to be reverted to make it build. Yay!)
*The latest hash-style code from glibc cvs.

It doesnt seem like binutils is getting patched with any kind of -bdirect support???

What is the patch called for binutils?

Looking at the output from emerge binutils doesnt show anything that one might relate to bdirect....

I've fount the proper exclusion line from the glibc ebuild, and I've changedit slightly so that it should apply, then I put the modified ebuild into my overlay.... Is that the proper way to do these sorts of things?

well the binutills in portage is not working for me, no matter what I compile with it it won't get a .direct section.
I had to create my own binutils ebuild based on the binutils-2.16.91.0.6 ebuild that's in portage and the latest binutils-suse-* patches.

Have you checked out and possibly eliminated the performance problem of the snapshots I experienced?

The ebuild is almost the same as in my old overlay so I guess the problem remain. But I can't reproduce it here so I'm not sure what's wrong. I hope it gets fixed when I update my overlay next time once suse gets their patches in sync.

It doesnt seem like binutils is getting patched with any kind of -bdirect support???

What is the patch called for binutils?

Looking at the output from emerge binutils doesnt show anything that one might relate to bdirect....

I've fount the proper exclusion line from the glibc ebuild, and I've changedit slightly so that it should apply, then I put the modified ebuild into my overlay.... Is that the proper way to do these sorts of things?

Only binutils 2.16.1-r1 has the -Bdirect patch but it lacks dynsort and hashvals. It's probably a better idea to do like CoronaLover and create your own binutils overlay with the latest patches. Anyway I uploaded my own binutils overlay. You can get it from:
http://snigel.no-ip.com/~nxsty/linux/binutils-overlay.tar.bz2

Last edited by nxsty on Mon Feb 20, 2006 10:07 am; edited 1 time in total

I've recompiled all my kde packages with -Bdirect flag, using binutils-2.16.1-r1 from portage. I have glibc glibc-2.3.6-r2 from your overlay.

And after recompilation I haven't noticed any speedup in KDE startup. Is it possible to check if certain binary have -Bdirect linker optimization applied?_________________To nie moje s± s³owa, to legenda ludowa.....