pf2 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/Cargo.lock +7 -27
  4. data/crates/backtrace-sys2/build.rs +1 -4
  5. data/crates/backtrace-sys2/src/libbacktrace/Makefile.am +116 -31
  6. data/crates/backtrace-sys2/src/libbacktrace/Makefile.in +295 -141
  7. data/crates/backtrace-sys2/src/libbacktrace/README.md +11 -1
  8. data/crates/backtrace-sys2/src/libbacktrace/alloc.c +1 -1
  9. data/crates/backtrace-sys2/src/libbacktrace/allocfail.c +1 -1
  10. data/crates/backtrace-sys2/src/libbacktrace/allocfail.sh +1 -1
  11. data/crates/backtrace-sys2/src/libbacktrace/atomic.c +1 -1
  12. data/crates/backtrace-sys2/src/libbacktrace/backtrace-supported.h.in +1 -1
  13. data/crates/backtrace-sys2/src/libbacktrace/backtrace.c +1 -1
  14. data/crates/backtrace-sys2/src/libbacktrace/backtrace.h +12 -12
  15. data/crates/backtrace-sys2/src/libbacktrace/btest.c +24 -8
  16. data/crates/backtrace-sys2/src/libbacktrace/config/libtool.m4 +162 -53
  17. data/crates/backtrace-sys2/src/libbacktrace/config.h.in +3 -0
  18. data/crates/backtrace-sys2/src/libbacktrace/configure +255 -66
  19. data/crates/backtrace-sys2/src/libbacktrace/configure.ac +27 -8
  20. data/crates/backtrace-sys2/src/libbacktrace/dwarf.c +37 -30
  21. data/crates/backtrace-sys2/src/libbacktrace/edtest.c +2 -2
  22. data/crates/backtrace-sys2/src/libbacktrace/edtest2.c +1 -1
  23. data/crates/backtrace-sys2/src/libbacktrace/elf.c +98 -76
  24. data/crates/backtrace-sys2/src/libbacktrace/fileline.c +1 -1
  25. data/crates/backtrace-sys2/src/libbacktrace/install-debuginfo-for-buildid.sh.in +2 -2
  26. data/crates/backtrace-sys2/src/libbacktrace/instrumented_alloc.c +1 -1
  27. data/crates/backtrace-sys2/src/libbacktrace/internal.h +41 -2
  28. data/crates/backtrace-sys2/src/libbacktrace/macho.c +25 -19
  29. data/crates/backtrace-sys2/src/libbacktrace/mmap.c +1 -1
  30. data/crates/backtrace-sys2/src/libbacktrace/mmapio.c +1 -1
  31. data/crates/backtrace-sys2/src/libbacktrace/mtest.c +4 -4
  32. data/crates/backtrace-sys2/src/libbacktrace/nounwind.c +1 -1
  33. data/crates/backtrace-sys2/src/libbacktrace/pecoff.c +192 -26
  34. data/crates/backtrace-sys2/src/libbacktrace/posix.c +1 -1
  35. data/crates/backtrace-sys2/src/libbacktrace/print.c +41 -16
  36. data/crates/backtrace-sys2/src/libbacktrace/read.c +1 -1
  37. data/crates/backtrace-sys2/src/libbacktrace/simple.c +1 -1
  38. data/crates/backtrace-sys2/src/libbacktrace/sort.c +1 -1
  39. data/crates/backtrace-sys2/src/libbacktrace/state.c +1 -1
  40. data/crates/backtrace-sys2/src/libbacktrace/stest.c +1 -1
  41. data/crates/backtrace-sys2/src/libbacktrace/test_format.c +1 -1
  42. data/crates/backtrace-sys2/src/libbacktrace/testlib.c +1 -1
  43. data/crates/backtrace-sys2/src/libbacktrace/testlib.h +1 -1
  44. data/crates/backtrace-sys2/src/libbacktrace/ttest.c +1 -1
  45. data/crates/backtrace-sys2/src/libbacktrace/unittest.c +1 -1
  46. data/crates/backtrace-sys2/src/libbacktrace/unknown.c +1 -1
  47. data/crates/backtrace-sys2/src/libbacktrace/xcoff.c +43 -32
  48. data/crates/backtrace-sys2/src/libbacktrace/xztest.c +2 -2
  49. data/crates/backtrace-sys2/src/libbacktrace/zstdtest.c +1 -1
  50. data/crates/backtrace-sys2/src/libbacktrace/ztest.c +1 -1
  51. data/ext/pf2/Cargo.toml +1 -1
  52. data/ext/pf2/src/profile_serializer.rs +5 -12
  53. data/ext/pf2/src/ringbuffer.rs +1 -3
  54. data/ext/pf2/src/ruby_init.rs +1 -4
  55. data/ext/pf2/src/sample.rs +1 -0
  56. data/ext/pf2/src/serialization/profile.rs +2 -1
  57. data/ext/pf2/src/serialization/serializer.rs +227 -48
  58. data/ext/pf2/src/session/new_thread_watcher.rs +1 -1
  59. data/ext/pf2/src/session/ruby_object.rs +1 -5
  60. data/ext/pf2/src/session.rs +5 -15
  61. data/ext/pf2/src/signal_scheduler.rs +9 -10
  62. data/ext/pf2/src/timer_thread_scheduler.rs +8 -6
  63. data/lib/pf2/cli.rb +2 -0
  64. data/lib/pf2/reporter/firefox_profiler.rb +2 -0
  65. data/lib/pf2/reporter/stack_weaver.rb +81 -0
  66. data/lib/pf2/reporter.rb +3 -4
  67. data/lib/pf2/serve.rb +2 -0
  68. data/lib/pf2/session.rb +2 -0
  69. data/lib/pf2/version.rb +3 -1
  70. data/lib/pf2.rb +4 -1
  71. data/rustfmt.toml +1 -0
  72. metadata +9 -12
  73. data/crates/backtrace-sys2/src/libbacktrace/libtool.m4 +0 -7436
  74. data/crates/backtrace-sys2/src/libbacktrace/ltoptions.m4 +0 -369
  75. data/crates/backtrace-sys2/src/libbacktrace/ltsugar.m4 +0 -123
  76. data/crates/backtrace-sys2/src/libbacktrace/ltversion.m4 +0 -23
  77. data/crates/backtrace-sys2/src/libbacktrace/lt~obsolete.m4 +0 -98
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1aa1dd1d3caa1dd9327382e7de0a44b2c0ff4555a9dff8fdc7244f61c3a13405
4
- data.tar.gz: c50895ea4d8285cc9bb223d575cbec7042aacd119a1390b836b818232ef7e214
3
+ metadata.gz: 6e8c8c8751f27ee725f5b8521390473d3bb0c8e5f325feaac24bb6fc02af4468
4
+ data.tar.gz: 825447bc6c1656a772fba7a28aab3a602e2df7e17d5cceef434253cb7f72b0ff
5
5
  SHA512:
6
- metadata.gz: 1b5db496a58016e11203334b71e80e7a4c0d7d0dce6b2cb288884da4aecd8820d8915fd0b9f4ebd546802c314d621f69da23c474d254bff17ec3931cb8f7604b
7
- data.tar.gz: 5e3a8fcf25be2dbf28cf8c36e03839cbeed13aa8d944e43991672a39f06fe16f6eae07aab5cd282c3237171bfff94b39a8abb176153a091452c3177266eb1364
6
+ metadata.gz: 23d6c1482801e03d7424ebfd9799c24009cabaa3e5928cdf332706446de6e2db1c4b9890cdb5023bf812c5339207845e55ec9d93ca02b683a29c7cb160be98d5
7
+ data.tar.gz: aa97b5c3eca68891012558f39210930cf39358a16c09878d46d2df2e1a4266ea4a3762636532b3d359ed8a490b372e2b32008c668344db47fb64243d3b790ebf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.7.0] - 2025-01-03
4
+
5
+ ### Changed
6
+
7
+ - Prepended `frozen_string_literal: true` to all Ruby files.
8
+ - Internals
9
+ - Updated rb-sys to 0.9.105.
10
+ - Synced libbacktrace with upstream as of 2024-08-06.
11
+
12
+
3
13
  ## [0.6.0] - 2024-07-15
4
14
 
5
15
  ### Changed
data/Cargo.lock CHANGED
@@ -1,6 +1,6 @@
1
1
  # This file is automatically @generated by Cargo.
2
2
  # It is not intended for manual editing.
3
- version = 3
3
+ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "aho-corasick"
@@ -63,27 +63,7 @@ dependencies = [
63
63
  name = "backtrace-sys2"
64
64
  version = "0.1.0"
65
65
  dependencies = [
66
- "bindgen 0.69.2",
67
- ]
68
-
69
- [[package]]
70
- name = "bindgen"
71
- version = "0.66.1"
72
- source = "registry+https://github.com/rust-lang/crates.io-index"
73
- checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"
74
- dependencies = [
75
- "bitflags",
76
- "cexpr",
77
- "clang-sys",
78
- "lazy_static",
79
- "lazycell",
80
- "peeking_take_while",
81
- "proc-macro2",
82
- "quote",
83
- "regex",
84
- "rustc-hash",
85
- "shlex",
86
- "syn",
66
+ "bindgen",
87
67
  ]
88
68
 
89
69
  [[package]]
@@ -341,20 +321,20 @@ dependencies = [
341
321
 
342
322
  [[package]]
343
323
  name = "rb-sys"
344
- version = "0.9.82"
324
+ version = "0.9.105"
345
325
  source = "registry+https://github.com/rust-lang/crates.io-index"
346
- checksum = "a3e6bf79bf4c711917cacfaf46dfab4314dbfdd89a8ee3ec4b98336cd23f1ebf"
326
+ checksum = "4b3a1f3ce8e7c36d777d52fe7a99039fe4fea7c8ec355a4c4f3a17f92a14029f"
347
327
  dependencies = [
348
328
  "rb-sys-build",
349
329
  ]
350
330
 
351
331
  [[package]]
352
332
  name = "rb-sys-build"
353
- version = "0.9.82"
333
+ version = "0.9.105"
354
334
  source = "registry+https://github.com/rust-lang/crates.io-index"
355
- checksum = "5482a1ed4cde58dddaf162b6aebcb5c25645822547832b8be101f2acd40bcdd6"
335
+ checksum = "3e6b246c29c0809e1cbe60a1ba9e093da72a4676d02adc68469297d1e589bbf0"
356
336
  dependencies = [
357
- "bindgen 0.66.1",
337
+ "bindgen",
358
338
  "lazy_static",
359
339
  "proc-macro2",
360
340
  "quote",
@@ -40,9 +40,6 @@ fn main() {
40
40
  .expect("Failed to write bindings");
41
41
 
42
42
  println!("cargo:rerun-if-changed=build.rs");
43
- println!(
44
- "cargo:rustc-link-search=native={}",
45
- libbacktrace_src_dir.join(".libs").display()
46
- );
43
+ println!("cargo:rustc-link-search=native={}", libbacktrace_src_dir.join(".libs").display());
47
44
  println!("cargo:rustc-link-lib=static=backtrace");
48
45
  }
@@ -1,5 +1,5 @@
1
1
  # Makefile.am -- Backtrace Makefile.
2
- # Copyright (C) 2012-2021 Free Software Foundation, Inc.
2
+ # Copyright (C) 2012-2024 Free Software Foundation, Inc.
3
3
 
4
4
  # Redistribution and use in source and binary forms, with or without
5
5
  # modification, are permitted provided that the following conditions are
@@ -107,6 +107,10 @@ check_DATA =
107
107
  # Flags to use when compiling test programs.
108
108
  libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
109
109
 
110
+ # Flags to use when linking test programs.
111
+ # This avoids generating a shell script when configured with --enable-shared.
112
+ libbacktrace_testing_ldflags = -no-install
113
+
110
114
  if USE_DSYMUTIL
111
115
 
112
116
  %.dSYM: %
@@ -152,18 +156,18 @@ endif HAVE_OBJCOPY_DEBUGLINK
152
156
  endif HAVE_ELF
153
157
 
154
158
  elf_%.c: elf.c
159
+ nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
155
160
  SEARCH='#error "Unknown BACKTRACE_ELF_SIZE"'; \
156
- REPLACE='#undef BACKTRACE_ELF_SIZE\
157
- #define BACKTRACE_ELF_SIZE'; \
161
+ REPLACE="#undef BACKTRACE_ELF_SIZE\\$${nl}#define BACKTRACE_ELF_SIZE"; \
158
162
  $(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
159
163
  $< \
160
164
  > $@.tmp
161
165
  mv $@.tmp $@
162
166
 
163
167
  xcoff_%.c: xcoff.c
168
+ nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
164
169
  SEARCH='#error "Unknown BACKTRACE_XCOFF_SIZE"'; \
165
- REPLACE='#undef BACKTRACE_XCOFF_SIZE\
166
- #define BACKTRACE_XCOFF_SIZE'; \
170
+ REPLACE="#undef BACKTRACE_XCOFF_SIZE\\$${nl}#define BACKTRACE_XCOFF_SIZE"; \
167
171
  $(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
168
172
  $< \
169
173
  > $@.tmp
@@ -171,54 +175,63 @@ xcoff_%.c: xcoff.c
171
175
 
172
176
  test_elf_32_SOURCES = test_format.c testlib.c
173
177
  test_elf_32_CFLAGS = $(libbacktrace_TEST_CFLAGS)
178
+ test_elf_32_LDFLAGS = $(libbacktrace_testing_ldflags)
174
179
  test_elf_32_LDADD = libbacktrace_noformat.la elf_32.lo
175
180
 
176
181
  BUILDTESTS += test_elf_32
177
182
 
178
183
  test_elf_64_SOURCES = test_format.c testlib.c
179
184
  test_elf_64_CFLAGS = $(libbacktrace_TEST_CFLAGS)
185
+ test_elf_64_LDFLAGS = $(libbacktrace_testing_ldflags)
180
186
  test_elf_64_LDADD = libbacktrace_noformat.la elf_64.lo
181
187
 
182
188
  BUILDTESTS += test_elf_64
183
189
 
184
190
  test_macho_SOURCES = test_format.c testlib.c
185
191
  test_macho_CFLAGS = $(libbacktrace_TEST_CFLAGS)
192
+ test_macho_LDFLAGS = $(libbacktrace_testing_ldflags)
186
193
  test_macho_LDADD = libbacktrace_noformat.la macho.lo
187
194
 
188
195
  BUILDTESTS += test_macho
189
196
 
190
197
  test_xcoff_32_SOURCES = test_format.c testlib.c
191
198
  test_xcoff_32_CFLAGS = $(libbacktrace_TEST_CFLAGS)
199
+ test_xcoff_32_LDFLAGS = $(libbacktrace_testing_ldflags)
192
200
  test_xcoff_32_LDADD = libbacktrace_noformat.la xcoff_32.lo
193
201
 
194
202
  BUILDTESTS += test_xcoff_32
195
203
 
196
204
  test_xcoff_64_SOURCES = test_format.c testlib.c
197
205
  test_xcoff_64_CFLAGS = $(libbacktrace_TEST_CFLAGS)
206
+ test_xcoff_64_LDFLAGS = $(libbacktrace_testing_ldflags)
198
207
  test_xcoff_64_LDADD = libbacktrace_noformat.la xcoff_64.lo
199
208
 
200
209
  BUILDTESTS += test_xcoff_64
201
210
 
202
211
  test_pecoff_SOURCES = test_format.c testlib.c
203
212
  test_pecoff_CFLAGS = $(libbacktrace_TEST_CFLAGS)
213
+ test_pecoff_LDFLAGS = $(libbacktrace_testing_ldflags)
204
214
  test_pecoff_LDADD = libbacktrace_noformat.la pecoff.lo
205
215
 
206
216
  BUILDTESTS += test_pecoff
207
217
 
208
218
  test_unknown_SOURCES = test_format.c testlib.c
209
219
  test_unknown_CFLAGS = $(libbacktrace_TEST_CFLAGS)
220
+ test_unknown_LDFLAGS = $(libbacktrace_testing_ldflags)
210
221
  test_unknown_LDADD = libbacktrace_noformat.la unknown.lo
211
222
 
212
223
  BUILDTESTS += test_unknown
213
224
 
214
225
  unittest_SOURCES = unittest.c testlib.c
215
226
  unittest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
227
+ unittest_LDFLAGS = $(libbacktrace_testing_ldflags)
216
228
  unittest_LDADD = libbacktrace.la
217
229
 
218
230
  BUILDTESTS += unittest
219
231
 
220
232
  unittest_alloc_SOURCES = $(unittest_SOURCES)
221
233
  unittest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
234
+ unittest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
222
235
  unittest_alloc_LDADD = libbacktrace_alloc.la
223
236
 
224
237
  BUILDTESTS += unittest_alloc
@@ -254,21 +267,21 @@ if HAVE_OBJCOPY_DEBUGLINK
254
267
 
255
268
  b2test_SOURCES = $(btest_SOURCES)
256
269
  b2test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
257
- b2test_LDFLAGS = -Wl,--build-id
270
+ b2test_LDFLAGS = -Wl,--build-id $(libbacktrace_testing_ldflags)
258
271
  b2test_LDADD = libbacktrace_elf_for_test.la
259
272
 
260
273
  check_PROGRAMS += b2test
261
- MAKETESTS += b2test_buildid
274
+ MAKETESTS += b2test_buildid b2test_buildidfull
262
275
 
263
276
  if HAVE_DWZ
264
277
 
265
278
  b3test_SOURCES = $(btest_SOURCES)
266
279
  b3test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
267
- b3test_LDFLAGS = -Wl,--build-id
280
+ b3test_LDFLAGS = -Wl,--build-id $(libbacktrace_testing_ldflags)
268
281
  b3test_LDADD = libbacktrace_elf_for_test.la
269
282
 
270
283
  check_PROGRAMS += b3test
271
- MAKETESTS += b3test_dwz_buildid
284
+ MAKETESTS += b3test_dwz_buildid b3test_dwz_buildidfull
272
285
 
273
286
  endif HAVE_DWZ
274
287
 
@@ -278,6 +291,7 @@ endif HAVE_ELF
278
291
 
279
292
  btest_SOURCES = btest.c testlib.c
280
293
  btest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
294
+ btest_LDFLAGS = $(libbacktrace_testing_ldflags)
281
295
  btest_LDADD = libbacktrace.la
282
296
 
283
297
  BUILDTESTS += btest
@@ -290,6 +304,7 @@ if HAVE_ELF
290
304
 
291
305
  btest_lto_SOURCES = btest.c testlib.c
292
306
  btest_lto_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O -flto
307
+ btest_lto_LDFLAGS = $(libbacktrace_testing_ldflags)
293
308
  btest_lto_LDADD = libbacktrace.la
294
309
 
295
310
  BUILDTESTS += btest_lto
@@ -298,6 +313,7 @@ endif HAVE_ELF
298
313
 
299
314
  btest_alloc_SOURCES = $(btest_SOURCES)
300
315
  btest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
316
+ btest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
301
317
  btest_alloc_LDADD = libbacktrace_alloc.la
302
318
 
303
319
  BUILDTESTS += btest_alloc
@@ -332,6 +348,7 @@ endif HAVE_DWZ
332
348
 
333
349
  stest_SOURCES = stest.c
334
350
  stest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
351
+ stest_LDFLAGS = $(libbacktrace_testing_ldflags)
335
352
  stest_LDADD = libbacktrace.la
336
353
 
337
354
  BUILDTESTS += stest
@@ -342,6 +359,7 @@ endif USE_DSYMUTIL
342
359
 
343
360
  stest_alloc_SOURCES = $(stest_SOURCES)
344
361
  stest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
362
+ stest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
345
363
  stest_alloc_LDADD = libbacktrace_alloc.la
346
364
 
347
365
  BUILDTESTS += stest_alloc
@@ -354,6 +372,7 @@ if HAVE_ELF
354
372
 
355
373
  ztest_SOURCES = ztest.c testlib.c
356
374
  ztest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
375
+ ztest_LDFLAGS = $(libbacktrace_testing_ldflags)
357
376
  ztest_LDADD = libbacktrace.la
358
377
  ztest_alloc_LDADD = libbacktrace_alloc.la
359
378
 
@@ -368,11 +387,13 @@ BUILDTESTS += ztest
368
387
 
369
388
  ztest_alloc_SOURCES = $(ztest_SOURCES)
370
389
  ztest_alloc_CFLAGS = $(ztest_CFLAGS)
390
+ ztest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
371
391
 
372
392
  BUILDTESTS += ztest_alloc
373
393
 
374
394
  zstdtest_SOURCES = zstdtest.c testlib.c
375
395
  zstdtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
396
+ zstdtest_LDFLAGS = $(libbacktrace_testing_ldflags)
376
397
  zstdtest_LDADD = libbacktrace.la
377
398
  zstdtest_alloc_LDADD = libbacktrace_alloc.la
378
399
 
@@ -387,6 +408,7 @@ BUILDTESTS += zstdtest
387
408
 
388
409
  zstdtest_alloc_SOURCES = $(zstdtest_SOURCES)
389
410
  zstdtest_alloc_CFLAGS = $(zstdtest_CFLAGS)
411
+ zstdtest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
390
412
 
391
413
  BUILDTESTS += zstdtest_alloc
392
414
 
@@ -394,6 +416,7 @@ endif HAVE_ELF
394
416
 
395
417
  edtest_SOURCES = edtest.c edtest2_build.c testlib.c
396
418
  edtest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
419
+ edtest_LDFLAGS = $(libbacktrace_testing_ldflags)
397
420
  edtest_LDADD = libbacktrace.la
398
421
 
399
422
  BUILDTESTS += edtest
@@ -404,6 +427,7 @@ endif USE_DSYMUTIL
404
427
 
405
428
  edtest_alloc_SOURCES = $(edtest_SOURCES)
406
429
  edtest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS)
430
+ edtest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
407
431
  edtest_alloc_LDADD = libbacktrace_alloc.la
408
432
 
409
433
  if USE_DSYMUTIL
@@ -424,6 +448,7 @@ BUILDTESTS += ttest
424
448
 
425
449
  ttest_SOURCES = ttest.c testlib.c
426
450
  ttest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -pthread
451
+ ttest_LDFLAGS = $(libbacktrace_testing_ldflags)
427
452
  ttest_LDADD = libbacktrace.la
428
453
 
429
454
  if USE_DSYMUTIL
@@ -434,6 +459,7 @@ BUILDTESTS += ttest_alloc
434
459
 
435
460
  ttest_alloc_SOURCES = $(ttest_SOURCES)
436
461
  ttest_alloc_CFLAGS = $(ttest_CFLAGS)
462
+ ttest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
437
463
  ttest_alloc_LDADD = libbacktrace_alloc.la
438
464
 
439
465
  if USE_DSYMUTIL
@@ -444,12 +470,16 @@ endif HAVE_PTHREAD
444
470
 
445
471
  if HAVE_OBJCOPY_DEBUGLINK
446
472
 
447
- MAKETESTS += btest_gnudebuglink
473
+ MAKETESTS += btest_gnudebuglink btest_gnudebuglinkfull
448
474
 
449
475
  %_gnudebuglink: %
450
476
  $(OBJCOPY) --only-keep-debug $< $@.debug
451
477
  $(OBJCOPY) --strip-debug --add-gnu-debuglink=$@.debug $< $@
452
478
 
479
+ %_gnudebuglinkfull: %
480
+ $(OBJCOPY) --only-keep-debug $< $@.debug
481
+ $(OBJCOPY) --strip-all --add-gnu-debuglink=$@.debug $< $@
482
+
453
483
  endif HAVE_OBJCOPY_DEBUGLINK
454
484
 
455
485
  %_buildid: %
@@ -458,42 +488,57 @@ endif HAVE_OBJCOPY_DEBUGLINK
458
488
  $<
459
489
  $(OBJCOPY) --strip-debug $< $@
460
490
 
461
- if HAVE_COMPRESSED_DEBUG
491
+ %_buildidfull: %
492
+ ./install-debuginfo-for-buildid.sh \
493
+ "$(TEST_BUILD_ID_DIR)" \
494
+ $<
495
+ $(OBJCOPY) --strip-all $< $@
496
+
497
+ if HAVE_COMPRESSED_DEBUG_ZLIB_GNU
462
498
 
463
499
  ctestg_SOURCES = btest.c testlib.c
464
500
  ctestg_CFLAGS = $(libbacktrace_TEST_CFLAGS)
465
- ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu
501
+ ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu $(libbacktrace_testing_ldflags)
466
502
  ctestg_LDADD = libbacktrace.la
467
503
 
504
+ ctestg_alloc_SOURCES = $(ctestg_SOURCES)
505
+ ctestg_alloc_CFLAGS = $(ctestg_CFLAGS)
506
+ ctestg_alloc_LDFLAGS = $(ctestg_LDFLAGS) $(libbacktrace_testing_ldflags)
507
+ ctestg_alloc_LDADD = libbacktrace_alloc.la
508
+
509
+ BUILDTESTS += ctestg ctestg_alloc
510
+
511
+ endif
512
+
513
+ if HAVE_COMPRESSED_DEBUG_ZLIB_GABI
514
+
468
515
  ctesta_SOURCES = btest.c testlib.c
469
516
  ctesta_CFLAGS = $(libbacktrace_TEST_CFLAGS)
470
- ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi
517
+ ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi $(libbacktrace_testing_ldflags)
471
518
  ctesta_LDADD = libbacktrace.la
472
519
 
473
- BUILDTESTS += ctestg ctesta
520
+ ctesta_alloc_SOURCES = $(ctesta_SOURCES)
521
+ ctesta_alloc_CFLAGS = $(ctesta_CFLAGS)
522
+ ctesta_alloc_LDFLAGS = $(ctesta_LDFLAGS) $(libbacktrace_testing_ldflags)
523
+ ctesta_alloc_LDADD = libbacktrace_alloc.la
524
+
525
+ BUILDTESTS += ctesta ctesta_alloc
526
+
527
+ endif
474
528
 
475
529
  if HAVE_COMPRESSED_DEBUG_ZSTD
476
530
 
477
531
  ctestzstd_SOURCES = btest.c testlib.c
478
532
  ctestzstd_CFLAGS = $(libbacktrace_TEST_CFLAGS)
479
- ctestzstd_LDFLAGS = -Wl,--compress-debug-sections=zstd
533
+ ctestzstd_LDFLAGS = -Wl,--compress-debug-sections=zstd $(libbacktrace_testing_ldflags)
480
534
  ctestzstd_LDADD = libbacktrace.la
481
535
 
482
- BUILDTESTS += ctestzstd
483
-
484
- endif
485
-
486
- ctestg_alloc_SOURCES = $(ctestg_SOURCES)
487
- ctestg_alloc_CFLAGS = $(ctestg_CFLAGS)
488
- ctestg_alloc_LDFLAGS = $(ctestg_LDFLAGS)
489
- ctestg_alloc_LDADD = libbacktrace_alloc.la
490
-
491
- ctesta_alloc_SOURCES = $(ctesta_SOURCES)
492
- ctesta_alloc_CFLAGS = $(ctesta_CFLAGS)
493
- ctesta_alloc_LDFLAGS = $(ctesta_LDFLAGS)
494
- ctesta_alloc_LDADD = libbacktrace_alloc.la
536
+ ctestzstd_alloc_SOURCES = $(ctestzstd_SOURCES)
537
+ ctestzstd_alloc_CFLAGS = $(ctestzstd_CFLAGS)
538
+ ctestzstd_alloc_LDFLAGS = $(ctestzstd_LDFLAGS) $(libbacktrace_testing_ldflags)
539
+ ctestzstd_alloc_LDADD = libbacktrace_alloc.la
495
540
 
496
- BUILDTESTS += ctestg_alloc ctesta_alloc
541
+ BUILDTESTS += ctestzstd ctestzstd_alloc
497
542
 
498
543
  endif
499
544
 
@@ -501,6 +546,7 @@ if HAVE_DWARF5
501
546
 
502
547
  dwarf5_SOURCES = btest.c testlib.c
503
548
  dwarf5_CFLAGS = $(libbacktrace_TEST_CFLAGS) -gdwarf-5
549
+ dwarf5_LDFLAGS = $(libbacktrace_testing_ldflags)
504
550
  dwarf5_LDADD = libbacktrace.la
505
551
 
506
552
  BUILDTESTS += dwarf5
@@ -511,6 +557,7 @@ endif USE_DSYMUTIL
511
557
 
512
558
  dwarf5_alloc_SOURCES = $(dwarf5_SOURCES)
513
559
  dwarf5_alloc_CFLAGS = $(dwarf5_CFLAGS)
560
+ dwarf5_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
514
561
  dwarf5_alloc_LDADD = libbacktrace_alloc.la
515
562
 
516
563
  BUILDTESTS += dwarf5_alloc
@@ -523,6 +570,7 @@ endif
523
570
 
524
571
  mtest_SOURCES = mtest.c testlib.c
525
572
  mtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
573
+ mtest_LDFLAGS = $(libbacktrace_testing_ldflags)
526
574
  mtest_LDADD = libbacktrace.la
527
575
 
528
576
  BUILDTESTS += mtest
@@ -547,6 +595,39 @@ MAKETESTS += mtest_minidebug
547
595
  $(OBJCOPY) --add-section .gnu_debugdata=$<.mdbg.xz $<.strip
548
596
  mv $<.strip $@
549
597
 
598
+ if HAVE_ELF
599
+ if HAVE_BUILDID
600
+ if HAVE_OBJCOPY_DEBUGLINK
601
+
602
+ m2test_SOURCES = $(mtest_SOURCES)
603
+ m2test_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
604
+ m2test_LDFLAGS = -Wl,--build-id $(libbacktrace_testing_ldflags)
605
+ m2test_LDADD = libbacktrace_elf_for_test.la
606
+
607
+ check_PROGRAMS += m2test
608
+ MAKETESTS += m2test_minidebug2
609
+
610
+ # minidebug2 is like minidebug but also adds the gnu_debugdata section
611
+ # to the debug file, and uses a build ID file. There is no reason to do
612
+ # this but it was causing an infinite recursion.
613
+ %_minidebug2: %
614
+ $(NM) -D $< -P --defined-only | $(AWK) '{ print $$1 }' | sort > $<.dsyms2
615
+ $(NM) $< -P --defined-only | $(AWK) '{ if ($$2 == "T" || $$2 == "t" || $$2 == "D") print $$1 }' | sort > $<.fsyms2
616
+ $(COMM) -13 $<.dsyms2 $<.fsyms2 > $<.keepsyms2
617
+ $(OBJCOPY) --only-keep-debug $< $<.dbg2
618
+ $(OBJCOPY) -S --remove-section .gdb_index --remove-section .comment --keep-symbols=$<.keepsyms2 $<.dbg2 $<.mdbg2
619
+ $(OBJCOPY) --strip-all --remove-section ..comment $< $<.strip2
620
+ rm -f $<.mdbg2.xz
621
+ $(XZ) $<.mdbg2
622
+ $(OBJCOPY) --add-section .gnu_debugdata=$<.mdbg2.xz $<.dbg2
623
+ $(OBJCOPY) --add-section .gnu_debugdata=$<.mdbg2.xz $<.strip2
624
+ $(SHELL) ./install-debuginfo-for-buildid.sh $(TEST_BUILD_ID_DIR) $<.dbg2
625
+ mv $<.strip2 $@
626
+
627
+ endif HAVE_OBJCOPY_DEBUGLINK
628
+ endif HAVE_BUILDID
629
+ endif HAVE_ELF
630
+
550
631
  endif HAVE_MINIDEBUG
551
632
 
552
633
  endif NATIVE
@@ -555,10 +636,12 @@ if HAVE_ELF
555
636
 
556
637
  xztest_SOURCES = xztest.c testlib.c
557
638
  xztest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
639
+ xztest_LDFLAGS = $(libbacktrace_testing_ldflags)
558
640
  xztest_LDADD = libbacktrace.la
559
641
 
560
642
  xztest_alloc_SOURCES = $(xztest_SOURCES)
561
643
  xztest_alloc_CFLAGS = $(xztest_CFLAGS)
644
+ xztest_alloc_LDFLAGS = $(libbacktrace_testing_ldflags)
562
645
  xztest_alloc_LDADD = libbacktrace_alloc.la
563
646
 
564
647
  if HAVE_LIBLZMA
@@ -580,7 +663,8 @@ TESTS += $(MAKETESTS) $(BUILDTESTS)
580
663
  CLEANFILES = \
581
664
  $(MAKETESTS) $(BUILDTESTS) *.debug elf_for_test.c edtest2_build.c \
582
665
  gen_edtest2_build \
583
- *.dsyms *.fsyms *.keepsyms *.dbg *.mdbg *.mdbg.xz *.strip
666
+ *.dsyms *.fsyms *.keepsyms *.dbg *.mdbg *.mdbg.xz *.strip \
667
+ *.dsyms2 *.fsyms2 *.keepsyms2 *.dbg2 *.mdbg2 *.mdbg2.xz *.strip2
584
668
 
585
669
  clean-local:
586
670
  -rm -rf usr
@@ -617,7 +701,8 @@ sort.lo: config.h backtrace.h internal.h
617
701
  stest.lo: config.h backtrace.h internal.h
618
702
  state.lo: config.h backtrace.h backtrace-supported.h internal.h
619
703
  unknown.lo: config.h backtrace.h internal.h
620
- xcoff.lo: config.h backtrace.h internal.h
704
+ xcoff_32.lo: config.h backtrace.h internal.h
705
+ xcoff_64.lo: config.h backtrace.h internal.h
621
706
  xztest.lo: config.h backtrace.h backtrace-supported.h internal.h testlib.h
622
707
  ztest.lo: config.h backtrace.h backtrace-supported.h internal.h testlib.h
623
708