public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, libmpx, i386, PR driver/65444] Pass '-z bndplt' when building dynamic objects with MPX
@ 2015-03-18 11:56 Ilya Enkovich
  2015-03-18 12:03 ` H.J. Lu
  2015-03-23 10:19 ` Ilya Enkovich
  0 siblings, 2 replies; 49+ messages in thread
From: Ilya Enkovich @ 2015-03-18 11:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: ubizjak

Hi,

This patch fixes PR target/65444 by passing '-z bndplt' to linker when appropriate.  Bootstrapped and tested on x86_64-unknown-linux-gnu.  Will commit it to trunk in a couple of days if no objections arise.

Thanks,
Ilya
--
gcc/

2015-03-18  Ilya Enkovich  <ilya.enkovich@intel.com>

	PR driver/65444
	* config/i386/linux-common.h (MPX_SPEC): New.
	(CHKP_SPEC): Add MPX_SPEC.

libmpx/

2015-03-18  Ilya Enkovich  <ilya.enkovich@intel.com>

	PR driver/65444
	* configure.ac: Add check for '-z bndplt' support
	by linker. Add link_mpx output variable.
	* libmpx.spec.in (link_mpx): New.
	* configure: Regenerate.


diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h
index 9c6560b..dd79ec6 100644
--- a/gcc/config/i386/linux-common.h
+++ b/gcc/config/i386/linux-common.h
@@ -59,6 +59,11 @@ along with GCC; see the file COPYING3.  If not see
  %:include(libmpx.spec)%(link_libmpx)"
 #endif
 
+#ifndef MPX_SPEC
+#define MPX_SPEC "\
+ %{mmpx:%{fcheck-pointer-bounds:%{!static:%:include(libmpx.spec)%(link_mpx)}}}"
+#endif
+
 #ifndef LIBMPX_SPEC
 #if defined(HAVE_LD_STATIC_DYNAMIC)
 #define LIBMPX_SPEC "\
@@ -89,5 +94,5 @@ along with GCC; see the file COPYING3.  If not see
 
 #ifndef CHKP_SPEC
 #define CHKP_SPEC "\
-%{!nostdlib:%{!nodefaultlibs:" LIBMPX_SPEC LIBMPXWRAPPERS_SPEC "}}"
+%{!nostdlib:%{!nodefaultlibs:" LIBMPX_SPEC LIBMPXWRAPPERS_SPEC "}}" MPX_SPEC
 #endif
diff --git a/libmpx/configure.ac b/libmpx/configure.ac
index fe0d3f2..3f8b50f 100644
--- a/libmpx/configure.ac
+++ b/libmpx/configure.ac
@@ -40,7 +40,18 @@ AC_MSG_RESULT($LIBMPX_SUPPORTED)
 AM_CONDITIONAL(LIBMPX_SUPPORTED, [test "x$LIBMPX_SUPPORTED" = "xyes"])
 
 link_libmpx="-lpthread"
+link_mpx=""
+AC_MSG_CHECKING([whether ld accepts -z bndplt])
+echo "int main() {};" > conftest.c
+if AC_TRY_COMMAND([${CC} ${CFLAGS} -Wl,-z,bndplt -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+    AC_MSG_RESULT([yes])
+    link_mpx="$link_mpx -z bndplt"
+else
+    AC_MSG_RESULT([no])
+fi
 AC_SUBST(link_libmpx)
+AC_SUBST(link_mpx)
 
 AM_INIT_AUTOMAKE(foreign no-dist no-dependencies)
 AM_ENABLE_MULTILIB(, ..)
diff --git a/libmpx/libmpx.spec.in b/libmpx/libmpx.spec.in
index a265e28..34d0bdf 100644
--- a/libmpx/libmpx.spec.in
+++ b/libmpx/libmpx.spec.in
@@ -1,3 +1,5 @@
 # This spec file is read by gcc when linking.  It is used to specify the
-# standard libraries we need in order to link with libcilkrts.
+# standard libraries we need in order to link with libmpx.
 *link_libmpx: @link_libmpx@
+
+*link_mpx: @link_mpx@

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2015-06-25 18:52 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-18 11:56 [PATCH, libmpx, i386, PR driver/65444] Pass '-z bndplt' when building dynamic objects with MPX Ilya Enkovich
2015-03-18 12:03 ` H.J. Lu
2015-03-18 12:05   ` Ilya Enkovich
2015-03-18 12:08     ` H.J. Lu
2015-03-18 12:13       ` Ilya Enkovich
2015-03-18 12:25         ` H.J. Lu
2015-03-18 12:42           ` Richard Biener
2015-03-18 13:24             ` Ilya Enkovich
2015-03-18 13:32               ` H.J. Lu
2015-03-18 13:41                 ` Ilya Enkovich
2015-03-18 13:52                   ` H.J. Lu
2015-03-18 13:59                     ` Ilya Enkovich
2015-03-18 14:02                       ` Jakub Jelinek
2015-03-18 14:31                         ` H.J. Lu
2015-03-18 14:42                           ` H.J. Lu
2015-03-18 16:14                             ` Ilya Enkovich
2015-03-18 16:45                               ` H.J. Lu
2015-03-18 17:13                                 ` Ilya Enkovich
2015-03-18 17:14                                   ` H.J. Lu
2015-03-18 17:34                                     ` Ilya Enkovich
2015-03-18 17:39                                       ` H.J. Lu
2015-03-18 18:13                                         ` Ilya Enkovich
2015-03-18 14:03                       ` Robert Dewar
2015-03-18 14:33                         ` Markus Trippelsdorf
2015-03-23 10:19 ` Ilya Enkovich
2015-03-31  9:47   ` Ilya Enkovich
2015-04-02  4:34     ` Jeff Law
2015-04-02 11:01       ` H.J. Lu
2015-04-03 19:34     ` Joseph Myers
2015-04-06  1:45       ` Sandra Loosemore
2015-04-06  2:35         ` H.J. Lu
2015-04-06  3:08           ` Sandra Loosemore
2015-04-06 15:18         ` Ilya Enkovich
2015-04-06 15:28           ` Jeff Law
2015-04-06 15:54             ` Ilya Enkovich
2015-05-26  9:26             ` Ilya Enkovich
2015-05-27 15:35               ` Jeff Law
2015-06-03  9:04                 ` Ilya Enkovich
2015-06-03 15:29                   ` Joseph Myers
2015-06-03 15:59                     ` Ilya Enkovich
2015-06-03 16:03                       ` Joseph Myers
2015-06-04 14:14                         ` Ilya Enkovich
2015-06-04 15:55                           ` Joseph Myers
2015-06-05 14:44                             ` Ilya Enkovich
2015-06-25 19:00                               ` Jeff Law
2015-04-06 17:15           ` Sandra Loosemore
2015-04-07 19:01             ` Jeff Law
2015-04-07 19:29               ` H.J. Lu
2015-04-07 20:12                 ` Markus Trippelsdorf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).