Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 94256 - linux-2.6 headers: linux/unistd.h defines 'extern int errno'
Summary: linux-2.6 headers: linux/unistd.h defines 'extern int errno'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: Tim Yamin (RETIRED)
URL:
Whiteboard:
Keywords:
: 113991 (view as bug list)
Depends on:
Blocks: 91375 93419 94363
  Show dependency tree
 
Reported: 2005-05-28 02:05 UTC by SpanKY
Modified: 2005-11-30 05:48 UTC (History)
2 users (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 SpanKY gentoo-dev 2005-05-28 02:05:15 UTC
the old way of accessing errno was to simply do 'extern int errno;' ... as we found out with glibc-2.3.2, the libc guys have no problem breaking this since no one ever said it was a standard :)

the proper way to access errno is via #include <errno.h>

the simple fix is to replace the 'extern int errno;' from linux/unistd.h with '#include <errno.h>'

the reason no one has noticed before is two fold ... if you #include <errno.h> at some point, bits/errno.h defines a macro for 'errno' which glosses over the issue in unistd.h ... the other reason is that older binutils did not contain strict checks to verify TLS linking while newer ones do

we can see this issue manifest itself in Bug 93419 where <linux/unistd.h> is included, <errno.h> is *not* included, and the build fails with newer binutils due to a TLS issue
Comment 1 Luca Barbato gentoo-dev 2005-05-29 00:30:36 UTC
that header subtly break glibc, I can experience such problem trying to build
valgrind on ppc
Comment 2 Tim Yamin (RETIRED) gentoo-dev 2005-05-29 16:11:41 UTC
Fixed in 2.6.11-r1, thanks!
Comment 3 Karl-Johan Karlsson 2005-11-29 14:32:54 UTC
This bug, while fixed in sys-kernel/linux-headers long ago, is still present in 
the latest sys-kernel/mips-headers (2.6.11-r1).
Comment 4 SpanKY gentoo-dev 2005-11-29 19:29:05 UTC
considering mips-headers is a sep package maintained by someone else, you should
file a new bug about the issue for the mips team to fix
Comment 5 SpanKY gentoo-dev 2005-11-30 05:48:07 UTC
*** Bug 113991 has been marked as a duplicate of this bug. ***