pf2 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -1
  3. data/README.md +9 -4
  4. data/Rakefile +3 -9
  5. data/doc/development.md +6 -0
  6. data/ext/pf2/debug.h +12 -0
  7. data/ext/pf2/extconf.rb +23 -6
  8. data/ext/{pf2c → pf2}/sample.c +6 -0
  9. data/ext/{pf2c → pf2}/sample.h +4 -0
  10. data/ext/{pf2c → pf2}/serializer.c +1 -1
  11. data/ext/{pf2c → pf2}/session.c +93 -29
  12. data/ext/{pf2c → pf2}/session.h +6 -1
  13. data/lib/pf2/cli.rb +3 -11
  14. data/lib/pf2/reporter/firefox_profiler_ser2.rb +17 -13
  15. data/lib/pf2/reporter/stack_weaver.rb +8 -0
  16. data/lib/pf2/reporter.rb +0 -1
  17. data/lib/pf2/version.rb +1 -1
  18. data/lib/pf2.rb +1 -1
  19. metadata +25 -128
  20. data/Cargo.lock +0 -630
  21. data/Cargo.toml +0 -3
  22. data/crates/backtrace-sys2/.gitignore +0 -1
  23. data/crates/backtrace-sys2/Cargo.toml +0 -9
  24. data/crates/backtrace-sys2/build.rs +0 -45
  25. data/crates/backtrace-sys2/src/lib.rs +0 -5
  26. data/crates/backtrace-sys2/src/libbacktrace/.gitignore +0 -15
  27. data/crates/backtrace-sys2/src/libbacktrace/Isaac.Newton-Opticks.txt +0 -9286
  28. data/crates/backtrace-sys2/src/libbacktrace/LICENSE +0 -29
  29. data/crates/backtrace-sys2/src/libbacktrace/Makefile.am +0 -708
  30. data/crates/backtrace-sys2/src/libbacktrace/Makefile.in +0 -2820
  31. data/crates/backtrace-sys2/src/libbacktrace/README.md +0 -46
  32. data/crates/backtrace-sys2/src/libbacktrace/aclocal.m4 +0 -864
  33. data/crates/backtrace-sys2/src/libbacktrace/alloc.c +0 -167
  34. data/crates/backtrace-sys2/src/libbacktrace/allocfail.c +0 -136
  35. data/crates/backtrace-sys2/src/libbacktrace/allocfail.sh +0 -104
  36. data/crates/backtrace-sys2/src/libbacktrace/atomic.c +0 -113
  37. data/crates/backtrace-sys2/src/libbacktrace/backtrace-supported.h.in +0 -66
  38. data/crates/backtrace-sys2/src/libbacktrace/backtrace.c +0 -129
  39. data/crates/backtrace-sys2/src/libbacktrace/backtrace.h +0 -189
  40. data/crates/backtrace-sys2/src/libbacktrace/btest.c +0 -517
  41. data/crates/backtrace-sys2/src/libbacktrace/compile +0 -348
  42. data/crates/backtrace-sys2/src/libbacktrace/config/enable.m4 +0 -38
  43. data/crates/backtrace-sys2/src/libbacktrace/config/lead-dot.m4 +0 -31
  44. data/crates/backtrace-sys2/src/libbacktrace/config/libtool.m4 +0 -7545
  45. data/crates/backtrace-sys2/src/libbacktrace/config/ltoptions.m4 +0 -369
  46. data/crates/backtrace-sys2/src/libbacktrace/config/ltsugar.m4 +0 -123
  47. data/crates/backtrace-sys2/src/libbacktrace/config/ltversion.m4 +0 -23
  48. data/crates/backtrace-sys2/src/libbacktrace/config/lt~obsolete.m4 +0 -98
  49. data/crates/backtrace-sys2/src/libbacktrace/config/multi.m4 +0 -68
  50. data/crates/backtrace-sys2/src/libbacktrace/config/override.m4 +0 -117
  51. data/crates/backtrace-sys2/src/libbacktrace/config/unwind_ipinfo.m4 +0 -37
  52. data/crates/backtrace-sys2/src/libbacktrace/config/warnings.m4 +0 -227
  53. data/crates/backtrace-sys2/src/libbacktrace/config.guess +0 -1700
  54. data/crates/backtrace-sys2/src/libbacktrace/config.h.in +0 -185
  55. data/crates/backtrace-sys2/src/libbacktrace/config.sub +0 -1885
  56. data/crates/backtrace-sys2/src/libbacktrace/configure +0 -15929
  57. data/crates/backtrace-sys2/src/libbacktrace/configure.ac +0 -632
  58. data/crates/backtrace-sys2/src/libbacktrace/dwarf.c +0 -4409
  59. data/crates/backtrace-sys2/src/libbacktrace/edtest.c +0 -120
  60. data/crates/backtrace-sys2/src/libbacktrace/edtest2.c +0 -43
  61. data/crates/backtrace-sys2/src/libbacktrace/elf.c +0 -7465
  62. data/crates/backtrace-sys2/src/libbacktrace/fileline.c +0 -407
  63. data/crates/backtrace-sys2/src/libbacktrace/filenames.h +0 -52
  64. data/crates/backtrace-sys2/src/libbacktrace/filetype.awk +0 -13
  65. data/crates/backtrace-sys2/src/libbacktrace/install-debuginfo-for-buildid.sh.in +0 -65
  66. data/crates/backtrace-sys2/src/libbacktrace/install-sh +0 -501
  67. data/crates/backtrace-sys2/src/libbacktrace/instrumented_alloc.c +0 -114
  68. data/crates/backtrace-sys2/src/libbacktrace/internal.h +0 -428
  69. data/crates/backtrace-sys2/src/libbacktrace/ltmain.sh +0 -8636
  70. data/crates/backtrace-sys2/src/libbacktrace/macho.c +0 -1361
  71. data/crates/backtrace-sys2/src/libbacktrace/missing +0 -215
  72. data/crates/backtrace-sys2/src/libbacktrace/mmap.c +0 -331
  73. data/crates/backtrace-sys2/src/libbacktrace/mmapio.c +0 -110
  74. data/crates/backtrace-sys2/src/libbacktrace/move-if-change +0 -83
  75. data/crates/backtrace-sys2/src/libbacktrace/mtest.c +0 -410
  76. data/crates/backtrace-sys2/src/libbacktrace/nounwind.c +0 -66
  77. data/crates/backtrace-sys2/src/libbacktrace/pecoff.c +0 -1123
  78. data/crates/backtrace-sys2/src/libbacktrace/posix.c +0 -104
  79. data/crates/backtrace-sys2/src/libbacktrace/print.c +0 -117
  80. data/crates/backtrace-sys2/src/libbacktrace/read.c +0 -110
  81. data/crates/backtrace-sys2/src/libbacktrace/simple.c +0 -108
  82. data/crates/backtrace-sys2/src/libbacktrace/sort.c +0 -108
  83. data/crates/backtrace-sys2/src/libbacktrace/state.c +0 -72
  84. data/crates/backtrace-sys2/src/libbacktrace/stest.c +0 -137
  85. data/crates/backtrace-sys2/src/libbacktrace/test-driver +0 -148
  86. data/crates/backtrace-sys2/src/libbacktrace/test_format.c +0 -55
  87. data/crates/backtrace-sys2/src/libbacktrace/testlib.c +0 -234
  88. data/crates/backtrace-sys2/src/libbacktrace/testlib.h +0 -110
  89. data/crates/backtrace-sys2/src/libbacktrace/ttest.c +0 -161
  90. data/crates/backtrace-sys2/src/libbacktrace/unittest.c +0 -92
  91. data/crates/backtrace-sys2/src/libbacktrace/unknown.c +0 -65
  92. data/crates/backtrace-sys2/src/libbacktrace/xcoff.c +0 -1617
  93. data/crates/backtrace-sys2/src/libbacktrace/xztest.c +0 -508
  94. data/crates/backtrace-sys2/src/libbacktrace/zstdtest.c +0 -523
  95. data/crates/backtrace-sys2/src/libbacktrace/ztest.c +0 -541
  96. data/ext/pf2/Cargo.toml +0 -25
  97. data/ext/pf2/build.rs +0 -10
  98. data/ext/pf2/src/backtrace.rs +0 -127
  99. data/ext/pf2/src/lib.rs +0 -22
  100. data/ext/pf2/src/profile.rs +0 -69
  101. data/ext/pf2/src/profile_serializer.rs +0 -241
  102. data/ext/pf2/src/ringbuffer.rs +0 -150
  103. data/ext/pf2/src/ruby_c_api_helper.c +0 -6
  104. data/ext/pf2/src/ruby_init.rs +0 -40
  105. data/ext/pf2/src/ruby_internal_apis.rs +0 -77
  106. data/ext/pf2/src/sample.rs +0 -67
  107. data/ext/pf2/src/scheduler.rs +0 -10
  108. data/ext/pf2/src/serialization/profile.rs +0 -48
  109. data/ext/pf2/src/serialization/serializer.rs +0 -329
  110. data/ext/pf2/src/serialization.rs +0 -2
  111. data/ext/pf2/src/session/configuration.rs +0 -114
  112. data/ext/pf2/src/session/new_thread_watcher.rs +0 -80
  113. data/ext/pf2/src/session/ruby_object.rs +0 -90
  114. data/ext/pf2/src/session.rs +0 -248
  115. data/ext/pf2/src/siginfo_t.c +0 -5
  116. data/ext/pf2/src/signal_scheduler.rs +0 -201
  117. data/ext/pf2/src/signal_scheduler_unsupported_platform.rs +0 -39
  118. data/ext/pf2/src/timer_thread_scheduler.rs +0 -179
  119. data/ext/pf2/src/util.rs +0 -31
  120. data/ext/pf2c/extconf.rb +0 -21
  121. data/lib/pf2/reporter/firefox_profiler.rb +0 -397
  122. data/rust-toolchain.toml +0 -2
  123. data/rustfmt.toml +0 -1
  124. /data/ext/{pf2c → pf2}/backtrace_state.c +0 -0
  125. /data/ext/{pf2c → pf2}/backtrace_state.h +0 -0
  126. /data/ext/{pf2c → pf2}/configuration.c +0 -0
  127. /data/ext/{pf2c → pf2}/configuration.h +0 -0
  128. /data/ext/{pf2c → pf2}/pf2.c +0 -0
  129. /data/ext/{pf2c → pf2}/pf2.h +0 -0
  130. /data/ext/{pf2c → pf2}/ringbuffer.c +0 -0
  131. /data/ext/{pf2c → pf2}/ringbuffer.h +0 -0
  132. /data/ext/{pf2c → pf2}/serializer.h +0 -0
@@ -1,632 +0,0 @@
1
- # configure.ac -- Backtrace configure script.
2
- # Copyright (C) 2012-2024 Free Software Foundation, Inc.
3
-
4
- # Redistribution and use in source and binary forms, with or without
5
- # modification, are permitted provided that the following conditions are
6
- # met:
7
-
8
- # (1) Redistributions of source code must retain the above copyright
9
- # notice, this list of conditions and the following disclaimer.
10
-
11
- # (2) Redistributions in binary form must reproduce the above copyright
12
- # notice, this list of conditions and the following disclaimer in
13
- # the documentation and/or other materials provided with the
14
- # distribution.
15
-
16
- # (3) The name of the author may not be used to
17
- # endorse or promote products derived from this software without
18
- # specific prior written permission.
19
-
20
- # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
- # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
- # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
24
- # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
- # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
- # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
- # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
- # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29
- # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
- # POSSIBILITY OF SUCH DAMAGE.
31
-
32
- AC_PREREQ(2.69)
33
- AC_INIT(package-unused, version-unused,, libbacktrace)
34
- AC_CONFIG_SRCDIR(backtrace.h)
35
- AC_CONFIG_HEADER(config.h)
36
- AC_CONFIG_MACRO_DIR(config)
37
-
38
- # with_target_subdir is used when configured as part of a GCC tree.
39
- if test -n "${with_target_subdir}"; then
40
- AM_ENABLE_MULTILIB(, ..)
41
- fi
42
-
43
- AC_CANONICAL_SYSTEM
44
- target_alias=${target_alias-$host_alias}
45
-
46
- AC_USE_SYSTEM_EXTENSIONS
47
-
48
- # Default to not building a shared library.
49
- AC_DISABLE_SHARED
50
-
51
- libtool_VERSION=1:0:0
52
- AC_SUBST(libtool_VERSION)
53
-
54
- # 1.11.1: Require that version of automake.
55
- # foreign: Don't require README, INSTALL, NEWS, etc.
56
- # no-define: Don't define PACKAGE and VERSION.
57
- # no-dependencies: Don't generate automatic dependencies.
58
- # (because it breaks when using bootstrap-lean, since some of the
59
- # headers are gone at "make install" time).
60
- # -Wall: Issue all automake warnings.
61
- # -Wno-portability: Don't warn about constructs supported by GNU make.
62
- # (because GCC requires GNU make anyhow).
63
- AM_INIT_AUTOMAKE([1.11.1 foreign no-dist no-define no-dependencies -Wall -Wno-portability])
64
-
65
- AM_MAINTAINER_MODE
66
-
67
- AC_ARG_WITH(target-subdir,
68
- [ --with-target-subdir=SUBDIR Configuring in a subdirectory for target])
69
-
70
- # We must force CC to /not/ be precious variables; otherwise
71
- # the wrong, non-multilib-adjusted value will be used in multilibs.
72
- # As a side effect, we have to subst CFLAGS ourselves.
73
- m4_rename([_AC_ARG_VAR_PRECIOUS],[backtrace_PRECIOUS])
74
- m4_define([_AC_ARG_VAR_PRECIOUS],[])
75
- AC_PROG_CC
76
- m4_rename_force([backtrace_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
77
-
78
- AC_SUBST(CFLAGS)
79
-
80
- AC_PROG_RANLIB
81
-
82
- AC_PROG_AWK
83
- case "$AWK" in
84
- "") AC_MSG_ERROR([can't build without awk]) ;;
85
- esac
86
-
87
- AC_CHECK_PROG(DWZ, dwz, dwz)
88
- AM_CONDITIONAL(HAVE_DWZ, test "$DWZ" != "")
89
-
90
- LT_INIT
91
- AM_PROG_LIBTOOL
92
-
93
- AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes])
94
-
95
- AC_SYS_LARGEFILE
96
-
97
- backtrace_supported=yes
98
-
99
- if test -n "${with_target_subdir}"; then
100
- # We are compiling a GCC library. We can assume that the unwind
101
- # library exists.
102
- BACKTRACE_FILE="backtrace.lo simple.lo"
103
- else
104
- AC_CHECK_HEADER([unwind.h],
105
- [AC_CHECK_FUNC([_Unwind_Backtrace],
106
- [BACKTRACE_FILE="backtrace.lo simple.lo"],
107
- [BACKTRACE_FILE="nounwind.lo"
108
- backtrace_supported=no])],
109
- [BACKTRACE_FILE="nounwind.lo"
110
- backtrace_supported=no])
111
- fi
112
- AC_SUBST(BACKTRACE_FILE)
113
-
114
- EXTRA_FLAGS=
115
- if test -n "${with_target_subdir}"; then
116
- EXTRA_FLAGS="-funwind-tables -frandom-seed=\$@"
117
- else
118
- AC_CACHE_CHECK([for -funwind-tables option],
119
- [libbacktrace_cv_c_unwind_tables],
120
- [CFLAGS_hold="$CFLAGS"
121
- CFLAGS="$CFLAGS -funwind-tables"
122
- AC_COMPILE_IFELSE(
123
- [AC_LANG_PROGRAM([static int f() { return 0; }], [return f();])],
124
- [libbacktrace_cv_c_unwind_tables=yes],
125
- [libbacktrace_cv_c_unwind_tables=no])
126
- CFLAGS="$CFLAGS_hold"])
127
- if test "$libbacktrace_cv_c_unwind_tables" = "yes"; then
128
- EXTRA_FLAGS=-funwind-tables
129
- fi
130
- AC_CACHE_CHECK([for -frandom-seed=string option],
131
- [libbacktrace_cv_c_random_seed_string],
132
- [CFLAGS_hold="$CFLAGS"
133
- CFLAGS="$CFLAGS -frandom-seed=conftest.lo"
134
- AC_COMPILE_IFELSE(
135
- [AC_LANG_PROGRAM([], [return 0;])],
136
- [libbacktrace_cv_c_random_seed_string=yes],
137
- [libbacktrace_cv_c_random_seed_string=no])
138
- CFLAGS="$CFLAGS_hold"])
139
- if test "$libbacktrace_cv_c_random_seed_string" = "yes"; then
140
- EXTRA_FLAGS="$EXTRA_FLAGS -frandom-seed=\$@"
141
- fi
142
- fi
143
- AC_SUBST(EXTRA_FLAGS)
144
-
145
- ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
146
- -Wmissing-prototypes -Wold-style-definition \
147
- -Wmissing-format-attribute -Wcast-qual \
148
- -Wno-attributes -Wno-unknown-attributes \
149
- -Wpointer-arith],
150
- [WARN_FLAGS])
151
-
152
- AC_ARG_ENABLE([werror],
153
- [AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
154
- AS_IF([test "x$enable_werror" != "xno" && test -n "${with_target_subdir}"],
155
- [WARN_FLAGS="$WARN_FLAGS -Werror"])
156
-
157
- AC_SUBST(WARN_FLAGS)
158
-
159
- if test -n "${with_target_subdir}"; then
160
- GCC_CHECK_UNWIND_GETIPINFO
161
- else
162
- ac_save_CFFLAGS="$CFLAGS"
163
- CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
164
- AC_MSG_CHECKING([for _Unwind_GetIPInfo])
165
- AC_LINK_IFELSE(
166
- [AC_LANG_PROGRAM(
167
- [#include "unwind.h"
168
- struct _Unwind_Context *context;
169
- int ip_before_insn = 0;],
170
- [return _Unwind_GetIPInfo (context, &ip_before_insn);])],
171
- [have_unwind_getipinfo=yes], [have_unwind_getipinfo=no])
172
- CFLAGS="$ac_save_CFLAGS"
173
- AC_MSG_RESULT([$have_unwind_getipinfo])
174
- if test "$have_unwind_getipinfo" = "yes"; then
175
- AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.])
176
- fi
177
- fi
178
-
179
- # Enable --enable-host-shared.
180
- AC_ARG_ENABLE(host-shared,
181
- [AS_HELP_STRING([--enable-host-shared],
182
- [build host code as shared libraries])],
183
- [PIC_FLAG=-fPIC], [PIC_FLAG=])
184
- AC_SUBST(PIC_FLAG)
185
-
186
- # Test for __sync support.
187
- AC_CACHE_CHECK([__sync extensions],
188
- [libbacktrace_cv_sys_sync],
189
- [if test -n "${with_target_subdir}"; then
190
- case "${host}" in
191
- hppa*-*-hpux*) libbacktrace_cv_sys_sync=no ;;
192
- *) libbacktrace_cv_sys_sync=yes ;;
193
- esac
194
- else
195
- AC_LINK_IFELSE(
196
- [AC_LANG_PROGRAM([int i;],
197
- [__sync_bool_compare_and_swap (&i, i, i);
198
- __sync_lock_test_and_set (&i, 1);
199
- __sync_lock_release (&i);])],
200
- [libbacktrace_cv_sys_sync=yes],
201
- [libbacktrace_cv_sys_sync=no])
202
- fi])
203
- BACKTRACE_SUPPORTS_THREADS=0
204
- if test "$libbacktrace_cv_sys_sync" = "yes"; then
205
- BACKTRACE_SUPPORTS_THREADS=1
206
- AC_DEFINE([HAVE_SYNC_FUNCTIONS], 1,
207
- [Define to 1 if you have the __sync functions])
208
- fi
209
- AC_SUBST(BACKTRACE_SUPPORTS_THREADS)
210
-
211
- # Test for __atomic support.
212
- AC_CACHE_CHECK([__atomic extensions],
213
- [libbacktrace_cv_sys_atomic],
214
- [if test -n "${with_target_subdir}"; then
215
- libbacktrace_cv_sys_atomic=yes
216
- else
217
- AC_LINK_IFELSE(
218
- [AC_LANG_PROGRAM([int i;],
219
- [__atomic_load_n (&i, __ATOMIC_ACQUIRE);
220
- __atomic_store_n (&i, 1, __ATOMIC_RELEASE);])],
221
- [libbacktrace_cv_sys_atomic=yes],
222
- [libbacktrace_cv_sys_atomic=no])
223
- fi])
224
- if test "$libbacktrace_cv_sys_atomic" = "yes"; then
225
- AC_DEFINE([HAVE_ATOMIC_FUNCTIONS], 1,
226
- [Define to 1 if you have the __atomic functions])
227
- fi
228
-
229
- # The library needs to be able to read the executable itself. Compile
230
- # a file to determine the executable format. The awk script
231
- # filetype.awk prints out the file type.
232
- AC_CACHE_CHECK([output filetype],
233
- [libbacktrace_cv_sys_filetype],
234
- [filetype=
235
- AC_COMPILE_IFELSE(
236
- [AC_LANG_PROGRAM([int i;], [int j;])],
237
- [filetype=`${AWK} -f $srcdir/filetype.awk conftest.$ac_objext`],
238
- [AC_MSG_FAILURE([compiler failed])])
239
- libbacktrace_cv_sys_filetype=$filetype])
240
-
241
- # Match the file type to decide what files to compile.
242
- FORMAT_FILE=
243
- backtrace_supports_data=yes
244
- case "$libbacktrace_cv_sys_filetype" in
245
- elf*) FORMAT_FILE="elf.lo" ;;
246
- macho) FORMAT_FILE="macho.lo" ;;
247
- pecoff) FORMAT_FILE="pecoff.lo"
248
- backtrace_supports_data=no
249
- ;;
250
- xcoff*) FORMAT_FILE="xcoff.lo"
251
- backtrace_supports_data=no
252
- ;;
253
- *) AC_MSG_WARN([could not determine output file type])
254
- FORMAT_FILE="unknown.lo"
255
- backtrace_supported=no
256
- ;;
257
- esac
258
- AC_SUBST(FORMAT_FILE)
259
-
260
- # ELF defines.
261
- elfsize=
262
- case "$libbacktrace_cv_sys_filetype" in
263
- elf32) elfsize=32 ;;
264
- elf64) elfsize=64 ;;
265
- *) elfsize=unused
266
- esac
267
- AC_DEFINE_UNQUOTED([BACKTRACE_ELF_SIZE], [$elfsize], [ELF size: 32 or 64])
268
- AM_CONDITIONAL(HAVE_ELF, test "$FORMAT_FILE" = "elf.lo")
269
-
270
- # XCOFF defines.
271
- xcoffsize=
272
- case "$libbacktrace_cv_sys_filetype" in
273
- xcoff32) xcoffsize=32 ;;
274
- xcoff64) xcoffsize=64 ;;
275
- *) xcoffsize=unused
276
- esac
277
- AC_DEFINE_UNQUOTED([BACKTRACE_XCOFF_SIZE], [$xcoffsize], [XCOFF size: 32 or 64])
278
-
279
- BACKTRACE_SUPPORTED=0
280
- if test "$backtrace_supported" = "yes"; then
281
- BACKTRACE_SUPPORTED=1
282
- fi
283
- AC_SUBST(BACKTRACE_SUPPORTED)
284
-
285
- BACKTRACE_SUPPORTS_DATA=0
286
- if test "$backtrace_supports_data" = "yes"; then
287
- BACKTRACE_SUPPORTS_DATA=1
288
- fi
289
- AC_SUBST(BACKTRACE_SUPPORTS_DATA)
290
-
291
- AC_CHECK_HEADERS(sys/mman.h)
292
- if test "$ac_cv_header_sys_mman_h" = "no"; then
293
- have_mmap=no
294
- else
295
- if test -n "${with_target_subdir}"; then
296
- # When built as a GCC target library, we can't do a link test. We
297
- # simply assume that if we have mman.h, we have mmap.
298
- have_mmap=yes
299
- case "${host}" in
300
- spu-*-*|*-*-msdosdjgpp)
301
- # The SPU does not have mmap, but it has a sys/mman.h header file
302
- # containing "mmap_eaddr" and the mmap flags, confusing the test.
303
- # DJGPP also has sys/man.h, but no mmap
304
- have_mmap=no ;;
305
- esac
306
- else
307
- AC_CHECK_FUNC(mmap, [have_mmap=yes], [have_mmap=no])
308
- fi
309
- fi
310
- if test "$have_mmap" = "no"; then
311
- VIEW_FILE=read.lo
312
- ALLOC_FILE=alloc.lo
313
- else
314
- VIEW_FILE=mmapio.lo
315
- AC_PREPROC_IFELSE([AC_LANG_SOURCE([
316
- #include <sys/mman.h>
317
- #if !defined(MAP_ANONYMOUS) && !defined(MAP_ANON)
318
- #error no MAP_ANONYMOUS
319
- #endif
320
- ])], [ALLOC_FILE=mmap.lo], [ALLOC_FILE=alloc.lo])
321
- fi
322
- AC_SUBST(VIEW_FILE)
323
- AC_SUBST(ALLOC_FILE)
324
-
325
- BACKTRACE_USES_MALLOC=0
326
- if test "$ALLOC_FILE" = "alloc.lo"; then
327
- BACKTRACE_USES_MALLOC=1
328
- fi
329
- AC_SUBST(BACKTRACE_USES_MALLOC)
330
-
331
- # Check for dl_iterate_phdr.
332
- AC_CHECK_HEADERS(link.h sys/link.h)
333
- if test "$ac_cv_header_link_h" = "no" -a "$ac_cv_header_sys_link_h" = "no"; then
334
- have_dl_iterate_phdr=no
335
- else
336
- if test -n "${with_target_subdir}"; then
337
- link_h=link.h
338
- if test "$ac_cv_header_link_h" = "no"; then
339
- link_h=sys/link.h
340
- fi
341
- # When built as a GCC target library, we can't do a link test.
342
- AC_EGREP_HEADER([dl_iterate_phdr], [$link_h], [have_dl_iterate_phdr=yes],
343
- [have_dl_iterate_phdr=no])
344
- case "${host}" in
345
- *-*-solaris2.10*)
346
- # Avoid dl_iterate_phdr on Solaris 10, where it is in the
347
- # header file but is only in -ldl.
348
- have_dl_iterate_phdr=no ;;
349
- esac
350
- else
351
- AC_CHECK_FUNC([dl_iterate_phdr], [have_dl_iterate_phdr=yes],
352
- [have_dl_iterate_phdr=no])
353
- fi
354
- fi
355
- if test "$have_dl_iterate_phdr" = "yes"; then
356
- AC_DEFINE(HAVE_DL_ITERATE_PHDR, 1, [Define if dl_iterate_phdr is available.])
357
- fi
358
-
359
- # Check for header file for Mach-O image functions.
360
- AC_CHECK_HEADERS(mach-o/dyld.h)
361
-
362
- # Check for loadquery.
363
- AC_CHECK_HEADERS(sys/ldr.h)
364
- if test "$ac_cv_header_sys_ldr_h" = "no"; then
365
- have_loadquery=no
366
- else
367
- if test -n "${with_target_subdir}"; then
368
- # When built as a GCC target library, we can't do a link test.
369
- AC_EGREP_HEADER([loadquery], [sys/ldr.h], [have_loadquery=yes],
370
- [have_loadquery=no])
371
- else
372
- AC_CHECK_FUNC([loadquery], [have_loadquery=yes],
373
- [have_loadquery=no])
374
- fi
375
- fi
376
- if test "$have_loadquery" = "yes"; then
377
- AC_DEFINE(HAVE_LOADQUERY, 1, [Define if AIX loadquery is available.])
378
- fi
379
-
380
- AC_CHECK_HEADERS(windows.h)
381
- AC_CHECK_HEADERS(tlhelp32.h, [], [],
382
- [#ifdef HAVE_WINDOWS_H
383
- # include <windows.h>
384
- #endif])
385
-
386
- # Check for the fcntl function.
387
- if test -n "${with_target_subdir}"; then
388
- case "${host}" in
389
- *-*-mingw*) have_fcntl=no ;;
390
- spu-*-*) have_fcntl=no ;;
391
- *) have_fcntl=yes ;;
392
- esac
393
- else
394
- AC_CHECK_FUNC(fcntl, [have_fcntl=yes], [have_fcntl=no])
395
- fi
396
- if test "$have_fcntl" = "yes"; then
397
- AC_DEFINE([HAVE_FCNTL], 1,
398
- [Define to 1 if you have the fcntl function])
399
- fi
400
-
401
- AC_CHECK_DECLS([strnlen, getpagesize])
402
- AC_CHECK_FUNCS(lstat readlink)
403
-
404
- # Check for getexecname function.
405
- if test -n "${with_target_subdir}"; then
406
- case "${host}" in
407
- *-*-solaris2*) have_getexecname=yes ;;
408
- *) have_getexecname=no ;;
409
- esac
410
- else
411
- AC_CHECK_FUNC(getexecname, [have_getexecname=yes], [have_getexecname=no])
412
- fi
413
- if test "$have_getexecname" = "yes"; then
414
- AC_DEFINE(HAVE_GETEXECNAME, 1, [Define if getexecname is available.])
415
- fi
416
-
417
- # Check for _pgmptr variable, contains the executable filename on windows
418
- AC_CHECK_DECLS([_pgmptr])
419
-
420
- # Check for sysctl definitions.
421
-
422
- AC_CACHE_CHECK([for KERN_PROC],
423
- [libbacktrace_cv_proc],
424
- [AC_COMPILE_IFELSE(
425
- [AC_LANG_PROGRAM([
426
- #include <sys/types.h>
427
- #include <sys/sysctl.h>
428
- ], [int mib0 = CTL_KERN; int mib1 = KERN_PROC; int mib2 = KERN_PROC_PATHNAME;])],
429
- [libbacktrace_cv_proc=yes],
430
- [libbacktrace_cv_proc=no])])
431
- if test "$libbacktrace_cv_proc" = "yes"; then
432
- AC_DEFINE([HAVE_KERN_PROC], 1,
433
- [Define to 1 if you have KERN_PROC and KERN_PROC_PATHNAME in <sys/sysctl.h>.])
434
- fi
435
-
436
- AC_CACHE_CHECK([for KERN_PROG_ARGS],
437
- [libbacktrace_cv_procargs],
438
- [AC_COMPILE_IFELSE(
439
- [AC_LANG_PROGRAM([
440
- #include <sys/types.h>
441
- #include <sys/sysctl.h>
442
- ], [int mib0 = CTL_KERN; int mib1 = KERN_PROC_ARGS; int mib2 = KERN_PROC_PATHNAME;])],
443
- [libbacktrace_cv_procargs=yes],
444
- [libbacktrace_cv_procargs=no])])
445
- if test "$libbacktrace_cv_procargs" = "yes"; then
446
- AC_DEFINE([HAVE_KERN_PROC_ARGS], 1,
447
- [Define to 1 if you have KERN_PROCARGS and KERN_PROC_PATHNAME in <sys/sysctl.h>.])
448
- fi
449
-
450
- # Check for the clock_gettime function.
451
- AC_CHECK_FUNCS(clock_gettime)
452
- clock_gettime_link=
453
- # At least for glibc, clock_gettime is in librt. But don't
454
- # pull that in if it still doesn't give us the function we want. This
455
- # test is copied from libgomp, and modified to not link in -lrt as
456
- # we're using this for test timing only.
457
- if test "$ac_cv_func_clock_gettime" = no; then
458
- AC_CHECK_LIB(rt, clock_gettime,
459
- [CLOCK_GETTIME_LINK=-lrt
460
- AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
461
- [Define to 1 if you have the `clock_gettime' function.])])
462
- fi
463
- AC_SUBST(CLOCK_GETTIME_LINK)
464
-
465
- dnl Test whether the compiler supports the -pthread option.
466
- AC_CACHE_CHECK([whether -pthread is supported],
467
- [libgo_cv_lib_pthread],
468
- [CFLAGS_hold=$CFLAGS
469
- CFLAGS="$CFLAGS -pthread"
470
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
471
- [libgo_cv_lib_pthread=yes],
472
- [libgo_cv_lib_pthread=no])
473
- CFLAGS=$CFLAGS_hold])
474
- PTHREAD_CFLAGS=
475
- if test "$libgo_cv_lib_pthread" = yes; then
476
- PTHREAD_CFLAGS=-pthread
477
- fi
478
- AC_SUBST(PTHREAD_CFLAGS)
479
-
480
- AM_CONDITIONAL(HAVE_PTHREAD, test "$libgo_cv_lib_pthread" = yes)
481
-
482
- dnl Test whether the compiler and the linker support the -gdwarf-5 option.
483
- AC_CACHE_CHECK([whether -gdwarf-5 is supported],
484
- [libbacktrace_cv_lib_dwarf5],
485
- [CFLAGS_hold=$CFLAGS
486
- CFLAGS="$CFLAGS -gdwarf-5"
487
- AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;], [return 0;])],
488
- [libbacktrace_cv_lib_dwarf5=yes],
489
- [libbacktrace_cv_lib_dwarf5=no])
490
- CFLAGS=$CFLAGS_hold])
491
- AM_CONDITIONAL(HAVE_DWARF5, test "$libbacktrace_cv_lib_dwarf5" = yes)
492
-
493
- AC_CHECK_LIB([z], [compress],
494
- [AC_DEFINE(HAVE_ZLIB, 1, [Define if -lz is available.])])
495
- AM_CONDITIONAL(HAVE_ZLIB, test "$ac_cv_lib_z_compress" = yes)
496
-
497
- dnl Test whether the linker supports the --build-id option.
498
- AC_CACHE_CHECK([whether --build-id is supported],
499
- [libbacktrace_cv_ld_buildid],
500
- [LDFLAGS_hold=$LDFLAGS
501
- LDFLAGS="$LDFLAGS -Wl,--build-id"
502
- AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
503
- [libbacktrace_cv_ld_buildid=yes],
504
- [libbacktrace_cv_ld_buildid=no])
505
- LDFLAGS=$LDFLAGS_hold])
506
- AM_CONDITIONAL(HAVE_BUILDID, test "$libbacktrace_cv_ld_buildid" = yes)
507
-
508
- dnl Test whether the linker supports the --compress-debug-sections=zlib-gnu
509
- dnl option.
510
- AC_CACHE_CHECK([whether --compress-debug-sections=zlib-gnu is supported],
511
- [libgo_cv_ld_compress_zlib_gnu],
512
- [LDFLAGS_hold=$LDFLAGS
513
- LDFLAGS="$LDFLAGS -Wl,--compress-debug-sections=zlib-gnu"
514
- AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
515
- [libgo_cv_ld_compress_zlib_gnu=yes],
516
- [libgo_cv_ld_compress_zlib_gnu=no])
517
- LDFLAGS=$LDFLAGS_hold])
518
- AM_CONDITIONAL(HAVE_COMPRESSED_DEBUG_ZLIB_GNU, test "$libgo_cv_ld_compress_zlib_gnu" = yes)
519
-
520
- AC_CACHE_CHECK([whether --compress-debug-sections=zlib-gabi is supported],
521
- [libgo_cv_ld_compress_zlib_gabi],
522
- [LDFLAGS_hold=$LDFLAGS
523
- LDFLAGS="$LDFLAGS -Wl,--compress-debug-sections=zlib-gabi"
524
- AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
525
- [libgo_cv_ld_compress_zlib_gabi=yes],
526
- [libgo_cv_ld_compress_zlib_gabi=no])
527
- LDFLAGS=$LDFLAGS_hold])
528
- AM_CONDITIONAL(HAVE_COMPRESSED_DEBUG_ZLIB_GABI, test "$libgo_cv_ld_compress_zlib_gabi" = yes)
529
-
530
- AC_CHECK_LIB([zstd], [ZSTD_compress],
531
- [AC_DEFINE(HAVE_ZSTD, 1, [Define if -lzstd is available.])])
532
- AM_CONDITIONAL(HAVE_ZSTD, test "$ac_cv_lib_zstd_ZSTD_compress" = yes)
533
-
534
- dnl Test whether the linker supports --compress-debug-sections=zstd option.
535
- AC_CACHE_CHECK([whether --compress-debug-sections=zstd is supported],
536
- [libgo_cv_ld_compress_zstd],
537
- [LDFLAGS_hold=$LDFLAGS
538
- LDFLAGS="$LDFLAGS -Wl,--compress-debug-sections=zstd"
539
- AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
540
- [libgo_cv_ld_compress_zstd=yes],
541
- [libgo_cv_ld_compress_zstd=no])
542
- LDFLAGS=$LDFLAGS_hold])
543
- AM_CONDITIONAL(HAVE_COMPRESSED_DEBUG_ZSTD, test "$libgo_cv_ld_compress_zstd" = yes)
544
-
545
- AC_ARG_VAR(OBJCOPY, [location of objcopy])
546
- AC_CHECK_PROG(OBJCOPY, objcopy, objcopy,)
547
- AC_CHECK_PROG(READELF, readelf, readelf)
548
- AC_CACHE_CHECK([whether objcopy supports debuglink],
549
- [libbacktrace_cv_objcopy_debuglink],
550
- [if test -n "${with_target_subdir}"; then
551
- libbacktrace_cv_objcopy_debuglink=no
552
- elif ! test -n "${OBJCOPY}"; then
553
- libbacktrace_cv_objcopy_debuglink=no
554
- elif ${OBJCOPY} --help | grep add-gnu-debuglink >/dev/null 2>&1; then
555
- libbacktrace_cv_objcopy_debuglink=yes
556
- else
557
- libbacktrace_cv_objcopy_debuglink=no
558
- fi])
559
- AM_CONDITIONAL(HAVE_OBJCOPY_DEBUGLINK, test "$libbacktrace_cv_objcopy_debuglink" = yes)
560
-
561
- AC_ARG_VAR(DSYMUTIL, [location of dsymutil])
562
- AC_CHECK_PROG(DSYMUTIL, dsymutil, dsymutil)
563
- AM_CONDITIONAL(USE_DSYMUTIL, test -n "${DSYMUTIL}" -a "$FORMAT_FILE" = "macho.lo")
564
-
565
- AC_ARG_VAR(NM, [location of nm])
566
- AC_CHECK_PROG(NM, nm, nm)
567
-
568
- AC_CHECK_PROG(XZ, xz, xz)
569
- AM_CONDITIONAL(HAVE_XZ, test "$XZ" != "")
570
- AC_CHECK_PROG(COMM, comm, comm)
571
- AM_CONDITIONAL(HAVE_COMM, test "$COMM" != "")
572
-
573
- AM_CONDITIONAL(HAVE_MINIDEBUG,
574
- test "${with_target_subdir}" = "" -a "$FORMAT_FILE" = "elf.lo" -a "${OBJCOPY}" != "" -a "${NM}" != "" -a "${XZ}" != "" -a "${COMM}" != "")
575
-
576
- AC_CHECK_LIB([lzma], [lzma_auto_decoder],
577
- [AC_DEFINE(HAVE_LIBLZMA, 1, [Define if -llzma is available.])])
578
- AM_CONDITIONAL(HAVE_LIBLZMA, test "$ac_cv_lib_lzma_lzma_auto_decoder" = yes)
579
-
580
- AC_CACHE_CHECK([whether tests can run],
581
- [libbacktrace_cv_sys_native],
582
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
583
- [libbacktrace_cv_sys_native=yes],
584
- [libbacktrace_cv_sys_native=no],
585
- [libbacktrace_cv_sys_native=no])])
586
- AM_CONDITIONAL(NATIVE, test "$libbacktrace_cv_sys_native" = "yes")
587
-
588
- if test "${multilib}" = "yes"; then
589
- multilib_arg="--enable-multilib"
590
- else
591
- multilib_arg=
592
- fi
593
-
594
- AC_CONFIG_FILES(Makefile backtrace-supported.h)
595
- AC_CONFIG_FILES(install-debuginfo-for-buildid.sh, chmod +x install-debuginfo-for-buildid.sh)
596
-
597
- # We need multilib support, but only if configuring for the target.
598
- AC_CONFIG_COMMANDS([default],
599
- [if test -n "$CONFIG_FILES"; then
600
- if test -n "${with_target_subdir}"; then
601
- # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
602
- # that multilib installs will end up installed in the correct place.
603
- # The testsuite needs it for multilib-aware ABI baseline files.
604
- # To work around this not being passed down from config-ml.in ->
605
- # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
606
- # append it here. Only modify Makefiles that have just been created.
607
- #
608
- # Also, get rid of this simulated-VPATH thing that automake does.
609
- cat > vpsed << \_EOF
610
- s!`test -f '$<' || echo '$(srcdir)/'`!!
611
- _EOF
612
- for i in $SUBDIRS; do
613
- case $CONFIG_FILES in
614
- *${i}/Makefile*)
615
- #echo "Adding MULTISUBDIR to $i/Makefile"
616
- sed -f vpsed $i/Makefile > tmp
617
- grep '^MULTISUBDIR =' Makefile >> tmp
618
- mv tmp $i/Makefile
619
- ;;
620
- esac
621
- done
622
- rm vpsed
623
- fi
624
- fi
625
- ],
626
- [
627
- # Variables needed in config.status (file generation) which aren't already
628
- # passed by autoconf.
629
- SUBDIRS="$SUBDIRS"
630
- ])
631
-
632
- AC_OUTPUT