irops.c \
valgrind.c
+# The link flags for this are tricky, because we want to build it for
+# both the primary and secondary platforms, and add
+# "-Wl,-read_only_relocs -Wl,suppress" to whichever of those is x86-darwin,
+# if any. Hence there's a double-nested conditional that adds to the
+# LDFLAGS in both cases.
+
vbit_test_SOURCES = $(SOURCES)
vbit_test_CPPFLAGS = $(AM_CPPFLAGS_PRI) \
-I$(top_srcdir)/include \
vbit_test_DEPENDENCIES =
vbit_test_LDADD = $(top_builddir)/VEX/libvex-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
vbit_test_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
+# If there is no secondary platform, and the platforms include x86-darwin,
+# then the primary platform must be x86-darwin. Hence:
+if ! VGCONF_HAVE_PLATFORM_SEC
+if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
+vbit_test_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
+endif
+endif
if VGCONF_HAVE_PLATFORM_SEC
vbit_test_sec_SOURCES = $(SOURCES)
vbit_test_sec_LDFLAGS = $(AM_CFLAGS_SEC) @LIB_UBSAN@ \
$(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
endif
+# If there is a secondary platform, and the platforms include x86-darwin,
+# then the primary platform must be amd64-darwin and the secondary platform
+# must be x86-darwin. Hence:
+if VGCONF_HAVE_PLATFORM_SEC
+if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
+vbit_test_sec_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
+endif
+endif