View Issue Details

IDProjectCategoryView StatusLast Update
0001127bareos-coreGeneralpublic2019-11-03 18:47
Reporterrjung Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
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
bareos-master: impact
bareos-master: action
bareos-19.2: impact
bareos-19.2: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action

Activities

There are no notes attached to this issue.

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