Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 192403 (PR33417) - sys-devel/gcc-4.2.0 links libgcc_s.so.1 into everything on freebsd
Summary: sys-devel/gcc-4.2.0 links libgcc_s.so.1 into everything on freebsd
Status: RESOLVED FIXED
Alias: PR33417
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All FreeBSD
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/PR33417
Whiteboard:
Keywords:
Depends on:
Blocks: 200815
  Show dependency tree
 
Reported: 2007-09-13 11:07 UTC by Roy Marples (RETIRED)
Modified: 2010-03-07 00:39 UTC (History)
5 users (show)

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


Attachments
Update freebsd-spec.h to work with eh-frame-hdr (16_all_gcc4-freebsd-config.patch,4.80 KB, patch)
2007-09-13 11:11 UTC, Roy Marples (RETIRED)
Details | Diff
autotool dl_iterate_phdr instead of hardcoding glibc (17_all_gcc4-dl_iterate_phdr.patch,4.11 KB, patch)
2007-09-13 11:12 UTC, Roy Marples (RETIRED)
Details | Diff
Sync x86 and sparc64 targets with freebsd (16_all_gcc4-freebsd-config.patch,15.98 KB, patch)
2007-10-23 11:57 UTC, Roy Marples (RETIRED)
Details | Diff
Update for gcc-4.3.1 and FreeBSD-7 (16_all_gcc4-freebsd-config-eh.patch,6.22 KB, patch)
2008-06-19 12:07 UTC, Javier Villavicencio (RETIRED)
Details | Diff
15_all_gcc4-freebsd-dl_iterate_phdr.patch (15_all_gcc4-freebsd-dl_iterate_phdr.patch,5.56 KB, patch)
2008-08-30 22:43 UTC, Javier Villavicencio (RETIRED)
Details | Diff
Non-bsd patch. (gcc4_gentoo.patch,3.97 KB, patch)
2008-10-26 22:36 UTC, Javier Villavicencio (RETIRED)
Details | Diff
Non-bsd patch (gcc4_gentoo.patch,3.97 KB, patch)
2008-10-26 22:37 UTC, Javier Villavicencio (RETIRED)
Details | Diff
bsd patch (gcc4_bsd.patch,1.81 KB, patch)
2008-10-26 22:39 UTC, Javier Villavicencio (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Marples (RETIRED) gentoo-dev 2007-09-13 11:07:29 UTC
... which is bad m'kay?

I've sent patches upstream and thoroughly tested them on sparc64/freebsd and x86/freebsd. I've also tested on amd64/linux and x86/linux to ensure that nothing is broken on that side either.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33416
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33417

Please update Gentoo's gcc with those patches :)
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-09-13 11:11:59 UTC
Created attachment 130795 [details, diff]
Update freebsd-spec.h to work with eh-frame-hdr
Comment 2 Roy Marples (RETIRED) gentoo-dev 2007-09-13 11:12:33 UTC
Created attachment 130797 [details, diff]
autotool dl_iterate_phdr instead of hardcoding glibc
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-10-23 11:57:30 UTC
Created attachment 134172 [details, diff]
Sync x86 and sparc64 targets with freebsd
Comment 4 Alexis Ballier gentoo-dev 2008-05-31 22:18:47 UTC
while the -config one is a must have and affects only freebsd's specs to make them more in line with the ones I have on linux, the dl_iterate_phdr is more problematic:

applying it to 4.2.4 seems to completely break c++ exception handling, such a simple code as:

#include <iostream>
int main()
{
     try
     {
          throw "oh dear";
     }
     catch (...)
     {
          std::cout << "yay\n";
     }
}

if you apply the patch and run the program, the exception will not be caught...

I am still not sure why it breaks this, but not using that patch makes it work.
Comment 5 SpanKY gentoo-dev 2008-06-01 02:43:29 UTC
well, the exception functions are provided by libgcc_s.so, so if the changes make the system think the functions arent available ...
Comment 6 Roy Marples 2008-06-01 06:36:09 UTC
FreeBSD kernel and libc have patches from -7 backported for dl_iterate_phdr also. The error could be there.
Comment 7 Alexis Ballier gentoo-dev 2008-06-01 08:23:57 UTC
(In reply to comment #6)
> FreeBSD kernel and libc have patches from -7 backported for dl_iterate_phdr
> also. The error could be there.


I forgot to mention it fails on linux too.
Comment 8 Javier Villavicencio (RETIRED) gentoo-dev 2008-06-19 12:07:31 UTC
Created attachment 157577 [details, diff]
Update for gcc-4.3.1 and FreeBSD-7

It doesn't autotool dl_iterate_phdr, so it doesn't changes any linux behaviour. 
Separate exception handling stuff inclusion (unwind & etc) on FreeBSD's arch-specific configuration code, this would need extra work from someone with sparc hardware to make it complete.
Comment 9 Javier Villavicencio (RETIRED) gentoo-dev 2008-07-22 16:52:05 UTC
Can we get this into gcc someday?
Comment 10 Davide Italiano (RETIRED) gentoo-dev 2008-07-24 17:55:03 UTC
nope :P
Comment 11 Javier Villavicencio (RETIRED) gentoo-dev 2008-08-26 20:29:48 UTC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37246

Sent upstream just for kicks.
Comment 12 Javier Villavicencio (RETIRED) gentoo-dev 2008-08-26 21:45:12 UTC
Baaaaaaah, sent again because I'm clueless. :$

http://gcc.gnu.org/ml/gcc-patches/2008-08/msg01988.html
Comment 13 Javier Villavicencio (RETIRED) gentoo-dev 2008-08-30 22:43:52 UTC
Created attachment 164138 [details, diff]
15_all_gcc4-freebsd-dl_iterate_phdr.patch

Updated patch after comments on gcc-patches@.

http://gcc.gnu.org/ml/gcc-patches/2008-08/msg02336.html

Don't obsolete Roy's sparc64 patch, this one does not includes it.
Comment 14 Doug Goldstein (RETIRED) gentoo-dev 2008-10-14 21:56:35 UTC
Last message I see is http://gcc.gnu.org/ml/gcc-patches/2008-08/msg02388.html, did Loren from FreeBSD ever comment?
Comment 15 Javier Villavicencio (RETIRED) gentoo-dev 2008-10-15 01:13:01 UTC
Yes, the only concern was regarding the origin/license of the patch. I was asked to split it in two (my code and code imported from FreeBSD), and to find out who were the real authors of the FreeBSD part of the code.
So right now (at least at gcc.gnu.org) this is stalled on a political/legal technicality over 5 or 6 lines of code.
Not likely to get applied upstream anytime soon I'm afraid, but still on track to achieve that.
Comment 16 Doug Goldstein (RETIRED) gentoo-dev 2008-10-16 13:47:59 UTC
Do you have the split out patches?
Comment 17 Javier Villavicencio (RETIRED) gentoo-dev 2008-10-26 22:36:14 UTC
Created attachment 169959 [details, diff]
Non-bsd patch.

This patch has no code taken from FreeBSD.
Comment 18 Javier Villavicencio (RETIRED) gentoo-dev 2008-10-26 22:37:46 UTC
Created attachment 169961 [details, diff]
Non-bsd patch

Sorry, this is the patch without bsd code, the patch before has the lines from FreeBSD.
Comment 19 Javier Villavicencio (RETIRED) gentoo-dev 2008-10-26 22:39:22 UTC
Created attachment 169963 [details, diff]
bsd patch

Grrr. patch with FreeBSD code.
Comment 20 Javier Villavicencio (RETIRED) gentoo-dev 2008-10-26 22:41:03 UTC
Ok I think I got it right this time, sorry for the spam and the delay, been too busy with work the last 2 weeks. 

(In reply to comment #16)
> Do you have the split out patches?
> 

I can include you in the last emails as well if you want.
Comment 21 SpanKY gentoo-dev 2008-12-07 20:14:27 UTC
Comment on attachment 134172 [details, diff]
Sync x86 and sparc64 targets with freebsd

guessing this is obsoleted by the two latest patches ...
Comment 22 SpanKY gentoo-dev 2008-12-07 20:14:30 UTC
Comment on attachment 164138 [details, diff]
15_all_gcc4-freebsd-dl_iterate_phdr.patch

guessing this is obsoleted by the two latest patches ...
Comment 23 SpanKY gentoo-dev 2008-12-07 20:15:12 UTC
ive merged the last two patches posted in 4.3.2-r1 ... if something else needs to be done, please re-open and be very explicit

http://sources.gentoo.org/gentoo/src/patchsets/gcc/4.3.2/gentoo/90_all_gcc-freebsd.patch?rev=1.1
http://sources.gentoo.org/gentoo/src/patchsets/gcc/4.3.2/gentoo/91_all_gcc-freebsd.patch?rev=1.1
Comment 24 SpanKY gentoo-dev 2008-12-07 20:16:25 UTC
oh, and update the patches posted upstream please ...
Comment 25 Javier Villavicencio (RETIRED) gentoo-dev 2010-03-01 20:29:18 UTC
Just for tracking purposes, upstream added this on rev. 152027

http://gcc.gnu.org/viewcvs?view=revision&revision=152027