]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add libmtracectl.so
authorDJ Delorie <dj@delorie.com>
Thu, 12 May 2016 23:49:36 +0000 (19:49 -0400)
committerDJ Delorie <dj@delorie.com>
Thu, 12 May 2016 23:49:36 +0000 (19:49 -0400)
Update Makefiles to build libmtracectl.so

Tweak mtrace-ctl.c to avoid compiler warnings.

Makeconfig
malloc/Makefile
malloc/mtrace-ctl.c

index 901e253453e769883e65f6118993c7c1fb0b6736..13396c35924ca8322f1cfd5e6cc0a82866e1166a 100644 (file)
@@ -848,7 +848,7 @@ endif       # $(+cflags) == ""
 libio-include = -I$(..)libio
 
 # List of non-library modules that we build.
-built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \
+built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage libmtracectl \
                libSegFault libpcprofile librpcsvc locale-programs \
                memusagestat nonlib nscd extramodules libnldbl
 
index 3283f4f75fc8e55ce59077c0f5de22aa4cae2daf..ed87b1829a42f8cdb6cb57104d9873e13d3b0244 100644 (file)
@@ -40,12 +40,15 @@ install-lib := libmcheck.a
 non-lib.a := libmcheck.a
 
 # Additional library.
-extra-libs = libmemusage
+extra-libs = libmemusage libmtracectl
 extra-libs-others = $(extra-libs)
 
 libmemusage-routines = memusage
 libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes))
 
+libmtracectl-routines = mtrace-ctl
+libmtracectl-inhibit-o = $(filter-out .os,$(object-suffixes))
+
 $(objpfx)tst-malloc-backtrace: $(shared-thread-library)
 $(objpfx)tst-malloc-thread-exit: $(shared-thread-library)
 $(objpfx)tst-malloc-thread-fail: $(shared-thread-library)
index d972dfcaaea541816b7ef036128202eec36fe8c7..949098a2712d7640c165bf7c89d33ac88c580212 100644 (file)
@@ -26,9 +26,9 @@ err(const char *str)
 }
 
 void __attribute__((constructor))
-djmain()
+djmain(void)
 {
-  char *e;
+  const char *e;
   size_t sz;
 
   e = getenv("MTRACE_CTL_COUNT");
@@ -60,7 +60,7 @@ const char * const typenames[] = {
 };
 
 void __attribute__((destructor))
-djend()
+djend(void)
 {
   char *e;
   FILE *outf;
@@ -95,7 +95,7 @@ djend()
        case __MTB_TYPE_UNUSED:
          break;
        default:
-         fprintf (outf, "%08x %s %c%c%c%c%c%c%c%c %016x %016x %016x\n",
+         fprintf (outf, "%08x %s %c%c%c%c%c%c%c%c %016llx %016llx %016llx\n",
                   t->thread,
                   typenames[t->type],
                   t->path_thread_cache ? 'T' : '-',
@@ -106,9 +106,9 @@ djend()
                   t->path_munmap ? 'U' : '-',
                   t->path_m_f_realloc ? 'R' : '-',
                   t->path_hook ? 'H' : '-',
-                  t->ptr1,
-                  t->size,
-                  t->ptr2);
+                  (long long unsigned int) t->ptr1,
+                  (long long unsigned int) t->size,
+                  (long long unsigned int) t->ptr2);
          break;
        }
     }