http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36041
--- Comment #12 from Marc Glisse <glisse at gcc dot gnu.org> --- Created attachment 30381 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30381&action=edit IFUNC proof of concept patch Sadly, libgcc is compiled with gcc and not g++ so we can't use the recent multiversioning support with the target attribute and we have to manually set up ifunc. Note that the si/di difference is not a typo, just a wart in the way libgcc is configured. This is just a proof of concept, we'd want to replace also __popcountti2 at least. And most importantly we need to restrict the inclusion of t-ifunc to platforms where ifunc is supported (move it elsewhere in config.host, maybe even include the content of t-ifunc in an existing t-*). There are probably better ways to organize this, putting the generic implementation in libgcc2.c protected by suitable macros (which ones?) so it benefits also darwin/cygwin (no ifunc) and non-x86 platforms. I didn't check the generic code, I just pasted it from one of the comments. If you want this to happen, please work out a patch and post it to gcc-patches (you can start from this one or not), don't wait for others to write one, I won't have more time to spend on this. Don't be too afraid to test the wrong macro, the reviewer will tell you if that is the case.