diff --git a/src/vppinfra/dlmalloc.c b/src/vppinfra/dlmalloc.c
index 03e7d87..143db33 100644
--- a/src/vppinfra/dlmalloc.c
+++ b/src/vppinfra/dlmalloc.c
@@ -6,7 +6,6 @@
 */
 
 #include <vppinfra/dlmalloc.h>
-#include <vppinfra/sanitizer.h>
 
 /*------------------------------ internal #includes ---------------------- */
 
@@ -460,7 +459,7 @@
 
 #if !defined(USE_RECURSIVE_LOCKS) || USE_RECURSIVE_LOCKS == 0
 /* Plain spin locks use single word (embedded in malloc_states) */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static int spin_acquire_lock(int *sl) {
   int spins = 0;
   while (*(volatile int *)sl != 0 || CAS_LOCK(sl)) {
@@ -1286,7 +1285,7 @@
   ((char*)(A) >= S->base && (char*)(A) < S->base + S->size)
 
 /* Return segment holding given address */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static msegmentptr segment_holding(mstate m, char* addr) {
   msegmentptr sp = &m->seg;
   for (;;) {
@@ -1298,7 +1297,7 @@
 }
 
 /* Return true if segment contains a segment link */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static int has_segment_link(mstate m, msegmentptr ss) {
   msegmentptr sp = &m->seg;
   for (;;) {
@@ -1616,7 +1615,7 @@
 
 #if (FOOTERS && !INSECURE)
 /* Check if (alleged) mstate m has expected magic field */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static inline int
 ok_magic (const mstate m)
 {
@@ -2083,7 +2082,7 @@
 /* ----------------------------- statistics ------------------------------ */
 
 #if !NO_MALLINFO
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static struct dlmallinfo internal_mallinfo(mstate m) {
   struct dlmallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
   ensure_initialization();
@@ -2493,7 +2492,7 @@
 /* -------------------------- mspace management -------------------------- */
 
 /* Initialize top chunk and its size */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static void init_top(mstate m, mchunkptr p, size_t psize) {
   /* Ensure alignment */
   size_t offset = align_offset(chunk2mem(p));
@@ -2538,7 +2537,7 @@
 #endif /* PROCEED_ON_ERROR */
 
 /* Allocate chunk and prepend remainder with chunk in successor base. */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static void* prepend_alloc(mstate m, char* newbase, char* oldbase,
                            size_t nb) {
   mchunkptr p = align_as_chunk(newbase);
@@ -2581,7 +2580,7 @@
 }
 
 /* Add a segment to hold a new noncontiguous region */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) {
   /* Determine locations and sizes of segment, fenceposts, old top */
   char* old_top = (char*)m->top;
@@ -2637,7 +2636,7 @@
 /* -------------------------- System allocation -------------------------- */
 
 /* Get memory from system using MORECORE or MMAP */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static void* sys_alloc(mstate m, size_t nb) {
   char* tbase = CMFAIL;
   size_t tsize = 0;
@@ -2852,7 +2851,7 @@
 /* -----------------------  system deallocation -------------------------- */
 
 /* Unmap and unlink any mmapped segments that don't contain used chunks */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static size_t release_unused_segments(mstate m) {
   size_t released = 0;
   int nsegs = 0;
@@ -2900,7 +2899,7 @@
   return released;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static int sys_trim(mstate m, size_t pad) {
   size_t released = 0;
   ensure_initialization();
@@ -2969,7 +2968,7 @@
 /* Consolidate and bin a chunk. Differs from exported versions
    of free mainly in that the chunk need not be marked as inuse.
 */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static void dispose_chunk(mstate m, mchunkptr p, size_t psize) {
   mchunkptr next = chunk_plus_offset(p, psize);
   if (!pinuse(p)) {
@@ -3041,7 +3040,7 @@
 /* ---------------------------- malloc --------------------------- */
 
 /* allocate a large request from the best fitting chunk in a treebin */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static void* tmalloc_large(mstate m, size_t nb) {
   tchunkptr v = 0;
   size_t rsize = -nb; /* Unsigned negation */
@@ -3113,7 +3112,7 @@
 }
 
 /* allocate a small request from the best fitting chunk in a treebin */
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static void* tmalloc_small(mstate m, size_t nb) {
   tchunkptr t, v;
   size_t rsize;
@@ -3420,7 +3419,7 @@
 /* ------------ Internal support for realloc, memalign, etc -------------- */
 
 /* Try to realloc; only in-place unless can_move true */
-static CLIB_NOSANITIZE_ADDR mchunkptr try_realloc_chunk(mstate m, mchunkptr p, size_t nb,
+static __clib_nosanitize_addr mchunkptr try_realloc_chunk(mstate m, mchunkptr p, size_t nb,
                                    int can_move) {
   mchunkptr newp = 0;
   size_t oldsize = chunksize(p);
@@ -3499,7 +3498,7 @@
   return newp;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {
   void* mem = 0;
   if (alignment <  MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */
@@ -4082,7 +4081,7 @@
   return ret;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 size_t destroy_mspace(mspace msp) {
   size_t freed = 0;
   mstate ms = (mstate)msp;
@@ -4118,7 +4117,7 @@
   *sizep = this_seg->size;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 int mspace_is_heap_object (mspace msp, void *p)
 {
   msegment *this_seg;
@@ -4144,7 +4143,7 @@
   return 0;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 void *mspace_least_addr (mspace msp)
 {
   mstate ms = (mstate) msp;
@@ -4158,7 +4157,7 @@
   disable_expand (ms);
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 int mspace_enable_disable_trace (mspace msp, int enable)
 {
   mstate ms = (mstate)msp;
@@ -4175,7 +4174,7 @@
   return (was_enabled);
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 int mspace_is_traced (mspace msp)
 {
   mstate ms = (mstate)msp;
@@ -4185,7 +4184,7 @@
   return 0;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 void* mspace_get_aligned (mspace msp,
                           unsigned long n_user_data_bytes,
                           unsigned long align,
@@ -4265,7 +4264,7 @@
   return (void *) searchp;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 void mspace_put (mspace msp, void *p_arg)
 {
   char *object_header;
@@ -4315,7 +4314,7 @@
   mspace_free (msp, p_arg);
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 size_t mspace_usable_size_with_delta (const void *p)
 {
   size_t usable_size;
@@ -4341,7 +4340,7 @@
   versions. This is not so nice but better than the alternatives.
 */
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 void* mspace_malloc(mspace msp, size_t bytes) {
   mstate ms = (mstate)msp;
   if (!ok_magic(ms)) {
@@ -4456,7 +4455,7 @@
   return 0;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 void mspace_free(mspace msp, void* mem) {
   if (mem != 0) {
     mchunkptr p  = mem2chunk(mem);
@@ -4623,7 +4622,7 @@
   return mem;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 void* mspace_realloc_in_place(mspace msp, void* oldmem, size_t bytes) {
   void* mem = 0;
   if (oldmem != 0) {
@@ -4656,7 +4655,7 @@
   return mem;
 }
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) {
   mstate ms = (mstate)msp;
   if (!ok_magic(ms)) {
@@ -4796,7 +4795,7 @@
 }
 
 #if !NO_MALLINFO
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 struct dlmallinfo mspace_mallinfo(mspace msp) {
   mstate ms = (mstate)msp;
   if (!ok_magic(ms)) {
@@ -4806,7 +4805,7 @@
 }
 #endif /* NO_MALLINFO */
 
-CLIB_NOSANITIZE_ADDR
+__clib_nosanitize_addr
 size_t mspace_usable_size(const void* mem) {
   if (mem != 0) {
     mchunkptr p = mem2chunk(mem);
