This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Fix build of plugin-disabled ld
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: binutils at sourceware dot org
- Date: Wed, 23 Mar 2011 17:12:10 +0000 (UTC)
- Subject: Fix build of plugin-disabled ld
For a while, ld has been failing to build when plugins are disabled (such
as because of the configure bug for MinGW hosts fixed by
<http://sourceware.org/ml/binutils/2011-03/msg00418.html>) because
lexsup.c has a reference to report_plugin_symbols that isn't conditional
on plugins being enabled. This patch conditions the reference (while
still keeping the immediately previous error check in all cases, so
marking with ATTRIBUTE_UNUSED a variable that is initialized but not used
when plugins are disabled). OK to commit?
2011-03-23 Joseph Myers <joseph@codesourcery.com>
* lexsup.c (parse_args): Only set report_plugin_symbols if plugins
are enabled. Mark level as possibly unused.
Index: lexsup.c
===================================================================
RCS file: /cvs/src/src/ld/lexsup.c,v
retrieving revision 1.124
diff -u -r1.124 lexsup.c
--- lexsup.c 4 Mar 2011 23:44:01 -0000 1.124
+++ lexsup.c 23 Mar 2011 16:59:59 -0000
@@ -1330,10 +1330,12 @@
if (optarg != NULL)
{
char *end;
- int level = strtoul (optarg, &end, 0);
+ int level ATTRIBUTE_UNUSED = strtoul (optarg, &end, 0);
if (*end)
einfo (_("%P%F: invalid number `%s'\n"), optarg);
+#ifdef ENABLE_PLUGINS
report_plugin_symbols = level > 1;
+#endif /* ENABLE_PLUGINS */
}
break;
case 'v':
--
Joseph S. Myers
joseph@codesourcery.com