Skip to content

Commit 3d2e60e

Browse files
committed
Allow for building without RPATH
When building with static libraries for protobuf etc., we can allow not setting an RPATH. This means the resulting binary for the mysqld server has no RPATH set, satisfying security scanners like checksec.sh. Signed-off-by: Dirkjan Bussink <[email protected]>
1 parent 7cd9b9c commit 3d2e60e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,9 @@ IF(WITH_PROTOBUF STREQUAL "bundled" OR WITH_FIDO STREQUAL "bundled")
20222022
# Protobuf library is a target, installed to <root>/${INSTALL_PRIV_LIBDIR}
20232023
# INSTALL_RPATH must be set for all binaries linking with libprotobuf.
20242024
IF(WITH_PROTOBUF STREQUAL "bundled")
2025-
SET(UNIX_INSTALL_RPATH_ORIGIN_PRIV_LIBDIR 1)
2025+
IF(NOT CMAKE_CXX_FLAGS MATCHES "-static-libgcc")
2026+
SET(UNIX_INSTALL_RPATH_ORIGIN_PRIV_LIBDIR 1)
2027+
ENDIF()
20262028
ADD_SUBDIRECTORY(extra/protobuf)
20272029
ENDIF()
20282030

0 commit comments

Comments
 (0)