diff --git a/lib/libnvpair/Makefile.am b/lib/libnvpair/Makefile.am index 340e6d362..ec16c5d52 100644 --- a/lib/libnvpair/Makefile.am +++ b/lib/libnvpair/Makefile.am @@ -31,7 +31,11 @@ libnvpair_la_LIBADD = \ libnvpair_la_LIBADD += $(LIBTIRPC_LIBS) $(LTLIBINTL) -libnvpair_la_LDFLAGS = -Wl,-z,defs +libnvpair_la_LDFLAGS = + +if !ASAN_ENABLED +libnvpair_la_LDFLAGS += -Wl,-z,defs +endif if BUILD_FREEBSD libnvpair_la_LDFLAGS += -version-info 3:0:0 diff --git a/lib/libuutil/Makefile.am b/lib/libuutil/Makefile.am index 4143a190b..8d9b32e44 100644 --- a/lib/libuutil/Makefile.am +++ b/lib/libuutil/Makefile.am @@ -21,7 +21,11 @@ libuutil_la_LIBADD = \ libuutil_la_LIBADD += $(LTLIBINTL) -libuutil_la_LDFLAGS = -pthread -Wl,-z,defs +libuutil_la_LDFLAGS = -pthread + +if !ASAN_ENABLED +libuutil_la_LDFLAGS += -Wl,-z,defs +endif if BUILD_FREEBSD libuutil_la_LDFLAGS += -version-info 3:0:0 diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am index 4154e9fee..f88fb828d 100644 --- a/lib/libzfs/Makefile.am +++ b/lib/libzfs/Makefile.am @@ -76,7 +76,11 @@ libzfs_la_LIBADD = \ libzfs_la_LIBADD += -lm $(LIBCRYPTO_LIBS) $(ZLIB_LIBS) $(LTLIBINTL) -libzfs_la_LDFLAGS = -pthread -Wl,-z,defs +libzfs_la_LDFLAGS = -pthread + +if !ASAN_ENABLED +libzfs_la_LDFLAGS += -Wl,-z,defs +endif if BUILD_FREEBSD libzfs_la_LIBADD += -lutil -lgeom diff --git a/lib/libzfs_core/Makefile.am b/lib/libzfs_core/Makefile.am index 94a10e399..e94ba85d2 100644 --- a/lib/libzfs_core/Makefile.am +++ b/lib/libzfs_core/Makefile.am @@ -15,7 +15,11 @@ libzfs_core_la_LIBADD = \ libzfs_core_la_LIBADD += $(LTLIBINTL) -libzfs_core_la_LDFLAGS = -pthread -Wl,-z,defs +libzfs_core_la_LDFLAGS = -pthread + +if !ASAN_ENABLED +libzfs_core_la_LDFLAGS += -Wl,-z,defs +endif if BUILD_FREEBSD libzfs_core_la_LIBADD += -lutil -lgeom diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am index 7924a425d..50658bc67 100644 --- a/lib/libzpool/Makefile.am +++ b/lib/libzpool/Makefile.am @@ -210,7 +210,11 @@ libzpool_la_LIBADD = \ libzpool_la_LIBADD += $(LIBCLOCK_GETTIME) $(ZLIB_LIBS) -ldl -libzpool_la_LDFLAGS = -pthread -Wl,-z,defs +libzpool_la_LDFLAGS = -pthread + +if !ASAN_ENABLED +libzpool_la_LDFLAGS += -Wl,-z,defs +endif if BUILD_FREEBSD libzpool_la_LIBADD += -lgeom