sionescu / iolib

Common Lisp I/O library
http://common-lisp.net/project/iolib/
MIT License
141 stars 31 forks source link

compile error on CentOS 5.8 Final 64bit #35

Closed muyinliu closed 8 years ago

muyinliu commented 8 years ago

Here is the output from SBCL:

[package iolib/sockets].; g++ -m64 -Wno-write-strings -I/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/grovel/ -o /root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel /root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c

debugger invoked on a UIOP/RUN-PROGRAM:SUBPROCESS-ERROR in thread #<THREAD "main thread" RUNNING {1002A9C5A3}>: Subprocess (:PROCESS #<SB-IMPL::PROCESS :EXITED 1> :OUTPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 7" {10035A8363}>)
 with command ("g++" "-m64" "-Wno-write-strings" "-I/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/grovel/" "-o" "/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel" "/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c")
 exited with error code 1

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE                     ] IGNORE-ERROR-STATUS
  1: [RETRY                        ] Retry PROCESS-OP on #<GROVEL-FILE "iolib/sockets" "grovel">.
  2: [ACCEPT                       ] Continue, treating PROCESS-OP on #<GROVEL-FILE "iolib/sockets" "grovel"> as having been successful.
  3:                                 Retry ASDF operation.
  4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
  5: [ABORT                        ] Give up on "iolib"
  6:                                 Exit debugger, returning to top level.

(UIOP/RUN-PROGRAM::%CHECK-RESULT 1 :COMMAND ("g++" "-m64" "-Wno-write-strings" "-I/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/grovel/" "-o" "/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel" "/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c") :PROCESS (:PROCESS #<SB-IMPL::PROCESS :EXITED 1> :OUTPUT-STREAM #<SB-SYS:FD-STREAM for "descriptor 7" {10035A8363}>) :IGNORE-ERROR-STATUS NIL)
0]

execute "g++" "-m64" "-Wno-write-strings" "-I/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/grovel/" "-o" "/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel" "/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c" in shell get something like:

/usr/include/linux/errqueue.h:6: error: ‘__u32’ does not name a type
/usr/include/linux/errqueue.h:7: error: ‘__u8’ does not name a type
/usr/include/linux/errqueue.h:8: error: ‘__u8’ does not name a type
/usr/include/linux/errqueue.h:9: error: ‘__u8’ does not name a type
/usr/include/linux/errqueue.h:10: error: ‘__u8’ does not name a type
/usr/include/linux/errqueue.h:11: error: ‘__u32’ does not name a type
/usr/include/linux/errqueue.h:12: error: ‘__u32’ does not name a type
/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c: In function ‘int main(int, char**)’:
/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c:557: error: ‘SO_EE_ORIGIN_TIMESTAMPING’ was not declared in this scope
/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c:562: error: ‘struct sock_extended_err’ has no member named ‘ee_errno’
/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c:563: error: ‘struct sock_extended_err’ has no member named ‘ee_origin’
/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c:564: error: ‘struct sock_extended_err’ has no member named ‘ee_type’
/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c:565: error: ‘struct sock_extended_err’ has no member named ‘ee_code’
/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c:566: error: ‘struct sock_extended_err’ has no member named ‘ee_info’
/root/.cache/common-lisp/sbcl-1.3.1-linux-x64/root/quicklisp/dists/quicklisp/software/iolib-20151218-git/src/sockets/grovel.c:567: error: ‘struct sock_extended_err’ has no member named ‘ee_data’

Note: I have libfixposix installed.

sionescu commented 8 years ago

It might be that on your libc libfixposix needs some additional header in order to see that definition. If struct sock_extended_err is not defined at all because the kernel/libc combo on Centos 5.8 is too old you can comment out that struct locally and keep is as a patch, but I won't change it until I find a way to detect system features at compile time.

muyinliu commented 8 years ago

Good news! After I copy the file /usr/include/linux/errqueue.h from CentOS 6.7 Final 64bit to CentOS 5.8 Final 64bit, compile success!

Here is the content of file /usr/incldue/linux/errqueue.h from CentOS 5.8 Final 64bit:

#ifndef _LINUX_ERRQUEUE_H
#define _LINUX_ERRQUEUE_H 1

struct sock_extended_err
{
    __u32   ee_errno;
    __u8    ee_origin;
    __u8    ee_type;
    __u8    ee_code;
    __u8    ee_pad;
    __u32   ee_info;
    __u32   ee_data;
};

#define SO_EE_ORIGIN_NONE   0
#define SO_EE_ORIGIN_LOCAL  1
#define SO_EE_ORIGIN_ICMP   2
#define SO_EE_ORIGIN_ICMP6  3

#define SO_EE_OFFENDER(ee)  ((struct sockaddr*)((ee)+1))

#endif

So struct sock_extended_err is defined.

Here is the content of file /usr/incldue/linux/errqueue.h from CentOS 6.7 Final 64bit:

#ifndef _LINUX_ERRQUEUE_H
#define _LINUX_ERRQUEUE_H 1

#include <linux/types.h>

struct sock_extended_err
{
        __u32   ee_errno;
        __u8    ee_origin;
        __u8    ee_type;
        __u8    ee_code;
        __u8    ee_pad;
        __u32   ee_info;
        __u32   ee_data;
};

#define SO_EE_ORIGIN_NONE       0
#define SO_EE_ORIGIN_LOCAL      1
#define SO_EE_ORIGIN_ICMP       2
#define SO_EE_ORIGIN_ICMP6      3
#define SO_EE_ORIGIN_TIMESTAMPING 4

#define SO_EE_OFFENDER(ee)      ((struct sockaddr*)((ee)+1))

#endif

The only different is that 5.8 version miss two lines:

#include <linux/types.h>
#define SO_EE_ORIGIN_TIMESTAMPING 4

Now I'm testing clonsigna(who's using IOLib's socket part).

muyinliu commented 8 years ago

Seems clonsigna works fine. So IOLib works fine on CentOS 5.8 Final 64bit now.