* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
@ 2012-09-16 14:39 ` pedzsan at gmail dot com
2012-09-16 14:40 ` pedzsan at gmail dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pedzsan at gmail dot com @ 2012-09-16 14:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
--- Comment #1 from Perry Smith <pedzsan at gmail dot com> 2012-09-16 14:39:05 UTC ---
Created attachment 28201
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28201
Educational program demonstrating when atexit is used.
Run it without an argument, the function that declares the static is not called
-- thus the DTOR is not registered. Run it with an argument to call the
function that declares the static.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
2012-09-16 14:39 ` [Bug c++/54601] " pedzsan at gmail dot com
@ 2012-09-16 14:40 ` pedzsan at gmail dot com
2012-09-16 18:47 ` redi at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pedzsan at gmail dot com @ 2012-09-16 14:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
--- Comment #2 from Perry Smith <pedzsan at gmail dot com> 2012-09-16 14:40:25 UTC ---
Forgot to mention. A long thread discussing the issue, etc is here:
http://www.mail-archive.com/gcc@gcc.gnu.org/msg65140.html
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
2012-09-16 14:39 ` [Bug c++/54601] " pedzsan at gmail dot com
2012-09-16 14:40 ` pedzsan at gmail dot com
@ 2012-09-16 18:47 ` redi at gcc dot gnu.org
2012-09-17 14:18 ` pedzsan at gmail dot com
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2012-09-16 18:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-09-16 18:47:11 UTC ---
To be included the patch needs to be against trunk.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
` (2 preceding siblings ...)
2012-09-16 18:47 ` redi at gcc dot gnu.org
@ 2012-09-17 14:18 ` pedzsan at gmail dot com
2012-10-01 16:31 ` paolo.carlini at oracle dot com
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pedzsan at gmail dot com @ 2012-09-17 14:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
--- Comment #4 from Perry Smith <pedzsan at gmail dot com> 2012-09-17 14:18:34 UTC ---
(In reply to comment #3)
> To be included the patch needs to be against trunk.
I don't mind trying to redo this against trunk but I need some help learning
how to build against the trunk. I'm assume it is documented somewhere but I
don't know where. I looked (e.g. site:gcc.gnu.org/onlinedocs build trunk)
doesn't hit anything useful. The pdf does not have "autoconf" nor "automake"
which I'm sure are needed. So I got stumped. Sorry.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
` (3 preceding siblings ...)
2012-09-17 14:18 ` pedzsan at gmail dot com
@ 2012-10-01 16:31 ` paolo.carlini at oracle dot com
2012-10-03 17:53 ` dje at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-01 16:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dje at gcc dot gnu.org
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-01 16:31:10 UTC ---
Adding David as AIX maintainer.
In terms of building, nothings extraordinary happened between 4.5 and current
mainline. Make sure you have the required libraries installed (minimally, gmp,
mpfr, mpc) and build as usual. Maybe David can help you about AIX-specific
details.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
` (4 preceding siblings ...)
2012-10-01 16:31 ` paolo.carlini at oracle dot com
@ 2012-10-03 17:53 ` dje at gcc dot gnu.org
2013-01-30 16:59 ` dje at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dje at gcc dot gnu.org @ 2012-10-03 17:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
David Edelsohn <dje at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-10-03
Ever Confirmed|0 |1
--- Comment #6 from David Edelsohn <dje at gcc dot gnu.org> 2012-10-03 17:52:48 UTC ---
Perry and I have been discussing this for a while. As others mentioned, the
patch should be against mainline and this discussion of the path should happen
on gcc-patches, not Bugzilla.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
` (5 preceding siblings ...)
2012-10-03 17:53 ` dje at gcc dot gnu.org
@ 2013-01-30 16:59 ` dje at gcc dot gnu.org
2013-01-30 21:58 ` dje at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dje at gcc dot gnu.org @ 2013-01-30 16:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
--- Comment #7 from David Edelsohn <dje at gcc dot gnu.org> 2013-01-30 16:59:13 UTC ---
Created attachment 29307
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29307
cxa_atexit implementation in libgcc
This version of the patch implements __cxa_atexit and __cxa_finalize in libgcc,
not libsupc++, with no modifications to collect2. I am not sure if using a low
priority C destructor to run __cxa_finalize early in the destructor list is
correct. The original collect2 patch ran it last, after other destructors,
which I believe is incorrect and does not match crtstuff.c semantics for ELF.
When I configured GCC with the patch and --enable__cxa-atexit, I saw a few
additional C++ errors in the testsuite.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
` (6 preceding siblings ...)
2013-01-30 16:59 ` dje at gcc dot gnu.org
@ 2013-01-30 21:58 ` dje at gcc dot gnu.org
2013-01-31 4:53 ` dje at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dje at gcc dot gnu.org @ 2013-01-30 21:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
David Edelsohn <dje at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #29307|0 |1
is obsolete| |
--- Comment #8 from David Edelsohn <dje at gcc dot gnu.org> 2013-01-30 21:57:52 UTC ---
Created attachment 29311
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29311
Revised __cxa_atexit for libgcc
The revised patch uses LIB2ADDEH to add the functions to libgcc_s.a and
libgcc_eh.a so that only one copy should exist in a process.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
` (7 preceding siblings ...)
2013-01-30 21:58 ` dje at gcc dot gnu.org
@ 2013-01-31 4:53 ` dje at gcc dot gnu.org
2013-01-31 5:50 ` pedzsan at gmail dot com
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dje at gcc dot gnu.org @ 2013-01-31 4:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
--- Comment #9 from David Edelsohn <dje at gcc dot gnu.org> 2013-01-31 04:52:51 UTC ---
This is going to be more difficult because __dso_handle needs to be provided by
a new crt file supplied by GCC, not by the libraries. That is the way that
every module ends up with a unique value. Otherwise the single __dso_handle is
shared across the entire process.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
` (8 preceding siblings ...)
2013-01-31 4:53 ` dje at gcc dot gnu.org
@ 2013-01-31 5:50 ` pedzsan at gmail dot com
2013-01-31 6:11 ` dje at gcc dot gnu.org
2013-02-01 20:27 ` dje at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: pedzsan at gmail dot com @ 2013-01-31 5:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
--- Comment #10 from Perry Smith <pedzsan at gmail dot com> 2013-01-31 05:50:00 UTC ---
Can you keep the libraries like you have them with the functions and private
structures for the functions coming from the library but just put the
definition of __dso_handle in crt?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
` (9 preceding siblings ...)
2013-01-31 5:50 ` pedzsan at gmail dot com
@ 2013-01-31 6:11 ` dje at gcc dot gnu.org
2013-02-01 20:27 ` dje at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: dje at gcc dot gnu.org @ 2013-01-31 6:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
David Edelsohn <dje at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #29311|0 |1
is obsolete| |
--- Comment #11 from David Edelsohn <dje at gcc dot gnu.org> 2013-01-31 06:11:31 UTC ---
Created attachment 29312
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29312
__cxa_atexit with new crt file
I think it needs something like this new patch, which adds crtdso.o providing
__dso_handle. collect2 searches the file properly and finds the destructor.
But I am not sure if the driver will find the file and if the file is installed
correctly yet.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/54601] AIX uses atexit which causes unloading of shared modules to break
2012-09-16 14:36 [Bug c++/54601] New: AIX uses atexit which causes unloading of shared modules to break pedzsan at gmail dot com
` (10 preceding siblings ...)
2013-01-31 6:11 ` dje at gcc dot gnu.org
@ 2013-02-01 20:27 ` dje at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: dje at gcc dot gnu.org @ 2013-02-01 20:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54601
--- Comment #12 from David Edelsohn <dje at gcc dot gnu.org> 2013-02-01 20:26:37 UTC ---
Author: dje
Date: Fri Feb 1 20:26:24 2013
New Revision: 195675
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195675
Log:
PR target/54601
libgcc/
* config.host (powerpc-ibm-aix[56789]): Add t-aix-cxa to tmake_file.
Add crtcxa to extra_parts.
* config/rs6000/exit.h: New file.
* config/rs6000/cxa_atexit.c: New file.
* config/rs6000/cxa_finalize.c: New file.
* config/rs6000/crtcxa.c: New file.
* config/rs6000/t-aix-cxa: New file.
* config/rs6000/libgcc-aix-cxa.ver: New file.
gcc/
* configure.ac (cxa_atexit): Add AIX.
* configure: Regenerate.
* config/rs6000/aix61.h (STARTFILE_SPEC): Add crtcxa.o.
Added:
trunk/libgcc/config/rs6000/crtcxa.c
trunk/libgcc/config/rs6000/cxa_atexit.c
trunk/libgcc/config/rs6000/cxa_finalize.c
trunk/libgcc/config/rs6000/exit.h
trunk/libgcc/config/rs6000/libgcc-aix-cxa.ver
trunk/libgcc/config/rs6000/t-aix-cxa
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/aix61.h
trunk/gcc/configure
trunk/gcc/configure.ac
trunk/libgcc/ChangeLog
trunk/libgcc/config.host
^ permalink raw reply [flat|nested] 13+ messages in thread