public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Cary Coutant" <ccoutant@google.com>
To: Binutils <binutils@sourceware.org>
Subject: gold patch: fix problem with conditional compilation
Date: Thu, 02 Oct 2008 18:36:00 -0000	[thread overview]
Message-ID: <c17be2b30810021135x316df75cv5c4537ef7c0c3cc8@mail.gmail.com> (raw)

This patch fixes some bad conditional compilation that I put in the
new plugin.cc file with the LTO support patch. It worked fine with
--enable-targets=all, but when enabling only little-endian targets,
the file wouldn't compile because of a spurious 'else'.

Committed as obvious.

-cary


	* plugin.cc (make_sized_plugin_object): Fix conditional
	compilation to work when not all targets are enabled.


Index: plugin.cc
===================================================================
RCS file: /cvs/src/src/gold/plugin.cc,v
retrieving revision 1.1
diff -u -p -r1.1 plugin.cc
--- plugin.cc	19 Sep 2008 22:54:57 -0000	1.1
+++ plugin.cc	2 Oct 2008 18:32:21 -0000
@@ -935,28 +935,44 @@ make_sized_plugin_object(Input_file* inp

   if (target->get_size() == 32)
     {
-#ifdef HAVE_TARGET_32_BIG
       if (target->is_big_endian())
+#ifdef HAVE_TARGET_32_BIG
         obj = new Sized_pluginobj<32, true>(input_file->filename(),
                                             input_file, offset);
+#else
+        gold_error(_("%s: not configured to support "
+		     "32-bit big-endian object"),
+		   input_file->filename().c_str());
 #endif
-#ifdef HAVE_TARGET_32_LITTLE
       else
+#ifdef HAVE_TARGET_32_LITTLE
         obj = new Sized_pluginobj<32, false>(input_file->filename(),
                                              input_file, offset);
+#else
+        gold_error(_("%s: not configured to support "
+		     "32-bit little-endian object"),
+		   input_file->filename().c_str());
 #endif
     }
   else if (target->get_size() == 64)
     {
-#ifdef HAVE_TARGET_64_BIG
       if (target->is_big_endian())
+#ifdef HAVE_TARGET_64_BIG
         obj = new Sized_pluginobj<64, true>(input_file->filename(),
                                             input_file, offset);
+#else
+        gold_error(_("%s: not configured to support "
+		     "64-bit big-endian object"),
+		   input_file->filename().c_str());
 #endif
-#ifdef HAVE_TARGET_64_LITTLE
       else
+#ifdef HAVE_TARGET_64_LITTLE
         obj = new Sized_pluginobj<64, false>(input_file->filename(),
                                              input_file, offset);
+#else
+        gold_error(_("%s: not configured to support "
+		     "64-bit little-endian object"),
+		   input_file->filename().c_str());
 #endif
     }

                 reply	other threads:[~2008-10-02 18:36 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=c17be2b30810021135x316df75cv5c4537ef7c0c3cc8@mail.gmail.com \
    --to=ccoutant@google.com \
    --cc=binutils@sourceware.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).