Makefile 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. # Copyright (C) 1991-2026 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3. # The GNU C Library is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Lesser General Public
  5. # License as published by the Free Software Foundation; either
  6. # version 2.1 of the License, or (at your option) any later version.
  7. # The GNU C Library is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. # Lesser General Public License for more details.
  11. # You should have received a copy of the GNU Lesser General Public
  12. # License along with the GNU C Library; if not, see
  13. # <https://www.gnu.org/licenses/>.
  14. #
  15. # Makefile for malloc routines
  16. #
  17. subdir := malloc
  18. include ../Makeconfig
  19. dist-headers := malloc.h
  20. headers := $(dist-headers) obstack.h mcheck.h
  21. tests := \
  22. mallocbug \
  23. tst-aligned-alloc \
  24. tst-aligned-alloc-random \
  25. tst-aligned-alloc-random-thread \
  26. tst-aligned-alloc-random-thread-cross \
  27. tst-alloc_buffer \
  28. tst-calloc \
  29. tst-free-aligned-sized \
  30. tst-free-aligned-sized-trace \
  31. tst-free-errno \
  32. tst-free-sized \
  33. tst-free-sized-trace \
  34. tst-interpose-nothread \
  35. tst-interpose-thread \
  36. tst-malloc \
  37. tst-malloc-alternate-path \
  38. tst-malloc-backtrace \
  39. tst-malloc-check \
  40. tst-malloc-fork-deadlock \
  41. tst-malloc-random \
  42. tst-malloc-stats-cancellation \
  43. tst-malloc-tcache-leak \
  44. tst-malloc-thread-exit \
  45. tst-malloc-thread-fail \
  46. tst-malloc-too-large \
  47. tst-malloc-usable \
  48. tst-malloc_info tst-mallinfo2 \
  49. tst-mallocalign1 \
  50. tst-mallocfork \
  51. tst-mallocfork2 \
  52. tst-mallocfork3 \
  53. tst-mallopt \
  54. tst-memalign \
  55. tst-memalign-2 \
  56. tst-memalign-3 \
  57. tst-obstack \
  58. tst-posix_memalign \
  59. tst-pvalloc \
  60. tst-pvalloc-fortify \
  61. tst-realloc \
  62. tst-reallocarray \
  63. tst-safe-linking \
  64. tst-tcfree1 tst-tcfree2 tst-tcfree3 tst-tcfree4 \
  65. tst-trim1 \
  66. tst-valloc \
  67. # tests
  68. tests-static := \
  69. tst-aligned-alloc-static \
  70. tst-interpose-static-nothread \
  71. tst-interpose-static-thread \
  72. # tests-static
  73. # Test for the malloc_set_state symbol removed in glibc 2.25.
  74. ifeq ($(have-GLIBC_2.23)$(build-shared),yesyes)
  75. tests += \
  76. tst-compathooks-off \
  77. tst-compathooks-on \
  78. tst-mallocstate \
  79. # tests
  80. endif
  81. tests-internal := tst-scratch_buffer
  82. # The dynarray framework is only available inside glibc.
  83. tests-internal += \
  84. tst-dynarray \
  85. tst-dynarray-at-fail \
  86. tst-dynarray-fail \
  87. # tests-internal
  88. tests += \
  89. tst-malloc-usable-tunables \
  90. # tests
  91. tests += $(tests-static)
  92. test-srcs = tst-mtrace
  93. # These tests either are run with MALLOC_CHECK_=3 by default or do not work
  94. # with MALLOC_CHECK_=3 because they expect a specific failure.
  95. tests-exclude-malloc-check = \
  96. tst-compathooks-off \
  97. tst-compathooks-on \
  98. tst-malloc-check \
  99. tst-malloc-tcache-leak \
  100. tst-malloc-usable \
  101. tst-mallocfork2 \
  102. tst-mallocfork3 \
  103. tst-memalign-2 \
  104. tst-memalign-3 \
  105. tst-safe-linking \
  106. tst-tcfree4 \
  107. # tests-exclude-malloc-check
  108. # Run all tests with MALLOC_CHECK_=3
  109. tests-malloc-check = $(filter-out $(tests-exclude-malloc-check) \
  110. $(tests-static),$(tests))
  111. # Run all tests with GLIBC_TUNABLES=glibc.malloc.hugetlb={1,2} which check
  112. # the Transparent Huge Pages support (1) or automatic huge page support (2).
  113. # We need exclude some tests that define the ENV vars.
  114. tests-exclude-hugetlb1 = \
  115. tst-compathooks-off \
  116. tst-compathooks-on \
  117. tst-interpose-nothread \
  118. tst-interpose-static-nothread \
  119. tst-interpose-static-thread \
  120. tst-interpose-thread \
  121. tst-malloc-tcache-leak \
  122. tst-malloc-usable \
  123. tst-malloc-usable-tunables \
  124. tst-mallocfork2 \
  125. tst-mallocfork3 \
  126. tst-mallocstate \
  127. # tests-exclude-hugetlb1
  128. # The tst-free-errno relies on the used malloc page size to mmap an
  129. # overlapping region.
  130. tests-exclude-hugetlb2 = \
  131. $(tests-exclude-hugetlb1) \
  132. tst-free-errno
  133. tests-malloc-hugetlb1 = \
  134. $(filter-out $(tests-exclude-hugetlb1), $(tests))
  135. tests-malloc-hugetlb2 = \
  136. $(filter-out $(tests-exclude-hugetlb2), $(tests))
  137. tests-exclude-largetcache = \
  138. tst-compathooks-off \
  139. tst-compathooks-on \
  140. tst-interpose-nothread \
  141. tst-interpose-static-nothread \
  142. tst-interpose-static-thread \
  143. tst-interpose-thread \
  144. tst-malloc-backtrace \
  145. tst-malloc-usable \
  146. tst-malloc-usable-tunables \
  147. tst-mallocstate \
  148. # tests-exclude-largetcache
  149. tests-malloc-largetcache = \
  150. $(filter-out $(tests-exclude-largetcache), $(tests))
  151. # -lmcheck needs __malloc_initialize_hook, which was deprecated in 2.24.
  152. ifeq ($(have-GLIBC_2.23)$(build-shared),yesyes)
  153. # Tests that don't play well with mcheck. They are either bugs in mcheck or
  154. # the tests expect specific internal behavior that is changed due to linking to
  155. # libmcheck.a.
  156. tests-exclude-mcheck = \
  157. tst-aligned-alloc-random-thread \
  158. tst-aligned-alloc-random-thread-cross \
  159. tst-compathooks-off \
  160. tst-compathooks-on \
  161. tst-malloc-backtrace \
  162. tst-malloc-fork-deadlock \
  163. tst-malloc-stats-cancellation \
  164. tst-malloc-tcache-leak \
  165. tst-malloc-thread-exit \
  166. tst-malloc-thread-fail \
  167. tst-malloc-usable-tunables \
  168. tst-malloc_info \
  169. tst-mallocfork2 \
  170. tst-mallocfork3 \
  171. tst-mallocstate \
  172. tst-memalign-2 \
  173. tst-memalign-3 \
  174. tst-safe-linking \
  175. # tests-exclude-mcheck
  176. tests-mcheck = $(filter-out $(tests-exclude-mcheck) $(tests-static), $(tests))
  177. endif
  178. routines = malloc mcheck mtrace obstack reallocarray \
  179. scratch_buffer_grow scratch_buffer_grow_preserve \
  180. scratch_buffer_set_array_size \
  181. dynarray_at_failure \
  182. dynarray_emplace_enlarge \
  183. dynarray_finalize \
  184. dynarray_resize \
  185. dynarray_resize_clear \
  186. alloc_buffer_alloc_array \
  187. alloc_buffer_allocate \
  188. alloc_buffer_copy_bytes \
  189. alloc_buffer_copy_string \
  190. alloc_buffer_create_failure \
  191. install-lib := libmcheck.a
  192. non-lib.a := libmcheck.a
  193. # Additional libraries.
  194. extra-libs = libmemusage libc_malloc_debug
  195. extra-libs-others = $(extra-libs)
  196. # Helper objects for some tests.
  197. extra-test-objs += \
  198. tst-aligned_alloc-lib.so \
  199. tst-interpose-aux-nothread.o \
  200. tst-interpose-aux-thread.o \
  201. # extra-test-objs
  202. test-extras = \
  203. tst-interpose-aux-nothread \
  204. tst-interpose-aux-thread \
  205. # test-extras
  206. modules-names = \
  207. tst-aligned_alloc-lib
  208. libmemusage-routines = memusage
  209. libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes))
  210. libc_malloc_debug-routines = malloc-debug $(sysdep_malloc_debug_routines)
  211. libc_malloc_debug-inhibit-o = $(filter-out .os,$(object-suffixes))
  212. tests-link-with-libpthread = \
  213. tst-aligned-alloc-random-thread \
  214. tst-aligned-alloc-random-thread-cross \
  215. tst-aligned-alloc-random-thread-cross-malloc-check \
  216. tst-aligned-alloc-random-thread-cross-malloc-hugetlb1 \
  217. tst-aligned-alloc-random-thread-cross-malloc-hugetlb2 \
  218. tst-aligned-alloc-random-thread-malloc-check \
  219. tst-aligned-alloc-random-thread-malloc-hugetlb1 \
  220. tst-aligned-alloc-random-thread-malloc-hugetlb2 \
  221. tst-interpose-thread \
  222. tst-interpose-thread-malloc-check \
  223. tst-interpose-thread-mcheck \
  224. tst-malloc-backtrace \
  225. tst-malloc-backtrace-malloc-check \
  226. tst-malloc-backtrace-mcheck \
  227. tst-malloc-fork-deadlock \
  228. tst-malloc-fork-deadlock-malloc-check \
  229. tst-malloc-fork-deadlock-malloc-hugetlb1 \
  230. tst-malloc-fork-deadlock-malloc-hugetlb2 \
  231. tst-malloc-fork-deadlock-mcheck \
  232. tst-malloc-stats-cancellation \
  233. tst-malloc-stats-cancellation-malloc-check \
  234. tst-malloc-stats-cancellation-malloc-hugetlb1 \
  235. tst-malloc-stats-cancellation-malloc-hugetlb2 \
  236. tst-malloc-stats-cancellation-mcheck \
  237. tst-malloc-tcache-leak \
  238. tst-malloc-thread-exit \
  239. tst-malloc-thread-exit-malloc-check \
  240. tst-malloc-thread-exit-malloc-hugetlb1 \
  241. tst-malloc-thread-exit-malloc-hugetlb2 \
  242. tst-malloc-thread-exit-mcheck \
  243. tst-malloc-thread-fail \
  244. tst-malloc-thread-fail-malloc-check \
  245. tst-malloc-thread-fail-malloc-hugetlb1 \
  246. tst-malloc-thread-fail-malloc-hugetlb2 \
  247. tst-malloc-thread-fail-mcheck \
  248. tst-malloc_info \
  249. tst-malloc_info-malloc-check \
  250. tst-malloc_info-malloc-hugetlb1 \
  251. tst-malloc_info-malloc-hugetlb2 \
  252. tst-malloc_info-mcheck \
  253. tst-mallocfork2 \
  254. tst-mallocfork2-malloc-check \
  255. tst-mallocfork3 \
  256. tst-mallocfork3-malloc-check \
  257. tst-mallocfork3-mcheck \
  258. tst-memalign-3 \
  259. tst-memalign-3-malloc-hugetlb1 \
  260. tst-memalign-3-malloc-hugetlb2 \
  261. # tests-link-with-libpthread
  262. $(addprefix $(objpfx), $(tests-link-with-libpthread)): $(shared-thread-library)
  263. # Not all these tests are actually built, see tests-exclude-largetcache.
  264. $(tests-link-with-libpthread:%=$(objpfx)%-malloc-largetcache): \
  265. $(shared-thread-library)
  266. # tests-threaded-{main,worker} are variants of base malloc tests that are
  267. # run in a multi-threaded program. The main variant is run in the main
  268. # thread while an alternate thread exists, and the worker variant is run in
  269. # a worker thread while the main thread waits on it.
  270. # List of tests which don't have threaded-{main,worker} copies:
  271. # already multithreaded tests,
  272. # static copies of some regular tests,
  273. # tst-compathooks-on: hook/call counts mismatch due to threading allocations
  274. # tst-interpose-nothread: interposes malloc without locking
  275. # tst-mallocfork: calls fork from a signal handler
  276. # (tst-mallocfork{2,3} already excluded via tests-link-with-libpthread)
  277. tests-exclude-threaded = \
  278. $(tests-link-with-libpthread) \
  279. $(tests-static) \
  280. tst-compathooks-on \
  281. tst-interpose-nothread \
  282. tst-mallocfork \
  283. # tests-exclude-threaded
  284. tests-threaded-main = $(addsuffix -threaded-main, \
  285. $(filter-out $(tests-exclude-threaded), \
  286. $(tests)))
  287. $(addprefix $(objpfx), $(tests-threaded-main)): $(shared-thread-library)
  288. tests-threaded-worker = $(addsuffix -threaded-worker, \
  289. $(filter-out $(tests-exclude-threaded), \
  290. $(tests)))
  291. $(addprefix $(objpfx), $(tests-threaded-worker)): $(shared-thread-library)
  292. tests += $(tests-threaded-main) $(tests-threaded-worker)
  293. # This avoids a test combination explosion with two threaded copies of each
  294. # of these variants:
  295. tests-exclude-malloc-check += $(tests-threaded-main) $(tests-threaded-worker)
  296. tests-exclude-mcheck += $(tests-threaded-main) $(tests-threaded-worker)
  297. tests-exclude-hugetlb1 += $(tests-threaded-main) $(tests-threaded-worker)
  298. tests-exclude-hugetlb2 += $(tests-threaded-main) $(tests-threaded-worker)
  299. tests-exclude-largetcache += $(tests-threaded-main) $(tests-threaded-worker)
  300. # These should be removed by `make clean'.
  301. extra-objs = mcheck-init.o libmcheck.a
  302. others-extras = mcheck-init.o
  303. # Compile threaded-{main,worker} tests from their corresponding base
  304. # sources, but with -DTEST_IN_THREAD appropriately defined so that support
  305. # infrastructure runs them in a multi-threaded program.
  306. $(objpfx)%-threaded-main.o: CPPFLAGS += -DTEST_IN_THREAD=TEST_THREAD_MAIN
  307. $(objpfx)%-threaded-main.o: %.c $(before-compile)
  308. $(compile-command.c)
  309. $(objpfx)%-threaded-worker.o: CPPFLAGS += -DTEST_IN_THREAD=TEST_THREAD_WORKER
  310. $(objpfx)%-threaded-worker.o: %.c $(before-compile)
  311. $(compile-command.c)
  312. # Include the cleanup handler.
  313. aux := set-freeres thread-freeres
  314. # The Perl script to analyze the output of the mtrace functions.
  315. install-bin-script = mtrace
  316. generated += mtrace
  317. # The Perl script will print addresses and to do this nicely we must know
  318. # whether we are on a 32 or 64 bit machine.
  319. ifneq ($(findstring wordsize-32,$(config-sysdirs)),)
  320. address-width=10
  321. else
  322. address-width=18
  323. endif
  324. # Unless we get a test for the availability of libgd which also works
  325. # for cross-compiling we disable the memusagestat generation in this
  326. # situation.
  327. ifneq ($(cross-compiling),yes)
  328. # If the gd library is available we build the `memusagestat' program.
  329. ifneq ($(LIBGD),no)
  330. others: $(objpfx)memusage
  331. others += memusagestat
  332. install-bin = memusagestat
  333. install-bin-script += memusage
  334. generated += memusagestat memusage
  335. extra-objs += memusagestat.o
  336. # The configure.ac check for libgd and its headers did not use $SYSINCLUDES.
  337. # The directory specified by --with-headers usually contains only the basic
  338. # kernel interface headers, not something like libgd. So the simplest thing
  339. # is to presume that the standard system headers will be ok for this file.
  340. $(objpfx)memusagestat.o: sysincludes = # nothing
  341. endif
  342. endif
  343. # Another goal which can be used to override the configure decision.
  344. .PHONY: do-memusagestat
  345. do-memusagestat: $(objpfx)memusagestat
  346. memusagestat-modules = memusagestat
  347. cpp-srcs-left := $(memusagestat-modules)
  348. lib := memusagestat
  349. include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
  350. LDLIBS-memusagestat = $(libgd-LDFLAGS) -lgd -lpng -lz -lm
  351. ifeq ($(run-built-tests),yes)
  352. ifeq (yes,$(build-shared))
  353. ifneq ($(PERL),no)
  354. tests-special += $(objpfx)tst-mtrace.out
  355. tests-special += $(objpfx)tst-dynarray-mem.out
  356. tests-special += $(objpfx)tst-dynarray-fail-mem.out
  357. tests-special += $(objpfx)tst-free-aligned-sized-mtrace.out
  358. tests-special += $(objpfx)tst-free-sized-mtrace.out
  359. endif
  360. endif
  361. endif
  362. include ../Rules
  363. CFLAGS-mcheck-init.c += $(PIC-ccflag)
  364. CFLAGS-obstack.c += $(uses-callbacks)
  365. $(objpfx)libmcheck.a: $(objpfx)mcheck-init.o
  366. -rm -f $@
  367. $(patsubst %/,cd % &&,$(objpfx)) \
  368. $(LN_S) $(<F) $(@F)
  369. lib: $(objpfx)libmcheck.a
  370. ifeq ($(run-built-tests),yes)
  371. ifeq (yes,$(build-shared))
  372. ifneq ($(PERL),no)
  373. $(objpfx)tst-mtrace.out: tst-mtrace.sh $(objpfx)tst-mtrace
  374. $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
  375. '$(run-program-env)' '$(test-program-prefix-after-env)'; \
  376. $(evaluate-test)
  377. endif
  378. endif
  379. endif
  380. malloc-check-env = \
  381. MALLOC_CHECK_=3 \
  382. LD_PRELOAD=$(objpfx)/libc_malloc_debug.so
  383. malloc-check-tunables-env = \
  384. GLIBC_TUNABLES=glibc.malloc.check=3 \
  385. LD_PRELOAD=$(objpfx)/libc_malloc_debug.so
  386. tst-malloc-check-ENV = $(malloc-check-env)
  387. tst-malloc-usable-ENV = $(malloc-check-env)
  388. tst-malloc-usable-threaded-main-ENV = $(malloc-check-env)
  389. tst-malloc-usable-threaded-worker-ENV = $(malloc-check-env)
  390. tst-malloc-usable-tunables-ENV = $(malloc-check-tunables-env)
  391. tst-malloc-usable-tunables-threaded-main-ENV = $(malloc-check-tunables-env)
  392. tst-malloc-usable-tunables-threaded-worker-ENV = $(malloc-check-tunables-env)
  393. CPPFLAGS-malloc-debug.c += -DUSE_TCACHE=0
  394. CPPFLAGS-malloc.c += -DUSE_TCACHE=1
  395. # Uncomment this for test releases. For public releases it is too expensive.
  396. #CPPFLAGS-malloc.o += -DMALLOC_DEBUG=1
  397. CFLAGS-tst-tcfree3.c += -fno-builtin-malloc -fno-builtin-free
  398. sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,')
  399. $(objpfx)mtrace: mtrace.pl
  400. rm -f $@.new
  401. sed -e 's|@XXX@|$(address-width)|' \
  402. -e 's|@VERSION@|$(version)|' \
  403. -e 's|@PKGVERSION@|$(PKGVERSION)|' \
  404. -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \
  405. && rm -f $@ && mv $@.new $@ && chmod +x $@
  406. $(objpfx)memusage: memusage.sh
  407. rm -f $@.new
  408. sed -e 's|@VERSION@|$(version)|' -e 's|@SLIBDIR@|$(sLIBdir)|' \
  409. -e 's|@BINDIR@|$(bindir)|' -e 's|@PKGVERSION@|$(PKGVERSION)|' \
  410. -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \
  411. && rm -f $@ && mv $@.new $@ && chmod +x $@
  412. # Compile the tests with a flag which suppresses the mallopt call in
  413. # the test skeleton.
  414. $(tests:%=$(objpfx)%.o): CPPFLAGS += -DTEST_NO_MALLOPT
  415. $(objpfx)tst-interpose-nothread: $(objpfx)tst-interpose-aux-nothread.o
  416. $(objpfx)tst-interpose-nothread-mcheck: $(objpfx)tst-interpose-aux-nothread.o
  417. $(objpfx)tst-interpose-nothread-malloc-check: \
  418. $(objpfx)tst-interpose-aux-nothread.o
  419. $(objpfx)tst-interpose-thread: $(objpfx)tst-interpose-aux-thread.o
  420. $(objpfx)tst-interpose-thread-mcheck: $(objpfx)tst-interpose-aux-thread.o
  421. $(objpfx)tst-interpose-thread-malloc-check: $(objpfx)tst-interpose-aux-thread.o
  422. $(objpfx)tst-interpose-static-nothread: $(objpfx)tst-interpose-aux-nothread.o
  423. $(objpfx)tst-interpose-static-thread: \
  424. $(objpfx)tst-interpose-aux-thread.o $(static-thread-library)
  425. tst-dynarray-ENV = MALLOC_TRACE=$(objpfx)tst-dynarray.mtrace \
  426. LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  427. $(objpfx)tst-dynarray-mem.out: $(objpfx)tst-dynarray.out
  428. $(common-objpfx)malloc/mtrace $(objpfx)tst-dynarray.mtrace > $@; \
  429. $(evaluate-test)
  430. tst-dynarray-fail-ENV = MALLOC_TRACE=$(objpfx)tst-dynarray-fail.mtrace \
  431. LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  432. $(objpfx)tst-dynarray-fail-mem.out: $(objpfx)tst-dynarray-fail.out
  433. $(common-objpfx)malloc/mtrace $(objpfx)tst-dynarray-fail.mtrace > $@; \
  434. $(evaluate-test)
  435. tst-compathooks-on-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  436. tst-compathooks-on-mcheck-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  437. tst-compathooks-on-malloc-check-ENV = \
  438. LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  439. tst-mallocstate-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  440. tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  441. # The test needs malloc_get_state/malloc_set_state which is in
  442. # libc_malloc_debug.so.
  443. $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
  444. $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
  445. tst-mallocstate-threaded-main-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  446. $(objpfx)tst-mallocstate-threaded-main: $(objpfx)libc_malloc_debug.so
  447. tst-mallocstate-threaded-worker-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  448. $(objpfx)tst-mallocstate-threaded-worker: $(objpfx)libc_malloc_debug.so
  449. $(objpfx)tst-aligned-alloc-random.out: $(objpfx)tst-aligned_alloc-lib.so
  450. $(objpfx)tst-aligned-alloc-random-thread.out: $(objpfx)tst-aligned_alloc-lib.so
  451. $(objpfx)tst-aligned-alloc-random-thread-cross.out: $(objpfx)tst-aligned_alloc-lib.so
  452. $(objpfx)tst-malloc-random.out: $(objpfx)tst-aligned_alloc-lib.so
  453. tst-aligned-alloc-random-ENV = LD_PRELOAD=$(objpfx)tst-aligned_alloc-lib.so
  454. tst-aligned-alloc-random-thread-ENV = LD_PRELOAD=$(objpfx)tst-aligned_alloc-lib.so
  455. tst-aligned-alloc-random-thread-cross-ENV = LD_PRELOAD=$(objpfx)tst-aligned_alloc-lib.so
  456. tst-malloc-random-ENV = LD_PRELOAD=$(objpfx)tst-aligned_alloc-lib.so
  457. tst-free-aligned-sized-trace-ENV = MALLOC_TRACE=$(objpfx)tst-free-aligned-sized-mem.mtrace \
  458. LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  459. $(objpfx)tst-free-aligned-sized-mtrace.out: $(objpfx)tst-free-aligned-sized-trace.out
  460. $(common-objpfx)malloc/mtrace $(objpfx)tst-free-aligned-sized-mem.mtrace > $@; \
  461. $(evaluate-test)
  462. tst-free-sized-trace-ENV = MALLOC_TRACE=$(objpfx)tst-free-sized-mem.mtrace \
  463. LD_PRELOAD=$(objpfx)libc_malloc_debug.so
  464. $(objpfx)tst-free-sized-mtrace.out: $(objpfx)tst-free-sized-trace.out
  465. $(common-objpfx)malloc/mtrace $(objpfx)tst-free-sized-mem.mtrace > $@; \
  466. $(evaluate-test)