public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* egcs and shared LIBS on AIX4.1.5
@ 1999-03-17  2:49 Groove, Christian
       [not found] ` < 81A51A42F329D211904E00A0C9D8E2A0272340@falke.norcom.de >
  1999-03-31 23:46 ` Groove, Christian
  0 siblings, 2 replies; 4+ messages in thread
From: Groove, Christian @ 1999-03-17  2:49 UTC (permalink / raw)
  To: egcs-bugs; +Cc: egcs

Hello

i have got a serious problem with the egcs compiler, that also
affects the g++ compiler on the AIX4.1.5 (others too) operating
system.
 
I would like to create shared libraries on that plattfrom written
of course in C++. I would also like to use global (instantiated)
objects/classes, that should be automatically instantiated, when 
the shared lib gets loaded.
This task is a general problem for AIX (with their braindead XCOFF)
linker, true ELF linkers (Linux Solaris) do not have any problems 
with this, provided that you have a good C++ compiler installed 
(i.e. egcs)

OK, IBM also offers an C++ compiler, and in order to get a workaround
they introduced so called priorities pragmas and a ld-linker wrapper,
that helps to create shared libs. 
Due to the poor debugging support and the limited language capabilities
of the IBM compiler, i would like to switch to egcs/g++ and gdb/ddd.

Now the question, who do i introduce priorities in g++, so that the
linker remarks the C++ classes as to be initialized, when the shared
lib gets loaded. 

Thanks in advance

Christian Groove



Christian Groove
NorCom GmbH
81929 Muenchen, Stefan-George-Ring 6
Tel.: + 49 89 93948 271  Fax: + 49 89 93948 111
Mail: groove@norcom.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: egcs and shared LIBS on AIX4.1.5
       [not found] ` < 81A51A42F329D211904E00A0C9D8E2A0272340@falke.norcom.de >
@ 1999-03-17 18:49   ` David Edelsohn
  1999-03-31 23:46     ` David Edelsohn
  0 siblings, 1 reply; 4+ messages in thread
From: David Edelsohn @ 1999-03-17 18:49 UTC (permalink / raw)
  To: Groove, Christian; +Cc: egcs

	I think that you might receive more responses if you did not
disparage the systems about which you are asking for help.

	All GCC-produced shared objects contain functions _GLOBAL_DI() and
_GLOBAL_DD() which will run the static initializers and finalizers in that
object, but you need to obtain the functions from that object as the name
is the same in every object.  After you dynamically load an object, you
can invoke that function to run the constructors.

	G++ does not know about AIX constructor/destructor priority.
Separate work on G++ constructor/destructor priority is occurring, but
there currently are no plans for it to interact with AIX's mechanisms.

	Ignoring priorities, GCC could produce objects which automatically
run static constructors and destructors using AIX's loadAndInit() C++
call.  No one has made the effort to implement this functionality which
only provided a public interface beginning with AIX 4.2.  One needs to
prevent GCC's built-in static constructor and destructor functionality
when used with executables that start with main() from running the
constructors and destructors twice.

David

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: egcs and shared LIBS on AIX4.1.5
  1999-03-17 18:49   ` David Edelsohn
@ 1999-03-31 23:46     ` David Edelsohn
  0 siblings, 0 replies; 4+ messages in thread
From: David Edelsohn @ 1999-03-31 23:46 UTC (permalink / raw)
  To: Groove, Christian; +Cc: egcs

	I think that you might receive more responses if you did not
disparage the systems about which you are asking for help.

	All GCC-produced shared objects contain functions _GLOBAL_DI() and
_GLOBAL_DD() which will run the static initializers and finalizers in that
object, but you need to obtain the functions from that object as the name
is the same in every object.  After you dynamically load an object, you
can invoke that function to run the constructors.

	G++ does not know about AIX constructor/destructor priority.
Separate work on G++ constructor/destructor priority is occurring, but
there currently are no plans for it to interact with AIX's mechanisms.

	Ignoring priorities, GCC could produce objects which automatically
run static constructors and destructors using AIX's loadAndInit() C++
call.  No one has made the effort to implement this functionality which
only provided a public interface beginning with AIX 4.2.  One needs to
prevent GCC's built-in static constructor and destructor functionality
when used with executables that start with main() from running the
constructors and destructors twice.

David

^ permalink raw reply	[flat|nested] 4+ messages in thread

* egcs and shared LIBS on AIX4.1.5
  1999-03-17  2:49 egcs and shared LIBS on AIX4.1.5 Groove, Christian
       [not found] ` < 81A51A42F329D211904E00A0C9D8E2A0272340@falke.norcom.de >
@ 1999-03-31 23:46 ` Groove, Christian
  1 sibling, 0 replies; 4+ messages in thread
From: Groove, Christian @ 1999-03-31 23:46 UTC (permalink / raw)
  To: egcs-bugs; +Cc: egcs

Hello

i have got a serious problem with the egcs compiler, that also
affects the g++ compiler on the AIX4.1.5 (others too) operating
system.
 
I would like to create shared libraries on that plattfrom written
of course in C++. I would also like to use global (instantiated)
objects/classes, that should be automatically instantiated, when 
the shared lib gets loaded.
This task is a general problem for AIX (with their braindead XCOFF)
linker, true ELF linkers (Linux Solaris) do not have any problems 
with this, provided that you have a good C++ compiler installed 
(i.e. egcs)

OK, IBM also offers an C++ compiler, and in order to get a workaround
they introduced so called priorities pragmas and a ld-linker wrapper,
that helps to create shared libs. 
Due to the poor debugging support and the limited language capabilities
of the IBM compiler, i would like to switch to egcs/g++ and gdb/ddd.

Now the question, who do i introduce priorities in g++, so that the
linker remarks the C++ classes as to be initialized, when the shared
lib gets loaded. 

Thanks in advance

Christian Groove



Christian Groove
NorCom GmbH
81929 Muenchen, Stefan-George-Ring 6
Tel.: + 49 89 93948 271  Fax: + 49 89 93948 111
Mail: groove@norcom.de



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-03-31 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-17  2:49 egcs and shared LIBS on AIX4.1.5 Groove, Christian
     [not found] ` < 81A51A42F329D211904E00A0C9D8E2A0272340@falke.norcom.de >
1999-03-17 18:49   ` David Edelsohn
1999-03-31 23:46     ` David Edelsohn
1999-03-31 23:46 ` Groove, Christian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).