This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[jit] Ensure dlerror failures lead to the overall "compilation" failing
- From: David Malcolm <dmalcolm at redhat dot com>
- To: jit at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Fri, 25 Apr 2014 16:08:22 -0400
- Subject: [jit] Ensure dlerror failures lead to the overall "compilation" failing
- Authentication-results: sourceware.org; auth=none
Committed to branch dmalcolm/jit:
gcc/jit/
* internal-api.c (gcc::jit::playback::context::compile): Put
any output of dlerror through the add_error method, rather
than merely printing it to stderr, so that the error is also
recorded on the context.
---
gcc/jit/ChangeLog.jit | 7 +++++++
gcc/jit/internal-api.c | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/gcc/jit/ChangeLog.jit b/gcc/jit/ChangeLog.jit
index d4ed6cf..ccf8a10 100644
--- a/gcc/jit/ChangeLog.jit
+++ b/gcc/jit/ChangeLog.jit
@@ -1,3 +1,10 @@
+2014-04-25 David Malcolm <dmalcolm@redhat.com>
+
+ * internal-api.c (gcc::jit::playback::context::compile): Put
+ any output of dlerror through the add_error method, rather
+ than merely printing it to stderr, so that the error is also
+ recorded on the context.
+
2014-03-19 Tom Tromey <tromey@redhat.com>
* internal-api.c (compile): Use auto_timevar.
diff --git a/gcc/jit/internal-api.c b/gcc/jit/internal-api.c
index f9f4d8e..f45595e 100644
--- a/gcc/jit/internal-api.c
+++ b/gcc/jit/internal-api.c
@@ -3771,7 +3771,7 @@ compile ()
handle = dlopen (m_path_so_file, RTLD_NOW | RTLD_LOCAL);
if ((error = dlerror()) != NULL) {
- fprintf(stderr, "%s\n", error);
+ add_error (NULL, "%s", error);
}
if (handle)
result_obj = new result (handle);
--
1.8.5.3