Android.bp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. //
  2. // Copyright (C) 2014 The Android Open Source Project
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. cc_defaults {
  17. name: "libbacktrace_common",
  18. cflags: [
  19. "-Wall",
  20. "-Werror",
  21. ],
  22. target: {
  23. darwin: {
  24. enabled: false,
  25. },
  26. },
  27. }
  28. libbacktrace_sources = [
  29. "Backtrace.cpp",
  30. "BacktraceCurrent.cpp",
  31. "BacktracePtrace.cpp",
  32. "ThreadEntry.cpp",
  33. "UnwindStack.cpp",
  34. "UnwindStackMap.cpp",
  35. ]
  36. cc_library_headers {
  37. name: "libbacktrace_headers",
  38. vendor_available: true,
  39. recovery_available: true,
  40. export_include_dirs: ["include"],
  41. }
  42. cc_library {
  43. name: "libbacktrace",
  44. vendor_available: false,
  45. recovery_available: true,
  46. vndk: {
  47. enabled: true,
  48. support_system_process: true,
  49. },
  50. defaults: ["libbacktrace_common"],
  51. host_supported: true,
  52. cflags: [
  53. "-Wexit-time-destructors",
  54. ],
  55. srcs: [
  56. "BacktraceMap.cpp",
  57. ],
  58. export_include_dirs: ["include"],
  59. target: {
  60. darwin: {
  61. enabled: true,
  62. shared_libs: [
  63. "libbase",
  64. ],
  65. },
  66. linux: {
  67. srcs: libbacktrace_sources,
  68. shared_libs: [
  69. "libbase",
  70. "liblog",
  71. "libunwindstack",
  72. ],
  73. static_libs: [
  74. "libprocinfo",
  75. ],
  76. },
  77. android: {
  78. static_libs: ["libasync_safe"],
  79. },
  80. vendor: {
  81. cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
  82. },
  83. recovery: {
  84. cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
  85. },
  86. },
  87. whole_static_libs: ["libdemangle"],
  88. }
  89. cc_test_library {
  90. name: "libbacktrace_test",
  91. defaults: ["libbacktrace_common"],
  92. host_supported: true,
  93. strip: {
  94. none: true,
  95. },
  96. cflags: ["-O0"],
  97. srcs: ["backtrace_testlib.cpp"],
  98. shared_libs: [
  99. "libunwindstack",
  100. ],
  101. relative_install_path: "backtrace_test_libs",
  102. target: {
  103. linux_glibc: {
  104. // This forces the creation of eh_frame with unwind information
  105. // for host.
  106. cflags: [
  107. "-fcxx-exceptions"
  108. ],
  109. },
  110. },
  111. }
  112. //-------------------------------------------------------------------------
  113. // The backtrace_test executable.
  114. //-------------------------------------------------------------------------
  115. cc_test {
  116. name: "backtrace_test",
  117. isolated: true,
  118. defaults: ["libbacktrace_common"],
  119. host_supported: true,
  120. srcs: [
  121. "backtrace_offline_test.cpp",
  122. "backtrace_test.cpp",
  123. ],
  124. cflags: [
  125. "-fno-builtin",
  126. "-O0",
  127. "-g",
  128. ],
  129. shared_libs: [
  130. "libbacktrace",
  131. "libbase",
  132. "liblog",
  133. "libunwindstack",
  134. ],
  135. group_static_libs: true,
  136. // So that the dlopen can find the libbacktrace_test.so.
  137. ldflags: [
  138. "-Wl,--rpath,${ORIGIN}/../backtrace_test_libs",
  139. ],
  140. test_suites: ["device-tests"],
  141. data: [
  142. "testdata/arm/*",
  143. "testdata/arm64/*",
  144. "testdata/x86/*",
  145. "testdata/x86_64/*",
  146. ],
  147. required: [
  148. "libbacktrace_test",
  149. ],
  150. }
  151. cc_benchmark {
  152. name: "backtrace_benchmarks",
  153. defaults: ["libbacktrace_common"],
  154. srcs: [
  155. "backtrace_benchmarks.cpp",
  156. "backtrace_read_benchmarks.cpp",
  157. ],
  158. shared_libs: [
  159. "libbacktrace",
  160. "libbase",
  161. "libunwindstack",
  162. ],
  163. }