From: Julian Seward Date: Sun, 17 Aug 2014 12:23:56 +0000 (+0000) Subject: Fix build problems on MacOSX pertaining to r14283. X-Git-Tag: svn/VALGRIND_3_10_0~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fcc17e9a9e1eee934d5603d5afc41fc276e268a;p=thirdparty%2Fvalgrind.git Fix build problems on MacOSX pertaining to r14283. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14298 --- diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index 2195338bae..c3c67a42f5 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -56,11 +56,18 @@ endif # getoff- # Used to retrieve user space various offsets, using user space libraries. #---------------------------------------------------------------------------- + noinst_PROGRAMS = getoff-@VGCONF_ARCH_PRI@-@VGCONF_OS@ if VGCONF_HAVE_PLATFORM_SEC noinst_PROGRAMS += getoff-@VGCONF_ARCH_SEC@-@VGCONF_OS@ endif +# 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. + getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = getoff.c getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) @@ -69,6 +76,13 @@ getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI) if HAVE_DLINFO_RTLD_DI_TLS_MODID getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = $(LDADD) -ldl endif +# 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 +getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress +endif +endif if VGCONF_HAVE_PLATFORM_SEC getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = getoff.c @@ -80,6 +94,14 @@ if HAVE_DLINFO_RTLD_DI_TLS_MODID getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = $(LDADD) -ldl endif 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 +getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress +endif +endif #---------------------------------------------------------------------------- # General stuff