public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: jit@gcc.gnu.org, gcc-patches@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [jit] Ensure dlerror failures lead to the overall "compilation" failing
Date: Fri, 25 Apr 2014 20:08:00 -0000	[thread overview]
Message-ID: <1398456502-25045-1-git-send-email-dmalcolm@redhat.com> (raw)

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

                 reply	other threads:[~2014-04-25 20:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398456502-25045-1-git-send-email-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).