-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-40081: Remove outdated PIC explictness #5250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql) | ||
|
|
||
| MYSQL_ADD_PLUGIN(USERSTAT userstat.cc MANDATORY) | ||
| MYSQL_ADD_PLUGIN(USERSTAT userstat.cc MANDATORY RECOMPILE_FOR_EMBEDDED) | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| MYSQL_ADD_PLUGIN(sequence sequence.cc STORAGE_ENGINE DEFAULT) | ||
| MYSQL_ADD_PLUGIN(sequence sequence.cc STORAGE_ENGINE DEFAULT RECOMPILE_FOR_EMBEDDED) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,21 +8,44 @@ SET(COMMON_SOURCES | |
| wait_notification.cc | ||
| ) | ||
|
|
||
| IF(WITH_EMBEDDED_SERVER) | ||
| LIST(APPEND tpool_list tpool tpool_embedded) | ||
| LIST(APPEND tpool_common_list tpool_common tpool_common_embedded) | ||
| ELSE() | ||
| SET(tpool_list tpool) | ||
| SET(tpool_common_list tpool_common) | ||
| ENDIF() | ||
|
|
||
| IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
| ADD_LIBRARY(tpool OBJECT ${COMMON_SOURCES} aio_simulated.cc) | ||
| IF(WIN32) | ||
| TARGET_SOURCES(tpool PRIVATE tpool_win.cc aio_win.cc) | ||
| ADD_LIBRARY(tpool OBJECT ${COMMON_SOURCES} aio_simulated.cc) | ||
| IF(WITH_EMBEDDED_SERVER) | ||
| ADD_CONVENIENCE_LIBRARY(tpool_embedded ${COMMON_SOURCES} aio_simulated.cc) | ||
| ENDIF() | ||
| TARGET_INCLUDE_DIRECTORIES(tpool PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include) | ||
| FOREACH(t ${tpool_list}) | ||
| IF(WIN32) | ||
| TARGET_SOURCES(${t} PRIVATE tpool_win.cc aio_win.cc) | ||
| ENDIF() | ||
| TARGET_INCLUDE_DIRECTORIES(${t} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include) | ||
| ENDFOREACH() | ||
| ADD_LIBRARY(tpool_min ALIAS tpool) | ||
| ELSE() # Linux | ||
| ADD_LIBRARY(tpool_common OBJECT ${COMMON_SOURCES}) | ||
| # Ensure that aiocb used as opaque in common code, or ABI will be broken | ||
| TARGET_COMPILE_DEFINITIONS(tpool_common PRIVATE -DTPOOL_OPAQUE_AIOCB) | ||
| TARGET_INCLUDE_DIRECTORIES(tpool_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include) | ||
| ADD_LIBRARY(tpool STATIC aio_linux.cc aio_simulated.cc) | ||
| ADD_LIBRARY(tpool_common OBJECT ${COMMON_SOURCES}) | ||
| IF(WITH_EMBEDDED_SERVER) | ||
| ADD_CONVENIENCE_LIBRARY(tpool_embedded aio_linux.cc aio_simulated.cc) | ||
| ADD_CONVENIENCE_LIBRARY(tpool_common_embedded OBJECT ${COMMON_SOURCES}) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Passing The |
||
| ENDIF() | ||
| FOREACH(t ${tpool_common_list}) | ||
| # Ensure that aiocb used as opaque in common code, or ABI will be broken | ||
| TARGET_COMPILE_DEFINITIONS(${t} PRIVATE -DTPOOL_OPAQUE_AIOCB) | ||
| TARGET_INCLUDE_DIRECTORIES(${t} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include) | ||
| ENDFOREACH() | ||
|
|
||
| TARGET_LINK_LIBRARIES(tpool PUBLIC tpool_common) | ||
| IF(WITH_EMBEDDED_SERVER) | ||
| TARGET_LINK_LIBRARIES(tpool_embedded PUBLIC tpool_common_embedded) | ||
| ENDIF() | ||
|
|
||
| OPTION(WITH_URING "Require that io_uring be used" OFF) | ||
| OPTION(WITH_LIBAIO "Require that libaio is used" OFF) | ||
| IF(WITH_URING) | ||
|
|
@@ -34,11 +57,13 @@ ELSE() # Linux | |
| FIND_PACKAGE(URING QUIET ${URING_REQUIRED}) | ||
| IF(URING_FOUND) | ||
| SET(URING_FOUND ${URING_FOUND} PARENT_SCOPE) | ||
| TARGET_COMPILE_DEFINITIONS(tpool PUBLIC "-DHAVE_URING") | ||
| TARGET_LINK_LIBRARIES(tpool PRIVATE ${URING_LIBRARIES}) | ||
| TARGET_INCLUDE_DIRECTORIES(tpool PUBLIC ${URING_INCLUDE_DIRS}) | ||
| TARGET_SOURCES(tpool PRIVATE aio_liburing.cc) | ||
| ADD_DEPENDENCIES(tpool GenError) | ||
| FOREACH(t ${tpool_list}) | ||
| TARGET_COMPILE_DEFINITIONS(${t} PUBLIC "-DHAVE_URING") | ||
| TARGET_LINK_LIBRARIES(${t} PRIVATE ${URING_LIBRARIES}) | ||
| TARGET_INCLUDE_DIRECTORIES(${t} PUBLIC ${URING_INCLUDE_DIRS}) | ||
| TARGET_SOURCES(${t} PRIVATE aio_liburing.cc) | ||
| ADD_DEPENDENCIES(${t} GenError) | ||
| ENDFOREACH() | ||
| SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) | ||
| SET(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) | ||
| SET(CMAKE_REQUIRED_INCLUDES ${URING_INCLUDE_DIRS}) | ||
|
|
@@ -53,10 +78,12 @@ ELSE() # Linux | |
|
|
||
| FIND_PACKAGE(LIBAIO QUIET ${LIBAIO_REQUIRED}) | ||
| IF(LIBAIO_FOUND) | ||
| TARGET_COMPILE_DEFINITIONS(tpool PUBLIC "-DHAVE_LIBAIO") | ||
| TARGET_INCLUDE_DIRECTORIES(tpool PUBLIC ${LIBAIO_INCLUDE_DIRS}) | ||
| TARGET_LINK_LIBRARIES(tpool PRIVATE ${LIBAIO_LIBRARIES}) | ||
| TARGET_SOURCES(tpool PRIVATE aio_libaio.cc) | ||
| FOREACH(t ${tpool_list}) | ||
| TARGET_COMPILE_DEFINITIONS(${t} PUBLIC "-DHAVE_LIBAIO") | ||
| TARGET_INCLUDE_DIRECTORIES(${t} PUBLIC ${LIBAIO_INCLUDE_DIRS}) | ||
| TARGET_LINK_LIBRARIES(${t} PRIVATE ${LIBAIO_LIBRARIES}) | ||
| TARGET_SOURCES(${t} PRIVATE aio_libaio.cc) | ||
| ENDFOREACH() | ||
| ENDIF() | ||
|
|
||
| IF(LIBAIO_FOUND OR URING_FOUND) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On platforms like Windows (where PIC is not used) or macOS (where PIC is always enabled by default), the
POSITION_INDEPENDENT_CODEtarget property is typically not explicitly set.By removing the platform-skipping logic (previously handled by
_SKIP_PIC), this check will run on all platforms. On Windows and macOS,GET_TARGET_PROPERTY(LIB_PIC ...)will returnNOTFOUND, causingIF(NOT LIB_PIC)to evaluate to true and trigger aFATAL_ERRORduring the build.To prevent build failures on these platforms, we should skip this check on Windows, Cygwin, macOS, or when shared libraries are disabled.