| # Copyright 2018 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| config("config") { | |
| defines = [ "NO_LIBDEXFILE_SUPPORT" ] | |
| include_dirs = [ | |
| "fuchsia", | |
| "include", | |
| ] | |
| } | |
| config("config_private") { | |
| defines = [ "FUCHSIA" ] | |
| if (is_mac) { | |
| include_dirs = [ target_gen_dir ] | |
| } | |
| } | |
| static_library("libunwindstack") { | |
| public_configs = [ ":config" ] | |
| configs += [ ":config_private" ] | |
| sources = [ | |
| "ArmExidx.cpp", | |
| "DwarfCfa.cpp", | |
| "DwarfEhFrameWithHdr.cpp", | |
| "DwarfMemory.cpp", | |
| "DwarfOp.cpp", | |
| "DwarfSection.cpp", | |
| "Elf.cpp", | |
| "ElfInterface.cpp", | |
| "ElfInterfaceArm.cpp", | |
| "Global.cpp", | |
| "JitDebug.cpp", | |
| "MapInfo.cpp", | |
| "Symbols.cpp", | |
| "Unwinder.cpp", | |
| "fuchsia/LogFuchsia.cpp", | |
| "fuchsia/MapsFuchsia.cpp", | |
| # These files are Android-specific and aren't compiled for Fuchsia. | |
| #"DexFile.cpp", | |
| #"DexFiles.cpp", | |
| #"LocalUnwinder.cpp", | |
| #"Log.cpp", | |
| #"Maps.cpp", | |
| ] | |
| if (current_toolchain != host_toolchain) { | |
| # This project does some locking but doesn't annotate usage. | |
| configs -= [ "//build/config/fuchsia:thread_safety_annotations" ] | |
| sources += [ "fuchsia/MemoryFuchsia.cpp" ] | |
| if (target_cpu == "x64") { | |
| sources += [ "fuchsia/RegsFuchsiaX86_64.cpp" ] | |
| } else if (target_cpu == "arm64") { | |
| sources += [ "fuchsia/RegsFuchsiaArm64.cpp" ] | |
| } | |
| } else { | |
| sources += [ | |
| "Memory.cpp", | |
| "Regs.cpp", | |
| "RegsArm.cpp", | |
| "RegsArm64.cpp", | |
| "RegsMips.cpp", | |
| "RegsMips64.cpp", | |
| "RegsX86.cpp", | |
| "RegsX86_64.cpp", | |
| ] | |
| } | |
| deps = [ "//src/lib/fxl" ] | |
| if (is_mac) { | |
| deps += [ ":copy_elf_h" ] | |
| } | |
| configs += [ | |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings | |
| "//build/config:Wno-conversion", | |
| ] | |
| } | |
| if (is_mac) { | |
| # libunwindstack needs elf.h which doesn't come on Mac. Copy the one out of | |
| # Zircon and use it in this build. | |
| copy("copy_elf_h") { | |
| sources = [ "//zircon/third_party/ulib/musl/include/elf.h" ] | |
| outputs = [ "$target_gen_dir/elf.h" ] | |
| } | |
| } |