From 4e6ff800160d167ae5d046cafbfcd47b03d7b7c9 Mon Sep 17 00:00:00 2001 From: Stefan Hamminga Date: Thu, 25 Jul 2019 16:19:46 +0300 Subject: [PATCH] Rebased LTO fix for coroutines --- common/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index a6be995f0..1c8c76802 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -359,6 +359,14 @@ if( BUILD_GITHUB_PLUGIN ) ) endif() +# Link-time optimization (LTO) on GCC conflicts with embedded assembly (__asm), +# following GCC's recommendation to disable LTO per translation unit. +if( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set_source_files_properties( system/libcontext.cpp PROPERTIES + COMPILE_FLAGS "-fno-lto" + ) +endif() + set( COMMON_SRCS ${COMMON_SRCS} system/libcontext.cpp -- 2.22.0