aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-08-02 17:01:02 +0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-01-27 13:16:52 -0200
commit124ea50584d3d21fe4c2fe9383508efd0ac9010a (patch)
tree5d92eef1ec699a0c4304336b3418e69b238ffdef
parent5a8692a64640bb648de6be9877dc072d728859bd (diff)
downloadglibc-124ea50584d3d21fe4c2fe9383508efd0ac9010a.zip
glibc-124ea50584d3d21fe4c2fe9383508efd0ac9010a.tar.gz
glibc-124ea50584d3d21fe4c2fe9383508efd0ac9010a.tar.bz2
malloc: Run tests without calling mallopt [BZ #19469]
The compiled tests no longer refer to the mallopt symbol from their main functions. (Some tests still call mallopt explicitly, which is fine.)
-rw-r--r--ChangeLog7
-rw-r--r--malloc/Makefile4
-rw-r--r--test-skeleton.c2
3 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c5ad098..dbdb77c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-08-02 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #19469]
+ * malloc/Makefile (CPPFLAGS): Compile tests with
+ -DTEST_NO_MALLOPT.
+ * test-skeleton.c (main): Only call mallopt if !TEST_NO_MALLOPT.
+
2016-08-03 Florian Weimer <fweimer@redhat.com>
[BZ #17730]
diff --git a/malloc/Makefile b/malloc/Makefile
index 071f917..6e19a42 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -158,3 +158,7 @@ $(objpfx)libmemusage.so: $(libdl)
# Extra dependencies
$(foreach o,$(all-object-suffixes),$(objpfx)malloc$(o)): arena.c hooks.c
+
+# Compile the tests with a flag which suppresses the mallopt call in
+# the test skeleton.
+$(tests:%=$(objpfx)%.o): CPPFLAGS += -DTEST_NO_MALLOPT
diff --git a/test-skeleton.c b/test-skeleton.c
index 6a7fc42..5f1b543 100644
--- a/test-skeleton.c
+++ b/test-skeleton.c
@@ -236,8 +236,10 @@ main (int argc, char *argv[])
unsigned int timeoutfactor = 1;
pid_t termpid;
+#ifndef TEST_NO_MALLOPT
/* Make uses of freed and uninitialized memory known. */
mallopt (M_PERTURB, 42);
+#endif
#ifdef STDOUT_UNBUFFERED
setbuf (stdout, NULL);