This is the continuing of the "Glibc with amd64 performance patches" thread. The changes from my overlay where included in glibc 2.3.6-r3 and 2.4-r2. The last version of my old overlay is at http://snigel.no-ip.com/~nxsty/linux/gl ... ld.tar.bz2.
It's based on up to date glibc-2.4-r4 and 2.5 ebuilds but it also includes this (more details below):
* --enable-kernel bumped to 2.6.16 (2.4) or 2.6.17 (2.5, 2.5.90.2006XXXX)
* Added back the nomalloccheck USE.
* Build with -DNDEBUG=1 if USE -debug.
* CVS update from HEAD (2.5.90.2006XXXX only).
* Glibc madvise support.
* Binutils --hash-style= support. Requires binutils 2.17.90.0.3 or later.
* Binutils -Bdirect support for faster dynamic loading of libraries. Requires patched binutils. Probably can´t be used with --hash-style.
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/toolch ... ibs/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.
Here is my emerge --info.
Changelog
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.
2006-08-11
*fixed the build.
2006-08-09
*Added some hash-style fixes from glibc CVS (2.4-rX only)
*Removed old snapshot ebuilds.
2006-08-05
*New snapshot.
2006-08-02
*Moved the hashstyle patches to the patch tarball.
2006-07-21
*Synced with portage.
*New hashstyle patch, extracted from glibc CVS.
2006-07-16
*Synced with portage.
*New snapshot, hash-style patches merged.
*Added the hash-style patches to 2.4 with a hashstyle USE. Thanks to nesl247!
2006-07-01 (2)
*Reverted a commit that borked the build. (2.4.90)
2006-07-01
*Removed gcc 4.0 stuff (fortify USE, santize omitfp)
*New snapshot.
*Synced with portage.
2006-05-16
*New snapshot.
*Reverted a patch to fix build.
2006-05-15
*Synced with portage, based on the -r3 ebuild.
*The ebuild with 2.6.16 headers is now -r4.
*New snapshot.
2006-05-11
*Synced with portage.
*New snapshot.
2006-05-04
*Removed the -r1 ebuild as -r2 is in ~arch.
*Synced the -r2 with portage, it now uses stable 2.6.11 headers.
*Added a -r3 ebuild that is the same as -r2 but uses the 2.6.16 headers.
2006-05-03
*Synced with portage.
*New snapshot.
*Fixed SRC_URI (I think).
2006-04-17
*Synced with portage.
*Added a new snapshot.
2006-04-12
*Synced the 2.4-r2 ebuild with portage.
2006-03-29
*Added a new 2.4-r2 ebuild that uses the 2.6.16 headers (hardmasked currently).
*Added a new snapshot ebuild for those on the bleeding edge.
2006-03-23
*Synced with portage.
2006-03-17
*Synced with portage, based on 2.4-r1.
*Removed some merged patches, including amd64 strings (though it's disabled by default in portage).
2006-03-16
*Added patch from bug #124682, hardened should work now on amd64.
2006-03-15
*Synced with portage.
2006-03-12 (2)
*Updated the libm patch from suse.
2006-03-12
*SSP compile fix.
-- / / snip - see the changelog.overlay for the rest / / --
Happy gentooing!




