• Tim Van Patten's avatar
    Abseil: Only use Windows .def files with clang · 6e043d67
    Tim Van Patten authored
    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}
    6e043d67
BUILD.gn 6.62 KB