... 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 :)
Created attachment 130795 [details, diff] Update freebsd-spec.h to work with eh-frame-hdr
Created attachment 130797 [details, diff] autotool dl_iterate_phdr instead of hardcoding glibc
Created attachment 134172 [details, diff] Sync x86 and sparc64 targets with freebsd
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.
well, the exception functions are provided by libgcc_s.so, so if the changes make the system think the functions arent available ...
FreeBSD kernel and libc have patches from -7 backported for dl_iterate_phdr also. The error could be there.
(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.
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.
Can we get this into gcc someday?
nope :P
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37246 Sent upstream just for kicks.
Baaaaaaah, sent again because I'm clueless. :$ http://gcc.gnu.org/ml/gcc-patches/2008-08/msg01988.html
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.
Last message I see is http://gcc.gnu.org/ml/gcc-patches/2008-08/msg02388.html, did Loren from FreeBSD ever comment?
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.
Do you have the split out patches?
Created attachment 169959 [details, diff] Non-bsd patch. This patch has no code taken from FreeBSD.
Created attachment 169961 [details, diff] Non-bsd patch Sorry, this is the patch without bsd code, the patch before has the lines from FreeBSD.
Created attachment 169963 [details, diff] bsd patch Grrr. patch with FreeBSD code.
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 on attachment 134172 [details, diff] Sync x86 and sparc64 targets with freebsd guessing this is obsoleted by the two latest patches ...
Comment on attachment 164138 [details, diff] 15_all_gcc4-freebsd-dl_iterate_phdr.patch guessing this is obsoleted by the two latest patches ...
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
oh, and update the patches posted upstream please ...
Just for tracking purposes, upstream added this on rev. 152027 http://gcc.gnu.org/viewcvs?view=revision&revision=152027