[ooc-compiler] dynamically linking to libgc
Brought to you by:
mva
|
From: Alan F. <Ala...@gr...> - 2002-02-12 15:00:32
|
Hi, My thanks to Michael van Acken, Tim Tuelings and Stewart Greenhill for their response to my question about intalling the garbage collector so that it is dynamically linked against by the oo2c compiler. Here is what I had to do to get it to work on my machine, for the benifit of others:-) I placed the GC directory at: /usr/local/gc (it no longer is a subdirectory to oo2c) Since I run RedHat Linux (vs. 7.1 & 7.2) I needed to edit the Makefile, which I did as follows: I appended the following compiler flags to CFLAGS -fPIC -DLINUX_THREADS -D_REENTRANT The first flag enables a dynamic library build under linux. The second pair of flags enable the use of linux threads (I have a dual processor machine), see the README.linux file. I then built GC via make test make liblinuxgc.so and copied the following files cp gc.h /usr/local/include/gc.h cp gc.a /usr/local/lib/gc.a cp libgc.so.0 /usr/local/lib/libgc.so.0 where /usr/local/lib is a line entry in my /etc/ld.so.conf file (used by libtool). If this directory (or the directory you copy to) is not in this file, then edit it and run ./sbin/ldconfig to place it in the path. I then created the following symbolic links in the directory /usr/local/lib ln -s gc.a libgc.a ln -s libgc.so.0 libgc.so This completed my installation of GC. After that, I changed to my oo2c directory and ran make distclean and then reran ./configure make all make install To test that the garbage collector is dynamically linked against, execute ldd /usr/local/bin/oo2c and a line like libgc.so.0 => /usr/local/lib/libgc.so.0 (0x40064000) should be present. Hope this is useful, Al -- Alan D. Freed, PhD email: Ala...@gr... Polymers Branch, MS 49-3 Fr...@bm... (tuesdays) NASA Glenn Research Center Al...@oh... (thursdays) Cleveland, Ohio 44135 tel: 216-433-8747 fax: 216-977-7132 |