Compile bareos on omnios

36 views
Skip to first unread message

jub.be...@gmail.com

unread,
Sep 11, 2023, 4:51:01 PM9/11/23
to bareos-devel
once more i try to build the newest bareos for omnios, kind of a solaris/illumos  distribution.

I know, i should learn to read and understand the code...

I start cmake and get this error, that addr_list is not declared:

(...)

[  4%] Building CXX object core/src/lib/CMakeFiles/bareos.dir/bget_msg.cc.o

[  4%] Building CXX object core/src/lib/CMakeFiles/bareos.dir/binflate.cc.o

[  4%] Building CXX object core/src/lib/CMakeFiles/bareos.dir/bnet_server_tcp.cc.o

[  5%] Building CXX object core/src/lib/CMakeFiles/bareos.dir/bnet.cc.o

/home/jub/bareos22/core/src/lib/bnet.cc:333:62: error: missing template argument list after 'dlist'; template placeholder not permitted in parameter

  333 | static const char* resolv_host(int family, const char* host, dlist* addr_list)

      |                                                              ^~~~~

      |                                                                   <>

In file included from /home/jub/bareos22/core/src/lib/lib.h:48,

                 from /home/jub/bareos22/core/src/include/bareos.h:191,

                 from /home/jub/bareos22/core/src/lib/bnet.cc:36:

/home/jub/bareos22/core/src/lib/guid_to_name.h:31:29: note: 'template<class T> class dlist' declared here

   31 | template <typename T> class dlist;

      |                             ^~~~~

/home/jub/bareos22/core/src/lib/bnet.cc: In function 'const char* resolv_host(...)':

/home/jub/bareos22/core/src/lib/bnet.cc:366:7: error: 'addr_list' was not declared in this scope

  366 |       addr_list->append(addr);

      |       ^~~~~~~~~

/home/jub/bareos22/core/src/lib/bnet.cc:333:36: error: unused parameter 'family' [-Werror=unused-parameter]

  333 | static const char* resolv_host(int family, const char* host, dlist* addr_list)

      |                                ~~~~^~~~~~

cc1plus: all warnings being treated as errors

*** Error code 1

The following command caused the error:

cd /home/jub/bareos22/build/core/src/lib && ccache /usr/bin/g++ -D_FILE_OFFSET_BITS=64 -Dbareos_EXPORTS -I/home/jub/bareos22/core/src -I/usr/ssl-3/include -I/home/jub/bareos22/core/src/fastlz/include -I/home/jub/bareos22/third-party/CLI11/include -I/home/jub/bareos22/third-party/xxHash -isystem /opt/ooce/include -Wsuggest-override -fdebug-prefix-map=/home/jub/bareos22/core=. -fmacro-prefix-map=/home/jub/bareos22/core=. -Wno-invalid-offsetof -Werror -Wall -Wextra -std=gnu++17 -fPIC -MD -MT core/src/lib/CMakeFiles/bareos.dir/bnet.cc.o -MF CMakeFiles/bareos.dir/bnet.cc.o.d -o CMakeFiles/bareos.dir/bnet.cc.o -c /home/jub/bareos22/core/src/lib/bnet.cc

make: Fatal error: Command failed for target `core/src/lib/CMakeFiles/bareos.dir/bnet.cc.o'

Current working directory /home/jub/bareos22/build

*** Error code 1

The following command caused the error:

make -s -f core/src/lib/CMakeFiles/bareos.dir/build.make core/src/lib/CMakeFiles/bareos.dir/build

make: Fatal error: Command failed for target `core/src/lib/CMakeFiles/bareos.dir/all'

Current working directory /home/jub/bareos22/build

*** Error code 1

The following command caused the error:

make -s -f CMakeFiles/Makefile2 all

make: Fatal error: Command failed for target `all'

Andreas Rogge

unread,
Sep 12, 2023, 3:13:04 AM9/12/23
to bareos...@googlegroups.com
Am 11.09.23 um 22:51 schrieb jub.be...@gmail.com:
> I know, i should learn to read and understand the code...
>
> I start cmake and get this error, that addr_list is not declared:
>
> (...)
It looks like for some reason on your system HAVE_GETADDRINFO is false,
thus it tries to compile the (unmaintained) fallback variant of
resolv_host().
As Solaris 11.4 does have getaddrinfo() and the function is also
required by modern POSIX standards, I guess CMake simply misdetected
this or you're missing a library header.

Basically, you'll have to convince CMake that you have getaddrinfo() and
that it should set HAVE_GETADDRINFO true.

Hope that points you in the right direction.

Best Regards,
Andreas

--
Andreas Rogge andrea...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221-630693-86
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: Stephan Dühr, Jörg Steffens, Philipp Storz
OpenPGP_0x00314758866BD59E.asc
OpenPGP_signature

jub.be...@gmail.com

unread,
Sep 13, 2023, 4:10:59 PM9/13/23
to bareos-devel
Hello Andreas, thanks for your comment - it led to a comment and solution:

env LDFLAGS="-lsocket -lnsl" cmake ...

Our getaddrinfo() is in libsocket, so it needs a bit of extra help to find it.
(You'll also need to remove -Werror from CMAKE_C_FLAGS and CMAKE_CXX_FLAGS
in core/CMakeLists.txt before running cmake.)


Reply all
Reply to author
Forward
0 new messages