]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix build problems on MacOSX pertaining to r14283.
authorJulian Seward <jseward@acm.org>
Sun, 17 Aug 2014 12:23:56 +0000 (12:23 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 17 Aug 2014 12:23:56 +0000 (12:23 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14298

auxprogs/Makefile.am

index 2195338bae96763454190e9462b5600c02cb6f4b..c3c67a42f5a082c0ebdc87cd4bf991fd6f62f73f 100644 (file)
@@ -56,11 +56,18 @@ endif
 # getoff-<platform>
 # 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