Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2549 Port qpid to FreeBSD
  3. QPID-1811

Unable to compile qpid on FreeBSD

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.6
    • 0.7
    • C++ Broker
    • None

    Description

      I'm trying to build qpid c++ broker on FreeBSD.
      Problems found during the build process:
      --------------------------------------------------------------------8<--------------------------------------------------------------------
      g++ -DHAVE_CONFIG_H -I. -Igen -I./gen -I/usr/local/include -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -Woverloaded-virtual -g -O2 -MT qpid/sys/posix/Thread.lo -MD -MP -MF qpid/sys/posix/.deps/Thread.Tpo -c qpid/sys/posix/Thread.cpp -fPIC -DPIC -o qpid/sys/posix/.libs/Thread.o
      qpid/sys/posix/Thread.cpp: In member function 'long unsigned int qpid::sys::Thread::id()':
      qpid/sys/posix/Thread.cpp:64: error: invalid conversion from 'pthread*' to 'long unsigned int'

      I don't know whether it helps during the run, but allows to compile:
      return (unsigned long)impl->thread;
      --------------------------------------------------------------------8<--------------------------------------------------------------------
      g++ -DHAVE_CONFIG_H -I. -Igen -I./gen -I/usr/local/include -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -Woverloaded-virtual -g -O2 -MT qpid/sys/posix/SystemInfo.lo -MD -MP -MF qpid/sys/posix/.deps/SystemInfo.Tpo -c qpid/sys/posix/SystemInfo.cpp -fPIC -DPIC -o qpid/sys/posix/.libs/SystemInfo.o
      In file included from qpid/sys/posix/SystemInfo.cpp:25:
      /usr/include/net/if.h:293: error: field 'ifru_addr' has incomplete type
      /usr/include/net/if.h:294: error: field 'ifru_dstaddr' has incomplete type
      /usr/include/net/if.h:295: error: field 'ifru_broadaddr' has incomplete type
      /usr/include/net/if.h:327: error: field 'ifra_addr' has incomplete type
      /usr/include/net/if.h:328: error: field 'ifra_broadaddr' has incomplete type
      /usr/include/net/if.h:329: error: field 'ifra_mask' has incomplete type
      /usr/include/net/if.h:427: error: field 'addr' has incomplete type
      /usr/include/net/if.h:428: error: field 'dstaddr' has incomplete type
      qpid/sys/posix/SystemInfo.cpp: In function 'void qpid::sys::SystemInfo::getLocalIpAddresses(uint16_t, std::vector<qpid::Address, std::allocator<qpid::Address> >&)':
      qpid/sys/posix/SystemInfo.cpp:63: error: 'PF_INET' was not declared in this scope
      qpid/sys/posix/SystemInfo.cpp:63: error: 'SOCK_STREAM' was not declared in this scope
      qpid/sys/posix/SystemInfo.cpp:63: error: 'socket' was not declared in this scope
      qpid/sys/posix/SystemInfo.cpp:66: error: 'struct ifreq' has no member named 'ifr_ifindex'
      qpid/sys/posix/SystemInfo.cpp:67: error: 'SIOCGIFNAME' was not declared in this scope
      qpid/sys/posix/SystemInfo.cpp:72: error: 'union ifreq::<anonymous>' has no member named 'ifru_addr'
      qpid/sys/posix/SystemInfo.cpp:73: error: invalid use of incomplete type 'struct qpid::sys::sockaddr_in'
      qpid/sys/posix/SystemInfo.cpp:72: error: forward declaration of 'struct qpid::sys::sockaddr_in'

      The "incomplete type" error can be fixed by including sys/socket.h before net/if.h.
      The "'struct ifreq' has no member named 'ifr_ifindex'" can be fixed by:
      #ifdef _FreeBSD_
      ifr.ifr_index = i;
      #else
      ifr.ifr_ifindex = i;
      #endif

      The "'SIOCGIFNAME' was not declared in this scope" is hopefully solved by:
      #ifdef SIOCGIFNAME
      if (::ioctl (s, SIOCGIFNAME, &ifr) < 0)
      #else
      if (!if_indextoname(ifr.ifr_index, ifr.ifr_name))
      #endif
      break;

      The "forward declaration of 'struct qpid::sys::sockaddr_in'" can be solved by including net/pfvar.h after if.h
      --------------------------------------------------------------------8<--------------------------------------------------------------------
      g++ Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -Woverloaded-virtual -DMODULE_DIR=\"/usr/local/lib/qpid/daemon\" -DCONF_FILE=\"/usr/local/etc/qpidd.conf\" -g -O2 -o .libs/qpidd qpidd-qpidd.o posix/qpidd-QpiddBroker.o -L/usr/local/lib -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync ./.libs/libqpidbroker.so /test/qpid/qpid/cpp/src/.libs/libqpidcommon.so ./.libs/libqpidcommon.so -lboost_program_options -lboost_filesystem -luuid -Wl,-rpath -Wl,/usr/local/lib
      /test/qpid/qpid/cpp/src/.libs/libqpidcommon.so: undefined reference to `qpid::sys::Poller::interrupt(qpid::sys::PollerHandle&)'
      /test/qpid/qpid/cpp/src/.libs/libqpidcommon.so: undefined reference to `typeinfo for qpid::sys::PollerHandle'
      ./.libs/libqpidbroker.so: undefined reference to `qpid::sys::Poller::shutdown()'
      /test/qpid/qpid/cpp/src/.libs/libqpidcommon.so: undefined reference to `qpid::sys::PollerHandle::~PollerHandle()'
      ./.libs/libqpidbroker.so: undefined reference to `qpid::sys::Poller::Poller()'
      /test/qpid/qpid/cpp/src/.libs/libqpidcommon.so: undefined reference to `qpid::sys::Poller::addFd(qpid::sys::PollerHandle&, qpid::sys::Poller::Direction)'
      /test/qpid/qpid/cpp/src/.libs/libqpidcommon.so: undefined reference to `qpid::sys::Poller::delFd(qpid::sys::PollerHandle&)'
      /test/qpid/qpid/cpp/src/.libs/libqpidcommon.so: undefined reference to `qpid::sys::PollerHandle::PollerHandle(qpid::sys::IOHandle const&)'
      /test/qpid/qpid/cpp/src/.libs/libqpidcommon.so: undefined reference to `qpid::sys::Poller::modFd(qpid::sys::PollerHandle&, qpid::sys::Poller::Direction)'

      This will be harder.
      I think it would be nice to have at least a standard select/poll interface. Going straight with (and only with) the specialised OS-dependent interfaces seem to be a bad idea for the poor people, not running Linux (or Solaris, or Windows, if they work correctly).
      BTW, shouldn't using libevent or libev would be more logical?

      Attachments

        1. sasl.diff
          1 kB
          Andrey Kotrekhov
        2. qpidfbsdcompile.diff
          1 kB
          Attila Nagy
        3. freebsd.patch
          4 kB
          Andrey Kotrekhov

        Issue Links

          Activity

            People

              astitcher Andrew Stitcher
              bra@fsn.hu Attila Nagy
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: