#405 [AIX 5.3] Problem finding connect and libsigsegv

build problems
closed-fixed
clisp (525)
5
2007-03-08
2007-02-23
No

When building clisp on AIX 5.3, ./configure reports that it can't find connect() on the system.

The function is defined in /usr/include/sys/socket.h.
The complete prototype is:
int connect(int, const struct sockaddr *, socklen_t);

As Sam asked by e-mail, the definition of socklen_t also lies in the same file:
/usr/include/sys/socket.h:typedef __ulong32_t socklen_t;

---
Another problem encountered by the configure script, is that it could not find libsigsegv. At least, that's what it tells me at the end (see below). I have just successfully installed libsigsegv-2.4 in /usr/local. The config.log is attached (zipped because it was > 250k).

Configure findings:
FFI: yes (user requested: default)
readline: (user requested: )
libsigsegv:
./configure: libsigsegv was not detected, thus some features, such as
generational garbage collection and
stack overflow detection in interpreted Lisp code
cannot be provided.
Please do this:
mkdir tools; cd tools; prefix=`pwd`/powerpc-ibm-aix5.3.0.0
wget http://ftp.gnu.org/pub/gnu/libsigsegv/libsigsegv-2.4.tar.gz
tar xfz libsigsegv-2.4.tar.gz
cd libsigsegv-2.4
./configure --prefix=${prefix} && make && make check && make install
cd ../..
./configure --with-libsigsegv-prefix=${prefix}
If you insist on building without libsigsegv, please pass
--ignore-absence-of-libsigsegv
to this script:
./configure --ignore-absence-of-libsigsegv

Discussion

  • Sam Steingold

    Sam Steingold - 2007-02-23

    Logged In: YES
    user_id=5735
    Originator: NO

    could you please also attach config.cache?
    thanks.

     
  • Sam Steingold

    Sam Steingold - 2007-02-23

    Logged In: YES
    user_id=5735
    Originator: NO

    the connect problems:

    /usr/include/sys/socket.h:374: error: syntax error before 'socklen_t'
    /usr/include/sys/socket.h:378: error: syntax error before 'msg_controllen'
    /usr/include/sys/socket.h:380: error: syntax error before '}' token
    /usr/include/sys/socket.h:404: error: syntax error before 'socklen_t'
    /usr/include/sys/socket.h:408: error: syntax error before '}' token
    ...

    this means that before including sys/socket.h, something else must be included.
    we do this:

    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/socket.h>

    how does your system documentation prescribe including of <sys/socket.h>?

     
  • Sam Steingold

    Sam Steingold - 2007-02-23

    Logged In: YES
    user_id=5735
    Originator: NO

    why does you config.log have DOS line endings?

    note that it says "cl_cv_lib_sigsegv=yes", so sigsegv is successfully detected.
    apparently config.cache cannot be sourced in the top-level configure
    (I think there was an error right before the "Configure findings:" message).
    this may be caused by different shell flavors.
    do you have bash installed?
    is it used by configure?

     
  • Laurent Vaucher

    Laurent Vaucher - 2007-02-25

    Logged In: YES
    user_id=1055817
    Originator: YES

    Regarding DOS EOL in the file, I guess it's only the ftp transfer between AIX and my Windows PC that must have chosen ASCII-mode.

    Bash is definitely installed on the system. I use it as my main shell. But it is not installed as /bin/sh. Is there a way I can cell whether configure uses it?

    (Rest of answers tomorrow, when I'm back at work with an AIX machine available).

     
  • Sam Steingold

    Sam Steingold - 2007-02-25

    Logged In: YES
    user_id=5735
    Originator: NO

    try this:
    $ /bin/sh
    $ . config.cache
    this should generate some errors.

    all configure scripts must use the same shell flavor.
    look at config.status rerun line to see which shell is being used there.
    check your $CONFIG_SHELL

    may be the easiest way out is
    CONFIG_SHELL=/bin/bash; export CONFIG_SHELL
    SHELL=/bin/bash; export SHELL
    ${SHELL} ./configure --build build-dir

     
  • Laurent Vaucher

    Laurent Vaucher - 2007-02-26

    Logged In: YES
    user_id=1055817
    Originator: YES

    Sorry about the delay, but our AIX platform apparently passed away during the week-end.
    I'll try your suggestions as soon as we've got it resurrected or something.

     
  • Laurent Vaucher

    Laurent Vaucher - 2007-03-06

    Logged In: YES
    user_id=1055817
    Originator: YES

    I tried a simple program only doing the includes and it compiles perfectly. Maybe there's a problem with a #DEFINE or maybe there are other includes conflicting with this one.

    Here's an excerpt from <sys/socket.h>.

    /*
    * Message header for recvmsg and sendmsg calls.
    * Used value-result for recvmsg, value only for sendmsg.
    */
    #if defined(COMPAT_43) && !defined(_KERNEL)
    struct msghdr {
    caddr_t msg_name; /* optional address */
    int msg_namelen; /* size of address */
    struct iovec *msg_iov; /* scatter/gather array */
    int msg_iovlen; /* # elements in msg_iov */
    caddr_t msg_accrights; /* access rights sent/received */
    int msg_accrightslen;
    };
    #else
    struct msghdr {
    void *msg_name; /* optional address */
    socklen_t msg_namelen; /* size of address */ <<<<<<<< This is line 374***
    struct iovec *msg_iov; /* scatter/gather array */
    int msg_iovlen; /* # elements in msg_iov */
    void *msg_control; /* ancillary data, see below */
    socklen_t msg_controllen; /* ancillary data buffer len */
    int msg_flags; /* flags on received message */
    };

    socklen_t is defined in this same socket.h

    /*
    * socklen_t also has a similar definition in netinet/in.h
    * If we need to change this typedef, it must be changed
    * in netinet/in.h also
    */
    #ifndef SOCKLEN_T
    #define SOCKLEN_T
    typedef __ulong32_t socklen_t;
    #endif

    It is indeed defined similarly in netinet/in.h.

    Regarding the configure error :
    . config.cache in pure sh does not generate any error.

    Your suggestion with CONFIG_SHELL and SHELL, the script stops on the connect() error and does not get to the point where it would look for libsigsegv.

     
  • Sam Steingold

    Sam Steingold - 2007-03-06

    Logged In: YES
    user_id=5735
    Originator: NO

    config.log contains the full text of the failed conftest.c program.
    it looks like you will have to extract it from there and try to compile it by hand and see why it fails.

     
  • Laurent Vaucher

    Laurent Vaucher - 2007-03-07

    Logged In: YES
    user_id=1055817
    Originator: YES

    I think I found the problem with connect. I don't know if it's CLISP-specific or relative to autoconf/make.
    In the generated conftest.c, there is a

    #define SOCKLEN_T socklen_t

    In fact, the same symbol SOCKLEN_T is used internally by AIX's socket.h to detect if has already been defined previously (from netinet/in.h).

    /*
    * socklen_t also has a similar definition in netinet/in.h
    * If we need to change this typedef, it must be changed
    * in netinet/in.h also
    */
    #ifndef SOCKLEN_T
    #define SOCKLEN_T
    typedef __ulong32_t socklen_t;
    #endif

    So when including socket.h, it thinks socklen_t is already defined and fails miserably on the first use.

    The solution would be to use another symbol from SOCKLEN_T in the configuration process to avoid conflict.

     
  • Laurent Vaucher

    Laurent Vaucher - 2007-03-07

    Logged In: YES
    user_id=1055817
    Originator: YES

    Renaming the symbol SOCKLEN_T to something else (STRUCT_SOCKLEN_T in my case) throughout the code seems to work.
    I did, in the top clisp-2.41 directory:
    for f in `find . -exec fgrep -l SOCKLEN_T {} \;`; do
    sed 's/SOCKLEN_T/STRUCT_SOCKLEN_T/g' $f > tmpfile
    mv tmpfile $f
    done

    After that, /bin/sh configure --build build-dir worked almost perfectly (and found libsigsegv by the way).
    It found errors though, in ffi and socket. Do you want me to report them here, or maybe in a separate bug report?

    Thanks for your directions.
    I'll be glad to test a patched version whenever you release one.

     
  • Sam Steingold

    Sam Steingold - 2007-03-07

    Logged In: YES
    user_id=5735
    Originator: NO

    please open a new bug report for other bugs

     
  • Sam Steingold

    Sam Steingold - 2007-03-08

    Logged In: YES
    user_id=5735
    Originator: NO

    thank you for your bug report.
    the bug has been fixed in the CVS tree.
    you can either wait for the next release (recommended)
    or check out the current CVS tree (see http://clisp.cons.org\)
    and build CLISP from the sources (be advised that between
    releases the CVS tree is very unstable and may not even build
    on your platform).

     
  • Sam Steingold

    Sam Steingold - 2007-03-08
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks