Commit 6e043d67 authored by Tim Van Patten's avatar Tim Van Patten Committed by Commit Bot

Abseil: Only use Windows .def files with clang

The various .def files used in Windows builds are generated using
llvm-nm and only support being used with the clang compiler. These .def
files can't be used with MSVC, though we are unsure if that's related to
how they are generated by generate_def_files.py or how MSVC consumes
them (i.e. the format it expects for the symbols).

The issue is primarly about the custom libcxx and MSVC's inability to
work correctly with it. //build/config/c++/c++.gni handles this
automatically by disabling the custom libcxx for non-clang (MSVC) builds
by setting use_custom_libcxx = false. However, this causes the .def
symbols to be generated differently (incorrectly), causing link
failures related to too many symbols being exported.

This change helps support using Abseil in ANGLE, particularly standalone
component builds built with MSVC.

This is a workaround until:
1.) EXPORT macros are used (preferred).
OR
2.) generate_def_files.py can generate .def files for both clang and
MSVC, either manually or as part of the build (unpreferred, since the
script itself is a workaround).
Abseil: Only use Windows .def files with clang

The various .def files used in Windows builds are generated using
llvm-nm and only support being used with the clang compiler. These .def
files can't be used with MSVC, though we are unsure if that's related to
how they are generated by generate_def_files.py or how MSVC consumes
them (i.e. the format it expects for the symbols).

The issue is primarly about the custom libcxx and MSVC's inability to
work correctly with it. //build/config/c++/c++.gni handles this
automatically by disabling the custom libcxx for non-clang (MSVC) builds
by setting use_custom_libcxx = false. However, this causes the .def
symbols to be generated differently (incorrectly), causing link
failures related to too many symbols being exported.

This change helps support using Abseil in ANGLE, particularly standalone
component builds built with MSVC.

This is a workaround until:
1.) EXPORT macros are used (preferred).
OR
2.) generate_def_files.py can generate .def files for both clang and
MSVC, either manually or as part of the build (unpreferred, since the
script itself is a workaround).

Bug: 1126524
Test: Manual verification with standalone ANGLE build
Change-Id: Icf071635938f83818b8345b38074c21f362b897c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2419155
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: default avatarJamie Madill <jmadill@chromium.org>
Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Reviewed-by: default avatarMirko Bonadei <mbonadei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809901}
parent 4012d61d
......@@ -25,7 +25,7 @@ component("absl") {
if (is_component_build) {
public_configs = [ ":absl_component_build" ]
if (is_win) {
if (is_win && is_clang) {
if (current_cpu == "x64") {
if (is_debug) {
sources = [ "symbols_x64_dbg.def" ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment