Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 441630 - dev-lang/tk-8.5.10-r1: name collision with 'unshare' in <bits/sched.h> on a uclibc system
Summary: dev-lang/tk-8.5.10-r1: name collision with 'unshare' in <bits/sched.h> on a u...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: TCL/TK Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-03 21:16 UTC by Anthony Basile
Modified: 2012-11-04 18:38 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2012-11-03 21:16:42 UTC
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
Comment 1 Anthony Basile gentoo-dev 2012-11-03 21:19:09 UTC
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.
Comment 2 SpanKY gentoo-dev 2012-11-04 06:28:05 UTC
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.
Comment 3 Anthony Basile gentoo-dev 2012-11-04 12:46:17 UTC
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.
Comment 4 Anthony Basile gentoo-dev 2012-11-04 12:54:21 UTC
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.
Comment 5 Justin Lecher (RETIRED) gentoo-dev 2012-11-04 13:26:58 UTC
Anthony please proceed.
Comment 6 Anthony Basile gentoo-dev 2012-11-04 18:38:08 UTC
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