2015-05-10 14:45 GMT+02:00 Eero Volotinen <[email protected]>: > Hi, > > Looks like findlibrary(gpgme) is not finding libgpg-error > > Andre: could you help bit with this issue? > -- > Eero > > 2015-05-09 21:52 GMT+03:00 Andy Theuninck <[email protected]>: >> >> I get this error at the very end of the build: >> >> [ 90%] Built target ovas-mngr-comm >> Linking C executable openvasmd >> /usr/bin/ld: libmanage.a(lsc_crypt.c.o): undefined reference to symbol >> 'gpg_strerror' >> /usr/bin/ld: note: 'gpg_strerror' is defined in DSO >> /lib64/libgpg-error.so.0 so try adding it to the linker command line >> /lib64/libgpg-error.so.0: could not read symbols: Invalid operation >> collect2: error: ld returned 1 exit status >> make[2]: *** [src/openvasmd] Error 1 >> make[1]: *** [src/CMakeFiles/openvasmd.dir/all] Error 2 >> make: *** [all] Error 2 >> >> Adding "-lgpg-error" to the end of the command in >> src/CMakeFiles/openvasmd.dir/link.txt resolves the problem for me and >> the build finishes correctly. Not sure if this is portable to other >> distros or can be detected and adjusted during the cmake step.
Hi there, the patch attached should solve the problem. I'd appreciate reviews before checking it into svn. Regards -- Henri
commit 412318bc522087c9cf8e837f153f3bdb97f535d0 Author: Henri Doreau <[email protected]> Date: Thu Jun 9 08:09:49 2016 +0200 * CMakeLists.txt: Check for libgpg-error which contains gpg error related symbols. * src/CMakeLists.txt: Link against libgpg-error if present. diff --git a/openvas-manager/CMakeLists.txt b/openvas-manager/CMakeLists.txt index f2956f5..c6ce82a 100644 --- a/openvas-manager/CMakeLists.txt +++ b/openvas-manager/CMakeLists.txt @@ -272,6 +272,19 @@ else (NOT GPGME) OUTPUT_STRIP_TRAILING_WHITESPACE) endif (NOT GPGME) +# libgpg-error required on fedora +message (STATUS "Looking for gpg-error...") +find_library (GPGERROR gpg-error) +if (GPGERROR) + message (STATUS "Looking for gpg-error... ${GPGERROR}") + execute_process (COMMAND gpg-error-config --cflags + OUTPUT_VARIABLE GPGERROR_CFLAGS + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND gpg-error-config --libs + OUTPUT_VARIABLE GPGERROR_LDFLAGS + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif (GPGERROR) + ## Version set (OPENVASMD_VERSION "${PROJECT_VERSION_STRING}") diff --git a/openvas-manager/ChangeLog b/openvas-manager/ChangeLog index 0b94b1a..56672f7 100644 --- a/openvas-manager/ChangeLog +++ b/openvas-manager/ChangeLog @@ -1,3 +1,10 @@ +2016-06-09 Henri Doreau <[email protected]> + + * CMakeLists.txt: Check for libgpg-error which contains gpg error + related symbols. + + * src/CMakeLists.txt: Link against libgpg-error if present. + 2016-06-03 Matthew Mundell <[email protected]> * src/manage.c (slave_setup): Use init_target_iterator_one, because diff --git a/openvas-manager/src/CMakeLists.txt b/openvas-manager/src/CMakeLists.txt index 42dd63b..4c4cfad 100644 --- a/openvas-manager/src/CMakeLists.txt +++ b/openvas-manager/src/CMakeLists.txt @@ -74,7 +74,7 @@ else (BACKEND STREQUAL SQLITE3) endif (BACKEND STREQUAL SQLITE3) add_executable (${BINARY_NAME} openvasmd.c ompd.c) -target_link_libraries (${BINARY_NAME} ovas-mngr-comm omp otp manage ${GNUTLS_LDFLAGS} ${GPGME_LDFLAGS} ${GCRYPT_LDFLAGS} ${CMAKE_THREAD_LIBS_INIT} ${LINKER_HARDENING_FLAGS}) +target_link_libraries (${BINARY_NAME} ovas-mngr-comm omp otp manage ${GNUTLS_LDFLAGS} ${GPGERROR_LDFLAGS} ${GPGME_LDFLAGS} ${GCRYPT_LDFLAGS} ${CMAKE_THREAD_LIBS_INIT} ${LINKER_HARDENING_FLAGS}) set_target_properties (${BINARY_NAME} PROPERTIES LINKER_LANGUAGE C)
_______________________________________________ Openvas-discuss mailing list [email protected] https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss
