diff options
author | Yun Peng <pcloudy@google.com> | 2016-10-18 13:55:12 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-10-19 08:25:39 +0000 |
commit | aecf826aa0cd12d25a8f6d69604d721f50d940f0 (patch) | |
tree | da33c51ecf8312377ea48dfc4f0f0ee58daeabe9 /tools | |
parent | 8256c0f6320e9d548a2048b8fb2875d12830dc6e (diff) |
Rollback of commit ffdc05d2278d7f9c6e299c923019f689cde5fe76.
*** Reason for rollback ***
Causes huge memory blow-up after the analysis phase in CppLinkAction (LinkCommandLine).
--
MOS_MIGRATED_REVID=136467836
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cpp/CROSSTOOL.tpl | 185 | ||||
-rw-r--r-- | tools/cpp/cc_configure.bzl | 22 |
2 files changed, 0 insertions, 207 deletions
diff --git a/tools/cpp/CROSSTOOL.tpl b/tools/cpp/CROSSTOOL.tpl index 082a7becc1..295faa00fc 100644 --- a/tools/cpp/CROSSTOOL.tpl +++ b/tools/cpp/CROSSTOOL.tpl @@ -293,191 +293,6 @@ toolchain { } } - action_config { - config_name: 'c++-link-executable' - action_name: 'c++-link-executable' - tool { - tool_path: 'wrapper/bin/msvc_link.bat' - } - implies: 'linkstamps' - implies: 'output_execpath_flags' - implies: 'input_param_flags' - implies: 'global_whole_archive' - } - - action_config { - config_name: 'c++-link-dynamic-library' - action_name: 'c++-link-dynamic-library' - tool { - tool_path: 'wrapper/bin/msvc_link.bat' - } - implies: 'shared_flag' - implies: 'linkstamps' - implies: 'output_execpath_flags' - implies: 'input_param_flags' - implies: 'global_whole_archive' - implies: 'has_configured_linker_path' - } - - action_config { - config_name: 'c++-link-static-library' - action_name: 'c++-link-static-library' - tool { - tool_path: 'wrapper/bin/msvc_link.bat' - } - implies: 'input_param_flags' - implies: 'global_whole_archive' - } - - action_config { - config_name: 'c++-link-alwayslink-static-library' - action_name: 'c++-link-alwayslink-static-library' - tool { - tool_path: 'wrapper/bin/msvc_link.bat' - } - implies: 'input_param_flags' - implies: 'global_whole_archive' - } - - # TODO(pcloudy): The following action_config is listed in MANDATORY_LINK_TARGET_TYPES. - # But do we really need them on Windows? - action_config { - config_name: 'c++-link-pic-static-library' - action_name: 'c++-link-pic-static-library' - tool { - tool_path: 'wrapper/bin/msvc_link.bat' - } - implies: 'input_param_flags' - implies: 'global_whole_archive' - } - - action_config { - config_name: 'c++-link-alwayslink-pic-static-library' - action_name: 'c++-link-alwayslink-pic-static-library' - tool { - tool_path: 'wrapper/bin/msvc_link.bat' - } - implies: 'input_param_flags' - implies: 'global_whole_archive' - } - - action_config { - config_name: 'c++-link-interface-dynamic-library' - action_name: 'c++-link-interface-dynamic-library' - tool { - tool_path: 'wrapper/bin/msvc_link.bat' - } - } - - feature { - name: 'has_configured_linker_path' - } - - feature { - name: 'shared_flag' - flag_set { - action: 'c++-link-dynamic-library' - flag_group { - flag: '/DLL' - } - } - } - - feature { - name: 'linkstamps' - flag_set { - action: 'c++-link-executable' - action: 'c++-link-dynamic-library' - expand_if_all_available: 'linkstamp_paths' - flag_group { - flag: '%{linkstamp_paths}' - } - } - } - - feature { - name: 'output_execpath_flags' - flag_set { - expand_if_all_available: 'output_execpath' - action: 'c++-link-executable' - action: 'c++-link-dynamic-library' - flag_group { - flag: '/OUT:%{output_execpath}' - } - } - } - - feature { - name: 'input_param_flags' - flag_set { - expand_if_all_available: 'libopts' - action: 'c++-link-executable' - action: 'c++-link-dynamic-library' - action: 'c++-link-static-library' - action: 'c++-link-alwayslink-static-library' - action: 'c++-link-pic-static-library' - action: 'c++-link-alwayslink-pic-static-library' - flag_group { - flag: '%{libopts}' - } - } - flag_set { - expand_if_all_available: 'whole_archive_linker_params' - action: 'c++-link-executable' - action: 'c++-link-dynamic-library' - action: 'c++-link-static-library' - action: 'c++-link-alwayslink-static-library' - action: 'c++-link-pic-static-library' - action: 'c++-link-alwayslink-pic-static-library' - flag_group { - # If MSVC linker supports /WHOLEARCHIVE, this field will be enabled - %{whole_archive_linker_params} - } - } - flag_set { - expand_if_all_available: 'whole_archive_object_files_params' - action: 'c++-link-executable' - action: 'c++-link-dynamic-library' - action: 'c++-link-static-library' - action: 'c++-link-alwayslink-static-library' - action: 'c++-link-pic-static-library' - action: 'c++-link-alwayslink-pic-static-library' - flag_group { - # If MSVC linker doesn't support /WHOLEARCHIVE, this field will be enabled - %{whole_archive_object_files_params} - } - } - flag_set { - expand_if_all_available: 'linker_input_params' - action: 'c++-link-executable' - action: 'c++-link-dynamic-library' - action: 'c++-link-static-library' - action: 'c++-link-alwayslink-static-library' - action: 'c++-link-pic-static-library' - action: 'c++-link-alwayslink-pic-static-library' - flag_group { - flag: '%{linker_input_params}' - } - } - } - - feature { - name: 'global_whole_archive' - flag_set { - expand_if_all_available: 'global_whole_archive' - action: 'c++-link-executable' - action: 'c++-link-dynamic-library' - action: 'c++-link-static-library' - action: 'c++-link-alwayslink-static-library' - action: 'c++-link-pic-static-library' - action: 'c++-link-alwayslink-pic-static-library' - flag_group { - # If MSVC linker supports /WHOLEARCHIVE, this field will be enabled - %{global_whole_archive} - } - } -} - compilation_mode_flags { mode: DBG compiler_flag: "/DDEBUG=1" diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl index eaeb2ec8e6..1ea3c3e7d9 100644 --- a/tools/cpp/cc_configure.bzl +++ b/tools/cpp/cc_configure.bzl @@ -428,12 +428,6 @@ def _find_env_vars(repository_ctx, vs_path): return env_map -def _is_support_whole_archive(repository_ctx, vs_dir): - """Run MSVC linker alone to see if it supports /WHOLEARCHIVE.""" - result = _execute(repository_ctx, [vs_dir + "/VC/BIN/amd64/link"]) - return result.find("/WHOLEARCHIVE") != -1 - - def _tpl(repository_ctx, tpl, substitutions={}, out=None): if not out: out = tpl @@ -494,25 +488,12 @@ def _impl(repository_ctx): for path in include_paths.split(";"): if path: cxx_include_directories.append(("cxx_builtin_include_directory: \"%s\"" % path)) - - if _is_support_whole_archive(repository_ctx, vs_path): - whole_archive_linker_params = "flag: '/WHOLEARCHIVE:%{whole_archive_linker_params}'" - global_whole_archive = "flag: '/WHOLEARCHIVE'" - whole_archive_object_files_params = "" - else: - whole_archive_linker_params = "" - global_whole_archive = "" - whole_archive_object_files_params = "flag: '%{whole_archive_object_files_params}'" - _tpl(repository_ctx, "CROSSTOOL", { "%{cpu}": cpu_value, "%{content}": _get_windows_crosstool_content(repository_ctx), "%{opt_content}": "", "%{dbg_content}": "", "%{cxx_builtin_include_directory}": "\n".join(cxx_include_directories), - "%{whole_archive_linker_params}": whole_archive_linker_params, - "%{whole_archive_object_files_params}": whole_archive_object_files_params, - "%{global_whole_archive}": global_whole_archive, }) else: darwin = cpu_value == "darwin" @@ -538,9 +519,6 @@ def _impl(repository_ctx): "%{opt_content}": _build_crosstool(opt_content, " "), "%{dbg_content}": _build_crosstool(dbg_content, " "), "%{cxx_builtin_include_directory}": "", - "%{whole_archive_linker_params}": "", - "%{whole_archive_object_files_params}": "", - "%{global_whole_archive}": "", }) |