build: Only emit link warnings for ELF objects
diff --git a/src/local-link.h b/src/local-link.h
index 6782d9a..7e9053b 100644
--- a/src/local-link.h
+++ b/src/local-link.h
@@ -29,9 +29,13 @@
#include <sys/cdefs.h>
+#ifdef __ELF__
#define libbsd_link_warning(symbol, msg) \
static const char libbsd_emit_link_warning_##symbol[] \
__attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg
+#else
+#define libbsd_link_warning(symbol, msg)
+#endif
#ifdef __ELF__
# if __has_attribute(symver)