Commit 54e609db authored by Marc Vef's avatar Marc Vef
Browse files

Added CFLAGS -no-pie for gprof to work with >GCC6

parent 5ef6d1b8
Loading
Loading
Loading
Loading
+19 −8
Original line number Diff line number Diff line
@@ -16,12 +16,12 @@ if (NOT CMAKE_BUILD_TYPE)
            CACHE STRING "Choose the type of build: Debug Release Memcheck
            FORCE")
ENDIF (NOT CMAKE_BUILD_TYPE)
message("* Current build type is : ${CMAKE_BUILD_TYPE}")
message("* Current daemon build type is : ${CMAKE_BUILD_TYPE}")

set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64 -O3")
# For debugging memory leaks.
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall --pedantic -g -pg -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall --pedantic -g -pg")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall --pedantic -g -pg -no-pie -O0")

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})

@@ -132,9 +132,20 @@ set(SOURCE_FILES main.cpp main.hpp include/configure.hpp configure_public.hpp ut
        src/rpc/handler/h_preload.cpp
        include/rpc/rpc_utils.hpp src/rpc/rpc_utils.cpp include/global_defs.hpp)
add_executable(adafs_daemon ${SOURCE_FILES})

if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
    target_link_libraries(adafs_daemon ${ROCKSDB_LIBRARIES}
            # rocksdb libs
            ${snappy_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${ZSTD_LIBRARIES} ${LZ4_LIBRARY} ${gflags_LIBRARIES}
            # margo libs
            ${NA_LIB} ${MERCURY_LIBRARIES} ${MERCURY_UTIL_LIBRARIES} ${ABT_LIBRARIES} ${ABT_SNOOZER_LIBRARIES} ${MARGO_LIBRARIES}
            -lpthread -lboost_system -lboost_filesystem -lboost_serialization -lboost_program_options -pg)
else ()
    target_link_libraries(adafs_daemon ${ROCKSDB_LIBRARIES}
            # rocksdb libs
            ${snappy_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${ZSTD_LIBRARIES} ${LZ4_LIBRARY} ${gflags_LIBRARIES}
            # margo libs
            ${NA_LIB} ${MERCURY_LIBRARIES} ${MERCURY_UTIL_LIBRARIES} ${ABT_LIBRARIES} ${ABT_SNOOZER_LIBRARIES} ${MARGO_LIBRARIES}
            -lpthread -lboost_system -lboost_filesystem -lboost_serialization -lboost_program_options)

endif ()
 No newline at end of file
+11 −4
Original line number Diff line number Diff line
@@ -3,7 +3,8 @@ project(preload CXX C)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -fPIC -O3")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall --pedantic -g -pg -fPIC")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall --pedantic -g -pg -fPIC -no-pie -O0")
message("* Current library build type is : ${CMAKE_BUILD_TYPE}")


set(SOURCE_FILES_PRELOAD preload.cpp ../../include/configure.hpp ../../configure_public.hpp
@@ -15,6 +16,12 @@ set(SOURCE_FILES_PRELOAD preload.cpp ../../include/configure.hpp ../../configure
        rpc/ld_rpc_data_ws.cpp rpc/ld_rpc_metadentry.cpp ../../include/preload/rpc/ld_rpc_data_ws.hpp ../../include/preload/rpc/ld_rpc_metadentry.hpp
        ../../include/rpc/rpc_utils.hpp ../rpc/rpc_utils.cpp intcp_functions.cpp passthrough.cpp ../../include/preload/passthrough.hpp ../../include/global_defs.hpp adafs_functions.cpp adafs_functions.cpp ../../include/preload/adafs_functions.hpp)
add_library(iointer SHARED ${SOURCE_FILES_PRELOAD})
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
    target_link_libraries(iointer dl ${NA_LIB} ${MERCURY_LIBRARIES} ${MERCURY_UTIL_LIBRARIES} ${ABT_LIBRARIES}
            ${ABT_SNOOZER_LIBRARIES} ${MARGO_LIBRARIES}
            -lpthread -lboost_system -pg)
else ()
    target_link_libraries(iointer dl ${NA_LIB} ${MERCURY_LIBRARIES} ${MERCURY_UTIL_LIBRARIES} ${ABT_LIBRARIES}
            ${ABT_SNOOZER_LIBRARIES} ${MARGO_LIBRARIES}
            -lpthread -lboost_system)
endif ()