Menu

#369 carrierroute fails to compile on Solaris 2.8

ver 1.3.x
closed
modules (357)
5
2008-01-15
2008-01-02
Bob Atkins
No

Source code refers to non-existent getopt.h include file.

getopt.h is not found on Solaris 2.8.

gcc -fPIC -DPIC -g -O9 -funroll-loops -Wall -mcpu=ultrasparc -mtune=ultrasparc -ftree-vectorize -m64 -mcpu=ultrasparc -I/opt/include -I/opt/include/mysql -DMOD_NAME='"carrierroute"' -DNAME='"openser"' -DVERSION='"1.3.0-tls"' -DARCH='"sparc64"' -DOS='"solaris"' -DCOMPILER='"gcc 4.1.1"' -D__CPU_sparc64 -D__OS_solaris -D__SMP_no -DCFG_DIR='"/opt/openser-1.3.0-tls/etc/openser/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DSTATISTICS -DCHANGEABLE_DEBUG_LEVEL -DF_MALLOC -DUSE_TLS -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DHAVE_GETIPNODEBYNAME -DHAVE_SYS_SOCKIO_H -DHAVE_SCHED_YIELD -DHAVE_ALLOCA_H -DUSE_SIGACTION -D_POSIX_PTHREAD_SEMANTICS -DHAVE_DEVPOLL -DHAVE_SELECT -I/opt/ssl/include -I/opt/include -I/opt/include -c route_fifo.c -o route_fifo.o
route_fifo.c:45:20: error: getopt.h: No such file or directory
route_fifo.c: In function 'get_fifo_opts':
route_fifo.c:448: warning: implicit declaration of function 'strsep'
route_fifo.c:448: warning: assignment makes pointer from integer without a cast
make[1]: *** [route_fifo.o] Error 1

Discussion

  • Bob Atkins

    Bob Atkins - 2008-01-02

    Logged In: YES
    user_id=655552
    Originator: YES

    getopt.h is available on Solaris 10 so this compilation failure will not occur. However, it turns out that after reviewing the code, the include of getopt.h is unnecessary as no functions or variables defined by getopt.h are referenced.

    Also, code uses non-standard BSD specific 'strsep' function in lieu of ISO standard strtok function. This should be fixed to improve portability.

    Patch has been attached.
    File Added: route_fifo.c.patch

     
  • Bob Atkins

    Bob Atkins - 2008-01-14

    Logged In: YES
    user_id=655552
    Originator: YES

    Even though the carrierroute module compiles - since a runtime linker error occurs when strsep is not found:

    ld.so.1: openser: fatal: relocation error: file /opt/openser-1.3.0-tls/lib64/openser/modules/carrierroute.so:symbol strsep: referenced symbol not found

    So, I have posted another patch to route_fifo.c that includes a replacement for the strsep function when building on Solaris.

    File Added: route_fifo.c.patch

     
  • Bob Atkins

    Bob Atkins - 2008-01-14

    Revised patch that includes strsep function for Solaris

     
  • Henning Westerholt

    Logged In: YES
    user_id=337916
    Originator: NO

    Applied to trunk, will be backported too.

    Thanks and regards,

    Henning

     
  • Henning Westerholt

    • assigned_to: nobody --> henningw
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB