View Issue Details

IDProjectCategoryView StatusLast Update
0001127bareos-coreGeneralpublic2023-07-05 11:24
Reporterrjung Assigned Tobruno-at-bareos  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformSolaris10OSSolarisOS Version10
Product Version18.2.6 
Summary0001127: cmake function check fails due to library dependency
DescriptionActually version is 18.4.1 but that is not yet available in the mantis version dropdown.

Problem is that during cmake run on Solaris 10 Sparc certain functions that does exit are not detected, because they need "-lrt" or "-lsocket -lnsl" during compilation:

fdatasync -lrt
nanosleep -lrt
gethostbyname_r -lnsl
getaddrinfo -lsocket -lnsl
inet_ntop -lsocket -lnsl
inet_pton -lsocket -lnsl
gai_strerror -lsocket -lnsl

As a workaround, the following patch was used:

--- cmake/BareosCheckFunctions.cmake Fri Sep 28 10:30:36 2018
+++ cmake/BareosCheckFunctions.cmake Sun Nov 3 18:06:16 2019
@@ -19,6 +19,10 @@

 INCLUDE (CheckFunctionExists)

+list(APPEND CMAKE_REQUIRED_LIBRARIES rt)
+list(APPEND CMAKE_REQUIRED_LIBRARIES socket)
+list(APPEND CMAKE_REQUIRED_LIBRARIES nsl)
+
 CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL)
 CHECK_FUNCTION_EXISTS(backtrace HAVE_BACKTRACE)
 CHECK_FUNCTION_EXISTS(backtrace_symbols HAVE_BACKTRACE_SYMBOLS)


But that obviously isn't the right solution, because it must be made dependent on platform. Furthermore it adds -lrt -lsocket -lnsl as dependencies to all binaries and libs. That should only happen for those who actually make use of the respective symbols that need the libs.
Steps To ReproduceRun cmake on Solaris 10 and notice, that all of the above function lookups fail with "not found".
Tagscmake compilation

Activities

bruno-at-bareos

bruno-at-bareos

2023-07-05 11:24

manager   ~0005143

Bareos can be build on Solaris 11 (ready to use package bares-fd are available in subscription)

Issue History

Date Modified Username Field Change
2019-11-03 18:47 rjung New Issue
2019-11-03 18:47 rjung Tag Attached: cmake compilation
2023-07-05 11:24 bruno-at-bareos Assigned To => bruno-at-bareos
2023-07-05 11:24 bruno-at-bareos Status new => closed
2023-07-05 11:24 bruno-at-bareos Resolution open => fixed
2023-07-05 11:24 bruno-at-bareos Note Added: 0005143