Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Commit 72b33be

Browse files
author
Tor Didriksen
committed
Bug #33108847 BROKEN BUILD FOR BUNDLED LIBFIDO WITH PGO/LTO
With PGO/LTO enabled, the bundled libfido2 build is broken. We normally do not build, or run, the authentication plugins when doing profile-guided optimizations. It should still be possible to build and run them, so add a call to the macro DISABLE_MISSING_PROFILE_WARNING. Move DISABLE_MISSING_PROFILE_WARNING from maintainer.cmake to the top level CMakeLists.txt so that it can be used without adding all the other stuff in maintainer.cmake. Also fix: extra/libfido2/openbsd-compat/openbsd-compat.h:71:5: error: "OPENSSL_VERSION_NUMBER" is not defined Change-Id: I123833845690fa1dcf30733630a4d7c7ee167f86 (cherry picked from commit 5fd5019f8c524580f77931807aa6817bdba221a0)
1 parent db0d3e7 commit 72b33be

5 files changed

Lines changed: 24 additions & 12 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,19 @@ FUNCTION(MY_CHECK_CXX_COMPILER_WARNING WARNING_OPTION RETURN_VALUE)
968968
ENDIF()
969969
ENDFUNCTION()
970970

971+
# When builing with PGO, GCC will report -Wmissing-profile when compiling
972+
# files for which it cannot find profile data. It is valid to disable
973+
# this warning for files we are not currently interested in profiling.
974+
MACRO(DISABLE_MISSING_PROFILE_WARNING)
975+
IF(FPROFILE_USE)
976+
MY_CHECK_CXX_COMPILER_WARNING("-Wmissing-profile" HAS_WARN_FLAG)
977+
IF(HAS_WARN_FLAG)
978+
STRING_APPEND(CMAKE_C_FLAGS " ${HAS_WARN_FLAG}")
979+
STRING_APPEND(CMAKE_CXX_FLAGS " ${HAS_WARN_FLAG}")
980+
ENDIF()
981+
ENDIF()
982+
ENDMACRO()
983+
971984
MACRO(MY_SANITIZER_CHECK SAN_OPT ADD_OPTIMIZATION RESULT)
972985
MY_CHECK_C_COMPILER_FLAG("${SAN_OPT}" C_RESULT)
973986
MY_CHECK_CXX_COMPILER_FLAG("${SAN_OPT}" CXX_RESULT)

‎cmake/maintainer.cmake‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,3 @@ MACRO(ADD_WSHADOW_WARNING)
186186
ADD_COMPILE_OPTIONS("-Wshadow-uncaptured-local")
187187
ENDIF()
188188
ENDMACRO()
189-
190-
# When builing with PGO, GCC 9 will report -Wmissing-profile when compiling
191-
# files for which it cannot find profile data. It is valid to disable
192-
# this warning for files we are not currently interested in profiling.
193-
MACRO(DISABLE_MISSING_PROFILE_WARNING)
194-
IF(FPROFILE_USE)
195-
MY_CHECK_CXX_COMPILER_WARNING("-Wmissing-profile" HAS_WARN_FLAG)
196-
IF(HAS_WARN_FLAG)
197-
STRING_APPEND(CMAKE_CXX_FLAGS " ${HAS_WARN_FLAG}")
198-
ENDIF()
199-
ENDIF()
200-
ENDMACRO()

‎extra/libfido2/CMakeLists.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ SET(CBOR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/${CBOR_BUNDLE_SRC_PATH}
347347

348348
SET(CBOR_LIBRARY_DIRS ${CMAKE_BINARY_DIR}/${CBOR_BUNDLE_SRC_PATH})
349349

350+
DISABLE_MISSING_PROFILE_WARNING()
351+
IF(FPROFILE_USE)
352+
MY_CHECK_CXX_COMPILER_WARNING("-Wcoverage-mismatch" HAS_WARN_FLAG)
353+
IF(HAS_WARN_FLAG)
354+
STRING_APPEND(CMAKE_C_FLAGS " ${HAS_WARN_FLAG}")
355+
ENDIF()
356+
ENDIF()
357+
350358
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
351359
include_directories(${CBOR_INCLUDE_DIRS})
352360

‎extra/libfido2/openbsd-compat/openbsd-compat.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ int timingsafe_bcmp(const void *, const void *, size_t);
6868
#include <readpassphrase.h>
6969
#endif
7070

71+
#include <openssl/opensslv.h>
7172
#if OPENSSL_VERSION_NUMBER < 0x10100000L
7273
#define EVP_PKEY_get0_EC_KEY(x) ((x)->pkey.ec)
7374
#define EVP_PKEY_get0_RSA(x) ((x)->pkey.rsa)

‎libmysql/authentication_fido/CMakeLists.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ INCLUDE(CheckIncludeFiles)
4141

4242
MY_INCLUDE_SYSTEM_DIRECTORIES(FIDO)
4343

44+
DISABLE_MISSING_PROFILE_WARNING()
45+
4446
MYSQL_ADD_PLUGIN(authentication_fido_client
4547
fido_registration.cc
4648
fido_assertion.cc

0 commit comments

Comments
 (0)