diff --git a/patch/patch.cfg b/patch/patch.cfg index 9b1de5f11..2dfc559db 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -412,8 +412,8 @@ patches = [ 'name': 'printing_context_2196', }, { - # Windows: Remove llvmlibthin as the combine_libs.py can't handle those. - # https://github.com/chromiumembedded/cef/issues/2470 + # Disable thin archives with cef_sandbox builds. + # https://github.com/chromiumembedded/cef/issues/3674 'name': 'build', }, { diff --git a/patch/patches/build.patch b/patch/patches/build.patch index afd0daf2f..9bd09cb4e 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,13 +1,28 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index bd7dd25175f1e..34f5263fee4fa 100644 +index bd7dd25175f1e..de5b560a8bb3e 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -2182,8 +2182,6 @@ config("thin_archive") { +@@ -138,6 +138,9 @@ declare_args() { + # The cache can lead to non-determinism: https://crbug.com/1486045 + thin_lto_enable_cache = true + ++ # Whether to use thin archives in combination with lld. ++ use_thin_archives = use_lld ++ + # Initialize all local variables with a pattern. This flag will fill + # uninitialized floating-point types (and 32-bit pointers) with 0xFF and the + # rest with 0xAA. This makes behavior of uninitialized memory bugs consistent, +@@ -2180,11 +2183,13 @@ config("export_dynamic") { + config("thin_archive") { + # The macOS and iOS default linker ld64 does not support reading thin # archives. ++ if (use_thin_archives) { if ((is_posix && !is_nacl && (!is_apple || use_lld)) || is_fuchsia) { arflags = [ "-T" ] -- } else if (is_win && use_lld) { -- arflags = [ "/llvmlibthin" ] + } else if (is_win && use_lld) { + arflags = [ "/llvmlibthin" ] } ++ } } + # exceptions ------------------------------------------------------------------- diff --git a/tools/gn_args.py b/tools/gn_args.py index aca2ca569..cc5e2c8c0 100644 --- a/tools/gn_args.py +++ b/tools/gn_args.py @@ -517,6 +517,12 @@ def GetConfigArgsSandbox(platform, args, is_debug, cpu): # Avoid /LTCG linker warnings and generate smaller lib files. 'is_official_build': False, + # Disable use of thin archives with lld. Thin archives contain just the + # symbol table and the path to find the original .o files. They are + # generally incompatible with default platform ld/link versions and + # shouldn't be distributed due to the external .o file dependencies. + 'use_thin_archives': False, + # Enable base target customizations necessary for distribution of the # cef_sandbox static library. 'is_cef_sandbox_build': True,