Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on Ubuntu 12 #6

Open
lgrahl opened this issue Mar 18, 2017 · 6 comments
Open

Build error on Ubuntu 12 #6

lgrahl opened this issue Mar 18, 2017 · 6 comments

Comments

@lgrahl
Copy link

lgrahl commented Mar 18, 2017

I have trouble building usrsctp-neat on Ubuntu 12 on Travis CI. This is the output:

CFLAGS=-fPIC cmake -DCMAKE_INSTALL_PREFIX=/home/travis/build/rawrtc/rawrtc/build/prefix -DSCTP_DEBUG=1 ..
make install -j12
Scanning dependencies of target usrsctp-static
Scanning dependencies of target usrsctp
[ 2%] [ 2%] [ 4%] [ 5%] [ 7%] Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet6/sctp6_usrreq.c.o
[ 8%] [ 10%] Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_callout.c.o
[ 11%] [ 13%] Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_input.c.o
[ 16%] [ 16%] [ 17%] Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet6/sctp6_usrreq.c.o
Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_sha1.c.o
Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_userspace.c.o
Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_input.c.o
Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_callout.c.o
Building C object usrsctplib/CMakeFiles/usrsctp.dir/user_mbuf.c.o
Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_sha1.c.o
Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_userspace.c.o
Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_asconf.c.o
[ 19%] Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/user_mbuf.c.o
[ 20%] Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_cc_functions.c.o
[ 22%] [ 23%] Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_asconf.c.o
[ 25%] Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_cc_functions.c.o
[ 26%] Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_output.c.o
Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_output.c.o
[ 28%] Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_ss_functions.c.o
[ 29%] Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_usrreq.c.o
[ 31%] [ 32%] Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/user_recv_thread.c.o
Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_auth.c.o
[ 34%] Building C object usrsctplib/CMakeFiles/usrsctp-static.dir/netinet/sctp_crc32.c.o
/home/travis/build/rawrtc/rawrtc/build/dependencies/usrsctp/usrsctplib/user_recv_thread.c: In function ‘recv_icmp’:
/home/travis/build/rawrtc/rawrtc/build/dependencies/usrsctp/usrsctplib/user_recv_thread.c:408:29: error: ‘struct udphdr’ has no member named ‘uh_sport’
/home/travis/build/rawrtc/rawrtc/build/dependencies/usrsctp/usrsctplib/user_recv_thread.c: In function ‘recv_icmp6’:
/home/travis/build/rawrtc/rawrtc/build/dependencies/usrsctp/usrsctplib/user_recv_thread.c:845:29: error: ‘struct udphdr’ has no member named ‘uh_sport’
make[2]: *** [usrsctplib/CMakeFiles/usrsctp-static.dir/user_recv_thread.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 35%] Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_ss_functions.c.o
[ 37%] Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_usrreq.c.o
[ 38%] Building C object usrsctplib/CMakeFiles/usrsctp.dir/user_recv_thread.c.o
[ 40%] Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_auth.c.o
[ 41%] Building C object usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_crc32.c.o
/home/travis/build/rawrtc/rawrtc/build/dependencies/usrsctp/usrsctplib/user_recv_thread.c: In function ‘recv_icmp’:
/home/travis/build/rawrtc/rawrtc/build/dependencies/usrsctp/usrsctplib/user_recv_thread.c:408:29: error: ‘struct udphdr’ has no member named ‘uh_sport’
/home/travis/build/rawrtc/rawrtc/build/dependencies/usrsctp/usrsctplib/user_recv_thread.c: In function ‘recv_icmp6’:
/home/travis/build/rawrtc/rawrtc/build/dependencies/usrsctp/usrsctplib/user_recv_thread.c:845:29: error: ‘struct udphdr’ has no member named ‘uh_sport’
make[2]: *** [usrsctplib/CMakeFiles/usrsctp.dir/user_recv_thread.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [usrsctplib/CMakeFiles/usrsctp-static.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [usrsctplib/CMakeFiles/usrsctp.dir/all] Error 2
make: *** [all] Error 2

You can find the full log here which also includes precise information about the build system.

@lgrahl
Copy link
Author

lgrahl commented Mar 18, 2017

The other Travis CI environment (using clang) also fails with no member named 'uh_dport' in 'struct udphdr'. See the full log here.

@tuexen
Copy link
Collaborator

tuexen commented Mar 19, 2017

There is no problem when using a more recent version of Ubuntu. On Buntu 16.10 you find in /usr/include/netinet/udp.h:

struct udphdr
{
  __extension__ union
  {
    struct
    {
      u_int16_t uh_sport;               /* source port */
      u_int16_t uh_dport;               /* destination port */
      u_int16_t uh_ulen;                /* udp length */
      u_int16_t uh_sum;         /* udp checksum */
    };
    struct
    {
      u_int16_t source;
      u_int16_t dest;
      u_int16_t len;
      u_int16_t check;
    };
  };
};

Can you post the corresponding definition from your system including all relevant #ifdefs around that? Possibly, an additional compile flag can resolve your issue.

@lgrahl
Copy link
Author

lgrahl commented Mar 21, 2017

It looks like this in Ubuntu 12.04:

/* UDP header as specified by RFC 768, August 1980. */
#ifdef __FAVOR_BSD

struct udphdr
{
  u_int16_t uh_sport;           /* source port */
  u_int16_t uh_dport;           /* destination port */
  u_int16_t uh_ulen;            /* udp length */
  u_int16_t uh_sum;             /* udp checksum */
};

#else

struct udphdr
{
  u_int16_t source;
  u_int16_t dest;
  u_int16_t len;
  u_int16_t check;
};
#endif

So, it seems that if you define __FAVOR_BSD it should be fine?

@lgrahl
Copy link
Author

lgrahl commented Mar 21, 2017

It was already set in sctp_output.c but not in sctputil.c and user_recv_thread.c. I fixed it in the usrsctp-neat fork for rawrtc - you can cherry-pick the commit from there. Made a PR for it in #7.

@tuexen
Copy link
Collaborator

tuexen commented Mar 21, 2017

Would it make sense to define this in the CFLAGS variable in the build environment? I guess that might be better?

@lgrahl
Copy link
Author

lgrahl commented Mar 21, 2017

Sure, that might be a better way to prevent further build errors in case other files start using the BSD style struct. Feel free to close my PR. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants