aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2015-08-14 01:18:14 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2015-08-14 01:18:14 +0000
commitbaf3fbad0de4fd24bb8ed34f4b8bde9715fee33f (patch)
tree80fbb70cb9c8b0ee23ce5adf5a4faa851146543d /gcc
parent3f7fd1822b4e0e771008edbdf13d3894a9871f83 (diff)
downloadgcc-baf3fbad0de4fd24bb8ed34f4b8bde9715fee33f.zip
gcc-baf3fbad0de4fd24bb8ed34f4b8bde9715fee33f.tar.gz
gcc-baf3fbad0de4fd24bb8ed34f4b8bde9715fee33f.tar.bz2
jit: on OS X, add -Wl,-undefined,dynamic_lookup to driver invocation
gcc/jit/ChangeLog: * jit-playback.c (invoke_driver): On OS X, add "-Wl,-undefined,dynamic_lookup" to the driver arguments. From-SVN: r226882
Diffstat (limited to 'gcc')
-rw-r--r--gcc/jit/ChangeLog5
-rw-r--r--gcc/jit/jit-playback.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog
index 2cb6dfc..efa0d88 100644
--- a/gcc/jit/ChangeLog
+++ b/gcc/jit/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-13 David Malcolm <dmalcolm@redhat.com>
+
+ * jit-playback.c (invoke_driver): On OS X, add
+ "-Wl,-undefined,dynamic_lookup" to the driver arguments.
+
2015-08-03 David Malcolm <dmalcolm@redhat.com>
* docs/topics/compatibility.rst (LIBGCCJIT_ABI_4): New.
diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
index 925fa86..01cfd4b 100644
--- a/gcc/jit/jit-playback.c
+++ b/gcc/jit/jit-playback.c
@@ -2416,6 +2416,15 @@ invoke_driver (const char *ctxt_progname,
time. */
ADD_ARG ("-fno-use-linker-plugin");
+#if defined (DARWIN_X86) || defined (DARWIN_PPC)
+ /* OS X's linker defaults to treating undefined symbols as errors.
+ If the context has any imported functions or globals they will be
+ undefined until the .so is dynamically-linked into the process.
+ Ensure that the driver passes in "-undefined dynamic_lookup" to the
+ linker. */
+ ADD_ARG ("-Wl,-undefined,dynamic_lookup");
+#endif
+
/* pex argv arrays are NULL-terminated. */
argvec.safe_push (NULL);