This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via a06c9465cf9c2dcc66a5b07327ecbe24ae667295 (commit) via d07f430247406f682e01e8e2067b079e4fe2f4cf (commit) from 7e21d8d7d49f1f2da42f331d768f8b5a46b7ecff (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a06c9465cf9c2dcc66a5b07327ecbe24ae667295 commit a06c9465cf9c2dcc66a5b07327ecbe24ae667295 Merge: 7e21d8d d07f430 Author: Nils Gladitz <nilsglad...@gmail.com> AuthorDate: Fri Feb 14 05:17:06 2014 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Fri Feb 14 05:17:06 2014 -0500 Merge topic 'gcc-ipo' into next d07f4302 Revert "IPO: implemented INTERPROCEDURAL_OPTIMIZATION for gcc (-flto)" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d07f430247406f682e01e8e2067b079e4fe2f4cf commit d07f430247406f682e01e8e2067b079e4fe2f4cf Author: Nils Gladitz <nilsglad...@gmail.com> AuthorDate: Fri Feb 14 11:16:05 2014 +0100 Commit: Nils Gladitz <nilsglad...@gmail.com> CommitDate: Fri Feb 14 11:16:05 2014 +0100 Revert "IPO: implemented INTERPROCEDURAL_OPTIMIZATION for gcc (-flto)" This reverts commit e4c5b620c7bc48c9145aa1fe9b23b6f97d68ea22. diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index a38ebce..f01255c 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -55,96 +55,4 @@ macro(__compiler_gnu lang) if(NOT APPLE) set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") endif() - - # LTO/IPO - if(NOT CMAKE_GCC_AR OR NOT CMAKE_GCC_RANLIB) - if(IS_ABSOLUTE "${CMAKE_${lang}_COMPILER}") - string(REGEX MATCH "^([0-9]+.[0-9]+)" _version - "${CMAKE_${lang}_COMPILER_VERSION}") - get_filename_component(_dir "${CMAKE_${lang}_COMPILER}" DIRECTORY) - - find_program(CMAKE_GCC_AR NAMES - "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar" - "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${_version}" - DOC "gcc provided wrapper for ar which adds the --plugin option" - ) - - find_program(CMAKE_GCC_RANLIB NAMES - "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib" - "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${_version}" - DOC "gcc provided wrapper for ranlib which adds the --plugin option" - ) - - mark_as_advanced(CMAKE_GCC_AR CMAKE_GCC_RANLIB) - endif() - endif() - - if(CMAKE_GCC_AR AND CMAKE_GCC_RANLIB) - set(__lto_flags -flto) - - if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.7) - list(APPEND __lto_flags -fno-fat-lto-objects) - endif() - - if(NOT DEFINED CMAKE_${lang}_PASSED_LTO_TEST) - set(__output_dir "${CMAKE_PLATFORM_INFO_DIR}/LtoTest${lang}") - file(MAKE_DIRECTORY "${__output_dir}") - set(__output_base "${__output_dir}/lto-test-${lang}") - - execute_process( - COMMAND ${CMAKE_COMMAND} -E echo "void foo() {}" - COMMAND ${CMAKE_${lang}_COMPILER} ${__lto_flags} -c -xc - - -o ${__output_base}.o - RESULT_VARIABLE __result - ERROR_QUIET - OUTPUT_QUIET - ) - - if("${__result}" STREQUAL "0") - execute_process( - COMMAND ${CMAKE_GCC_AR} cr ${__output_base}.a ${__output_base}.o - COMMAND ${CMAKE_GCC_RANLIB} ${__output_base}.a - RESULT_VARIABLE __result - ERROR_QUIET - OUTPUT_QUIET - ) - endif() - - if("${__result}" STREQUAL "0") - execute_process( - COMMAND ${CMAKE_COMMAND} -E echo "void foo(); int main() {foo();}" - COMMAND ${CMAKE_${lang}_COMPILER} ${__lto_flags} -xc - - -x none ${__output_base}.a -o ${__output_base} - RESULT_VARIABLE __result - ERROR_QUIET - OUTPUT_QUIET - ) - endif() - - if("${__result}" STREQUAL "0") - set(__lto_found TRUE) - endif() - - set(CMAKE_${lang}_PASSED_LTO_TEST - ${__lto_found} CACHE INTERNAL - "If the compiler passed a simple LTO test compile") - endif() - - if(CMAKE_${lang}_PASSED_LTO_TEST) - - set(CMAKE_${lang}_COMPILE_OPTIONS_IPO ${__lto_flags}) - - set(CMAKE_${lang}_ARCHIVE_CREATE_IPO - "${CMAKE_GCC_AR} cr <TARGET> <LINK_FLAGS> <OBJECTS>" - ) - - set(CMAKE_${lang}_ARCHIVE_APPEND_IPO - "${CMAKE_GCC_AR} r <TARGET> <LINK_FLAGS> <OBJECTS>" - ) - - set(CMAKE_${lang}_ARCHIVE_FINISH_IPO - "${CMAKE_GCC_RANLIB} <TARGET>" - ) - endif() - endif() endmacro() diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 38d3c3c..d6a0cd4 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -140,7 +140,11 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules() } linkRuleVar += "_CREATE_STATIC_LIBRARY"; - linkRuleVar = this->GetFeatureSpecificLinkRuleVariable(linkRuleVar); + if(this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION") && + this->Makefile->GetDefinition((linkRuleVar+"_IPO").c_str())) + { + linkRuleVar += "_IPO"; + } std::string extraFlags; this->LocalGenerator->GetStaticLibraryFlags(extraFlags, @@ -490,7 +494,6 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules std::string arCreateVar = "CMAKE_"; arCreateVar += linkLanguage; arCreateVar += "_ARCHIVE_CREATE"; - arCreateVar = this->GetFeatureSpecificLinkRuleVariable(arCreateVar); if(const char* rule = this->Makefile->GetDefinition(arCreateVar.c_str())) { cmSystemTools::ExpandListArgument(rule, archiveCreateCommands); @@ -498,7 +501,6 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules std::string arAppendVar = "CMAKE_"; arAppendVar += linkLanguage; arAppendVar += "_ARCHIVE_APPEND"; - arAppendVar = this->GetFeatureSpecificLinkRuleVariable(arAppendVar); if(const char* rule = this->Makefile->GetDefinition(arAppendVar.c_str())) { cmSystemTools::ExpandListArgument(rule, archiveAppendCommands); @@ -506,7 +508,6 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules std::string arFinishVar = "CMAKE_"; arFinishVar += linkLanguage; arFinishVar += "_ARCHIVE_FINISH"; - arFinishVar = this->GetFeatureSpecificLinkRuleVariable(arFinishVar); if(const char* rule = this->Makefile->GetDefinition(arFinishVar.c_str())) { cmSystemTools::ExpandListArgument(rule, archiveFinishCommands); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 14dd6ab..7f90078 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1664,20 +1664,6 @@ void cmMakefileTargetGenerator } //---------------------------------------------------------------------------- -std::string cmMakefileTargetGenerator::GetFeatureSpecificLinkRuleVariable( - std::string const& var) const -{ - std::string ipoVar = var + "_IPO"; - if(this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION") && - this->Makefile->GetDefinition(ipoVar.c_str())) - { - return ipoVar; - } - - return var; -} - -//---------------------------------------------------------------------------- std::string cmMakefileTargetGenerator::GetLinkRule(const char* linkRuleVar) { std::string linkRule = this->Makefile->GetRequiredDefinition(linkRuleVar); @@ -2055,13 +2041,13 @@ void cmMakefileTargetGenerator::AddModuleDefinitionFlag(std::string& flags) } //---------------------------------------------------------------------------- -const char* cmMakefileTargetGenerator::GetFeature(const char* feature) const +const char* cmMakefileTargetGenerator::GetFeature(const char* feature) { return this->Target->GetFeature(feature, this->ConfigName); } //---------------------------------------------------------------------------- -bool cmMakefileTargetGenerator::GetFeatureAsBool(const char* feature) const +bool cmMakefileTargetGenerator::GetFeatureAsBool(const char* feature) { return cmSystemTools::IsOn(this->GetFeature(feature)); } diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 16524c3..4f8fafa 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -137,9 +137,6 @@ protected: // Append link rule dependencies (objects, etc.). void AppendLinkDepends(std::vector<std::string>& depends); - // Get feature specific link rule variable (e.g. <var>_IPO) - std::string GetFeatureSpecificLinkRuleVariable(std::string const& var) const; - // Lookup the link rule for this target. std::string GetLinkRule(const char* linkRuleVar); @@ -261,8 +258,8 @@ protected: void AddFeatureFlags(std::string& flags, const char* lang); // Feature query methods. - const char* GetFeature(const char* feature) const; - bool GetFeatureAsBool(const char* feature) const; + const char* GetFeature(const char* feature); + bool GetFeatureAsBool(const char* feature); //================================================================== // Convenience routines that do nothing more than forward to diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index b979be1..73ba815 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -140,17 +140,10 @@ std::string cmNinjaNormalTargetGenerator ::LanguageLinkerRule() const { - std::string var = std::string(this->TargetLinkLanguage) + return std::string(this->TargetLinkLanguage) + "_" + cmTarget::GetTargetTypeName(this->GetTarget()->GetType()) + "_LINKER"; - - if(this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION")) - { - var += "_IPO"; - } - - return var; } void @@ -159,7 +152,6 @@ cmNinjaNormalTargetGenerator { cmTarget::TargetType targetType = this->GetTarget()->GetType(); std::string ruleName = this->LanguageLinkerRule(); - if (useResponseFile) ruleName += "_RSP_FILE"; @@ -328,7 +320,6 @@ cmNinjaNormalTargetGenerator std::string linkCmdVar = "CMAKE_"; linkCmdVar += this->TargetLinkLanguage; linkCmdVar += "_CREATE_STATIC_LIBRARY"; - linkCmdVar = this->GetFeatureSpecificLinkRuleVariable(linkCmdVar); if (const char *linkCmd = this->GetMakefile()->GetDefinition(linkCmdVar.c_str())) { @@ -349,7 +340,6 @@ cmNinjaNormalTargetGenerator std::string linkCmdVar = "CMAKE_"; linkCmdVar += this->TargetLinkLanguage; linkCmdVar += "_ARCHIVE_CREATE"; - linkCmdVar = this->GetFeatureSpecificLinkRuleVariable(linkCmdVar); const char *linkCmd = this->GetMakefile()->GetRequiredDefinition(linkCmdVar.c_str()); cmSystemTools::ExpandListArgument(linkCmd, linkCmds); @@ -358,7 +348,6 @@ cmNinjaNormalTargetGenerator std::string linkCmdVar = "CMAKE_"; linkCmdVar += this->TargetLinkLanguage; linkCmdVar += "_ARCHIVE_FINISH"; - linkCmdVar = this->GetFeatureSpecificLinkRuleVariable(linkCmdVar); const char *linkCmd = this->GetMakefile()->GetRequiredDefinition(linkCmdVar.c_str()); cmSystemTools::ExpandListArgument(linkCmd, linkCmds); @@ -489,9 +478,6 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() std::string flags = (targetType == cmTarget::EXECUTABLE ? vars["FLAGS"] : vars["ARCH_FLAGS"]); - - this->AddFeatureFlags(flags, this->TargetLinkLanguage); - this->GetLocalGenerator()->AddArchitectureFlags(flags, this->GetGeneratorTarget(), this->TargetLinkLanguage, diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 2af7bf11..82f8d1b 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -97,33 +97,18 @@ const char* cmNinjaTargetGenerator::GetConfigName() const } // TODO: Picked up from cmMakefileTargetGenerator. Refactor it. -const char* cmNinjaTargetGenerator::GetFeature(const char* feature) const +const char* cmNinjaTargetGenerator::GetFeature(const char* feature) { return this->Target->GetFeature(feature, this->GetConfigName()); } // TODO: Picked up from cmMakefileTargetGenerator. Refactor it. -bool cmNinjaTargetGenerator::GetFeatureAsBool(const char* feature) const +bool cmNinjaTargetGenerator::GetFeatureAsBool(const char* feature) { return cmSystemTools::IsOn(this->GetFeature(feature)); } // TODO: Picked up from cmMakefileTargetGenerator. Refactor it. -std::string cmNinjaTargetGenerator::GetFeatureSpecificLinkRuleVariable( - std::string const& var) const -{ - std::string ipoVar = var + "_IPO"; - if(this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION") && - this->Makefile->GetDefinition(ipoVar.c_str())) - { - return ipoVar; - } - - return var; -} - - -// TODO: Picked up from cmMakefileTargetGenerator. Refactor it. void cmNinjaTargetGenerator::AddFeatureFlags(std::string& flags, const char* lang) { diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index bce3647..2ce1ed7 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -70,9 +70,8 @@ protected: std::string LanguageCompilerRule(const std::string& lang) const { return lang + "_COMPILER"; } - const char* GetFeature(const char* feature) const; - bool GetFeatureAsBool(const char* feature) const; - std::string GetFeatureSpecificLinkRuleVariable(std::string const& var) const; + const char* GetFeature(const char* feature); + bool GetFeatureAsBool(const char* feature); void AddFeatureFlags(std::string& flags, const char* lang); /** diff --git a/Tests/IPO/CMakeLists.txt b/Tests/IPO/CMakeLists.txt index b45ec89..6dabf86 100644 --- a/Tests/IPO/CMakeLists.txt +++ b/Tests/IPO/CMakeLists.txt @@ -1,13 +1,5 @@ cmake_minimum_required (VERSION 2.8) -project(IPO C) - -message("======== IPO specific variables ======") -get_cmake_property(variables VARIABLES) -foreach(variable ${variables}) - if("${variable}xxx" MATCHES "_IPOxxx") - message("${variable}: [${${variable}}]") - endif() -endforeach() +project(IPO NONE) set_property(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION 1) ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU.cmake | 92 --------------------------- Source/cmMakefileLibraryTargetGenerator.cxx | 9 +-- Source/cmMakefileTargetGenerator.cxx | 18 +----- Source/cmMakefileTargetGenerator.h | 7 +- Source/cmNinjaNormalTargetGenerator.cxx | 16 +---- Source/cmNinjaTargetGenerator.cxx | 19 +----- Source/cmNinjaTargetGenerator.h | 5 +- Tests/IPO/CMakeLists.txt | 10 +-- 8 files changed, 15 insertions(+), 161 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits