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: Build fail on hppa-1.1-hpux-10.20


Actually I have both HP's patch and gnu's sed installed so it's not a sed
problem.  I think what jeff said in the first email is probably correctly.
Cause I had no problems with the 1205 and egcs-1.0 snapshots.
My other concern was I could never seem to make gcc or egcs make a shared
library with static template members.  It would always crash whenever I
try to access that static template member.  This is specific to hp
platform.  For example, if I have a
static list like:
test1.h
#include <list>
#include <iterator>
class Test {
   public:
      Test();
   private:
      static list <int> listBug;
};

test1.C
#include <iostream>
#include "test1.h"

list <int> listBug;
Test::Test() {
   cout << listBug.size() << endl; // crash occurs right here
}

Now I put this into a shared library:
gcc -c -fPIC test1.C
ld -b -o libtest.sl test1.o
mv libtest.sl /usr/lib

now the driver 
driver.c
#include "test1.h"

int main() {
   Test a; // calls the constructor and crashes
}
gcc -o shl_test driver.c -ltest
Whenever u run this program it will core dump.  However if I make an .a
file and compile it.
Currently, it won't work even compile on last snapshot(1205) because of
template
bugs This is what happens:
/usr/lib/dld.sl: Unresolved symbol:
_t24__default_alloc_template2b0i0$start_free (data)  from ./libtest.sl
/usr/lib/dld.sl: Unresolved symbol:
_t24__default_alloc_template2b0i0$free_list (data)  from ./libtest.sl
/usr/lib/dld.sl: Unresolved symbol:
_t24__default_alloc_template2b0i0$end_free (data)  from ./libtest.sl
/usr/lib/dld.sl: Unresolved symbol:
_t24__default_alloc_template2b0i0$heap_size (data)  from ./libtest.sl
/usr/lib/dld.sl: Unresolved symbol:
_t23__malloc_alloc_template1i0$__malloc_alloc_oom_handler (data)  from
./li
btest.sl
/usr/lib/dld.sl: Unresolved symbol: _4Test$listBug (data)  from
./libtest.sl
/usr/lib/dld.sl: Unresolved symbol: cout (data)  from ./libtest.sl
/usr/lib/dld.sl: Unresolved symbol: cerr (data)  from ./libtest.sl
/usr/lib/dld.sl: Unresolved module for symbol: __4Test (code)  from
./driver


I read the g++ faq several times and it seems to imply that this problem
is caused by the compiler not calling the shared library initlizer and it
had some way around this but I am don't seem to follow how to do it.
I am using gas.  Is this a bug or limitation of not having gld on hpux?

Thanks




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