Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
don't require libraries that aren't needed
krb5-config (used by FindGSSAPI) returns `-lkrb5 -lk5crypto -lcom_err`
but only libkrb5 is actually used by the plugin. The other two result
in unneeded dependencies unless they're tagged optional when linked
with --as-needed.

Some distributions use --as-needed automatically, which causes our
builds to differ from srpm builds, introducing failures in buildbot.
  • Loading branch information
vuvova committed Sep 13, 2022
1 parent ad43ed2 commit 2e10c96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/auth/CMakeLists.txt
Expand Up @@ -99,6 +99,8 @@ IF(NOT WIN32)
INCLUDE(${CC_SOURCE_DIR}/cmake/FindGSSAPI.cmake)
IF(GSSAPI_FOUND)
SET(GSSAPI_SOURCES ${AUTH_DIR}/auth_gssapi_client.c ${AUTH_DIR}/gssapi_client.c ${AUTH_DIR}/gssapi_errmsg.c)
INCLUDE(CheckLinkerFlag)
CHECK_LINKER_FLAG(C -Wl,--as-needed have_C__Wl___as_needed)
ENDIF()
ELSE()
SET(GSSAPI_LIBS secur32)
Expand All @@ -115,6 +117,9 @@ IF(GSSAPI_SOURCES)
IF(CMAKE_C_COMPILER_ID MATCHES "Clang")
SET_SOURCE_FILES_PROPERTIES(${GSSAPI_SOURCES} PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
ENDIF()
IF(have_C__Wl___as_needed)
SET_TARGET_PROPERTIES(auth_gssapi_client PROPERTIES LINK_FLAGS "-Wl,--as-needed")
ENDIF()
ENDIF()

# old_password plugin
Expand Down

0 comments on commit 2e10c96

Please sign in to comment.