On a uclibc system, unshare() is defined as an extern int function in /usr/include/bits/sched.h, while tk defines unshare as a static Tcl_Obj in generic/ttk/ttkTreeview.c. The name collision can be avoided by renaming unshare in ttkTreeview.c. Reproducible: Always
The issue is easily fixed by just renaming unshare to unshared in tk. I have a patch on my overlay: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=blob;f=dev-lang/tk/files/tk-8.5.10-fix-name-collision-uclibc.patch;h=30ce843aec532370f5574d1613a5cac444e3e213;hb=d56e0d4fcf33948b8b33481d51f79e7aacd1aff1 I'm cc-ing toolchain just in case I missed something, but this seems like a no-brainer. I'll upstream the patch.
having unshare() in bits/sched.h isn't a bug. glibc does it too. uClibc does kind of suck in that it ends up including more headers than normal via its stdio stack. but fixing tk to not re-use a symbol that the C library is using makes sense to me.
Upstream is aware of the issue and has applied a fix: https://sourceforge.net/tracker/index.php?func=detail&aid=3535362&group_id=12997&atid=112997 I'm trying to get a link to the patch in their "current development build" but their entire repository system is terrible.
Here's their commit: http://core.tcl.tk/tk/fdiff?v1=041565e83bd022ba0987a4191894d074228c0958&v2=1eac70cdf037fad6d1a1f16a174dd2be7272424a and here's a raw patch http://core.tcl.tk/tk/fdiff?v1=041565e83bd022ba0987a4191894d074228c0958&v2=1eac70cdf037fad6d1a1f16a174dd2be7272424a&patch Its essentially the same fix as my patch, except they renamed it to unshareObj.
Anthony please proceed.
I only touched the latest unstables. While probably safe even on 8.5.10-r1 there's no pressing need. 04 Nov 2012; Anthony G. Basile <blueness@gentoo.org> +files/tk-8.5.11-fix-name-collision-uclibc.patch, tk-8.5.11-r1.ebuild, tk-8.5.11.ebuild: Patch 8.5.11 to build on uclibc, bug #441630