# Copyright 2017 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//build/config/c++/c++.gni") config("libunwind_config") { defines = [ "_LIBUNWIND_IS_NATIVE_ONLY" ] cflags = [ "-fstrict-aliasing", "-fPIC", # ValueAsBitPattern in Unwind-EHABI.cpp is only used on Debug builds. "-Wno-unused-function", # libunwind expects to be compiled with unwind tables so it can # unwind its own frames. "-funwind-tables", ] } # TODO(crbug.com/40273848): Move this build file to third_party/libc++/BUILD.gn once submodule migration is done source_set("libunwind") { visibility = [ "//buildtools/third_party/libc++abi" ] if (is_android) { visibility += [ "//services/tracing/public/cpp" ] } if (!is_component_build) { defines = [ "_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS" ] } include_dirs = [ "//third_party/libunwind/src/include" ] sources = [ # C++ sources "//third_party/libunwind/src/src/Unwind-EHABI.cpp", "//third_party/libunwind/src/src/libunwind.cpp", # C sources "//third_party/libunwind/src/src/Unwind-sjlj.c", "//third_party/libunwind/src/src/UnwindLevel1-gcc-ext.c", "//third_party/libunwind/src/src/UnwindLevel1.c", # ASM sources "//third_party/libunwind/src/src/UnwindRegistersRestore.S", "//third_party/libunwind/src/src/UnwindRegistersSave.S", ] configs -= [ "//build/config/compiler:chromium_code", "//build/config/compiler:no_exceptions", "//build/config/compiler:no_rtti", "//build/config/coverage:default_coverage", "//build/config/compiler:default_optimization", ] configs += [ "//build/config/compiler:no_chromium_code", "//build/config/compiler:exceptions", "//build/config/compiler:rtti", "//build/config/compiler:optimize_speed", # Must be after no_chromium_code ":libunwind_config", ] }