-M is not a valid flag for MacOS ld.

Signed-off-by: Antonio Caggiano <quic_acagg...@quicinc.com>
---
 m4/guestfs-c.m4 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/m4/guestfs-c.m4 b/m4/guestfs-c.m4
index c6d33183d..44c64b6d6 100644
--- a/m4/guestfs-c.m4
+++ b/m4/guestfs-c.m4
@@ -55,9 +55,12 @@ AC_SUBST([WERROR_CFLAGS])
 CFLAGS="$CFLAGS -fno-strict-overflow -Wno-strict-overflow"
 
 dnl Work out how to specify the linker script to the linker.
+AS_CASE([$host_os],
+  [darwin*], [MAP_SCRIPT_FLAGS="-Wl,-map"],
+  [MAP_SCRIPT_FLAGS="-Wl,-M"])
 VERSION_SCRIPT_FLAGS=-Wl,--version-script=
 `/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null` || \
-    VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
+    VERSION_SCRIPT_FLAGS="$MAP_SCRIPT_FLAGS -Wl,"
 AC_SUBST(VERSION_SCRIPT_FLAGS)
 
 dnl Use -fvisibility=hidden by default in the library.
-- 
2.45.1
_______________________________________________
Libguestfs mailing list -- guestfs@lists.libguestfs.org
To unsubscribe send an email to guestfs-le...@lists.libguestfs.org

Reply via email to