Commit 49c7dd1ca487e71cfb3c324fe76562424213b4bc

Guillem Jover 2023-04-02T22:32:11

build: Only emit link warnings for ELF objects

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)