Subject: RE: C++ compiler wackyness. - hack
To: None <port-pmax@netbsd.org>
From: mjbedy <mjbedy@Oakland.edu>
List: port-pmax
Date: 08/12/1998 22:44:12
Ok, here's my hack to get c++ to work (your gonna love it).
First, though, I have to say that this could screw something up - I
don't know if it will mess things up if you're linking a shared library or
not. (if someone could try it and let me know, I'd appreciate it.)
Now for the hack:
1) create a file, fix.C, that contains nothing but the fix:
/*
* Workaround an ld shared library bug: define these dummy entries to
* satisify __do_global_ctors() instead of the entries in libg++.so.
*/
int *__CTOR_LIST__[] = {0};
int *__DTOR_LIST__[] = {0,0};
2) compile it like so:
c++ -c fix.C
3) this will create fix.o copy it to usr/bin
cp fix.o /usr/bin
4) now cd into /usr/bin
cd /usr/bin
5) move ld to ld.exe
mv ld ld.exe
6) create a new ld script:
#! /bin/csh -f
/usr/bin/ld.exe /usr/bin/fix.o $*
7) chmod a+r+x ld
When it breaks something, let me know. (It works for simple programs,
and doesn't seem to adversly effect gcc, but it certainy doesn't mean it
won't break something else.)
- Mike