From: Neil Channen
Subject: gcl 2.2.2 problems on Solaris (dynamic libraries, etc.)
Date: 
Message-ID: <38484482.4E3C@nortelnetworks.com>
I am having problems with GCL 2.2.2 on Solaris 2.6.  The package
builds fine, but there are a number of problems that I am encountering
while trying to interface C code to Lisp:

1.  I have code that needs to call the getservbyname() function,
    which is in libsocket.  However, o/run_process.c stubs out the
    dlopen() functions, preventing libsocket from being loaded.  For
    legal reasons, I would prefer not to modify the run_process.c
    file (line 319). I also don't want to statically link everything.
    Any way around this?

2.  Even if I do comment this section out, dlopen() is defined in
    libdl.so, which gcc can't seem to find, since there is no libdl.a
file.
    If I build raw_gcl with cc (the Solaris compiler) rather than gcc,
it
    can find libdl. Any way to get this to work with gcc?  I had
problems
    compiling other files in gcl with cc, so right now I compile with
gcc,
    and link with cc!

3.  gcl is using mmap() rather than dlopen() to load in compiled lisp
    files (load "file.o").  I have found that these files can only
    reference symbols in libc that have already been referenced by
    raw_gcl itself.  e.g. raw_gcl does not call fsetpos(), so that
    libc symbol is not put in the raw_gcl binary, even if I statically
    link libc.  When I try to load a .o file (C source that was included
    with (clines "#include <file.c>") and compiled with compile-file),
it
    gives an error if the file references fsetpos.  As a temporary work-
    around, I link raw_gcl with a dummy .c file:
#include <stdio.h>
void dummy () {
    fgetc (NULL);
    rewind (NULL);
    tempnam (NULL, NULL);
    fgetpos (NULL, NULL);
    fsetpos (NULL, NULL);
    getservbyname (NULL, NULL);
}
    which causes these libc routines to be dragged into raw_gcl, meaning
    that any .o file loaded later can now reference them.  As mentioned
    above, I would prefer not to have to modify any GCL files, including
    the makefile, which would seem to be necessary in this case to add a
new
    .o file to the link line.

4.  I am not able to (compile-file) files with debugging enabled.  When
    I set compiler::*speed* to 0, and add ":c-debug t" to
(compile-file), I
    get:
[unknown rel secn 5 type=3]
Error: unknown rel type
    Is there any way I can enable "-g" for compiled files, so I can get
    stack traces from core dumps?

5.  In o/error.c, the function not_a_string(obj) calls
    FEwrong_type_argument(obj,slString), but it appears that
    the arguments are in the wrong order.  FEwrong_type_argument
    wants the expected type first, followed by the actual value
    second, not the other way around.  Is any patch planned?

Many thanks for your answers, ...
-- 
Neil R. Channen
Nortel Networks Corporation
········@nortelnetworks.com