On Mon, Aug 12, 2024 at 01:16:43PM +0200, Antonio Caggiano wrote:
-M is not a valid flag for MacOS ld.
Signed-off-by: Antonio Caggiano <quic_acaggian(a)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.
Thanks, upstream in e17d794d11
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v