From: Florian Weimer Date: Tue, 2 Aug 2016 15:01:02 +0000 (+0200) Subject: malloc: Run tests without calling mallopt [BZ #19469] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=124ea50584d3d21fe4c2fe9383508efd0ac9010a;p=thirdparty%2Fglibc.git 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.) --- diff --git a/ChangeLog b/ChangeLog index c5ad098e049..dbdb77c54e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2016-08-02 Florian Weimer + + [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 [BZ #17730] diff --git a/malloc/Makefile b/malloc/Makefile index 071f9179600..6e19a426120 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 6a7fc429d4e..5f1b54396ad 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);