Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 266483 - gdb does not work with executables linked with -bbigtoc linker flag
Summary: gdb does not work with executables linked with -bbigtoc linker flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: PPC AIX
: High normal (vote)
Assignee: Michael Haubenwallner (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-17 07:34 UTC by Michael Haubenwallner (RETIRED)
Modified: 2011-12-15 18:09 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 Michael Haubenwallner (RETIRED) gentoo-dev 2009-04-17 07:34:40 UTC
The default for gcc on AIX is to compile with full TOC (-mfull-toc).
But this can lead to "TOC overflow" errors at linktime.
AIX does have the linker flag '-bbigtoc' to avoid this problem.

But gdb does not work correctly with binaries using big TOC.

So switching gcc's default to '-mminimal-toc' seems necessary, see also
http://www-03.ibm.com/servers/enable/site/peducation/wp/df2e/df2e.pdf

With gcc-3.4.6, this must not be done for gcc itself.
Instead, the installed 'specs' needs to be patched.

With gcc-4.*, patching gcc-source to change the default works.
Comment 1 Michael Haubenwallner (RETIRED) gentoo-dev 2009-04-17 07:46:39 UTC
For gcc-3.4.6 done in r43716.
Comment 2 Michael Haubenwallner (RETIRED) gentoo-dev 2010-12-10 16:55:35 UTC
Fpr gcc-4.2.4 done in r58998.
For gcc-4.4.5 done in r58998.
Comment 3 Michael Haubenwallner (RETIRED) gentoo-dev 2011-06-20 12:55:46 UTC
(In reply to comment #0)
> With gcc-4.*, patching gcc-source to change the default works.

Well, not really: Building libstdc++ (and eventually libgcc_s) with minimal-toc breaks C++ exception handling.
Comment 4 Michael Haubenwallner (RETIRED) gentoo-dev 2011-06-20 15:47:30 UTC
(In reply to comment #3)
> (In reply to comment #0)
> > With gcc-4.*, patching gcc-source to change the default works.
> 
> Well, not really: Building libstdc++ (and eventually libgcc_s) with minimal-toc
> breaks C++ exception handling.

gcc-4.2.4-r* (without revbump) now defaults to '-mno-fp-in-toc -mno-sum-in-toc' instead of '-mminimal-toc' to keep C++ exceptions working.

Let's see which package now still exceeds normal TOC and needs either -mminimal-toc compiler flag or -bbigtoc linker flag (net-misc/mico?).
Comment 5 Fabian Groffen gentoo-dev 2011-12-15 18:09:36 UTC
assuming latest fixes and compiler bumps fixed this issue.