This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: shared libraries and libgcc



  In message <19980526110549.65289@rose.fpx.de>you write:
  >  Some of my problems could be solved if libgcc were a shared library
  > itself, yet it is only compiled statically. Let me explain:
  > 
  >  - The Tcl core itself is programmed in C.
  >  - I write a C++ extension, which for example uses the new operator
  >  - gcc/egcs translate this to a call to __builtin_new, which is
  >    defined in libgcc.a:_op_new.o
  >  - Since no functions from libgcc.a:_op_new.o were used in the Tcl
  >    core, the functions were not linked.
  >  --> dynamic loading of my extension fails because of the
  >      unresolved symbol __builtin_new
The .o files which compose libgcc.a should be built with -fPIC so
that you can include them in shared libraries to avoid this problem.

ie, while libgcc.a is an archive library, its components are suitable
for including in a shared library.



jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]