aboutsummaryrefslogtreecommitdiff
path: root/gold/options.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-03-06 00:53:37 +0000
committerIan Lance Taylor <iant@google.com>2008-03-06 00:53:37 +0000
commit09ffbbe0d44895d6e6681430cf7a893840a9281b (patch)
treefe1f57e39faf985b527ad62aa5612c6e6651a73a /gold/options.cc
parent7dfac99ff1ebec56f81c60747e2ac9b0f86fa588 (diff)
downloadgdb-09ffbbe0d44895d6e6681430cf7a893840a9281b.zip
gdb-09ffbbe0d44895d6e6681430cf7a893840a9281b.tar.gz
gdb-09ffbbe0d44895d6e6681430cf7a893840a9281b.tar.bz2
From Craig Silverstein: accept any string for input format, warn if
thread options when not supported.
Diffstat (limited to 'gold/options.cc')
-rw-r--r--gold/options.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/gold/options.cc b/gold/options.cc
index 5307d86..80a723e 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -341,7 +341,7 @@ string_to_object_format(const char* arg)
return gold::General_options::OBJECT_FORMAT_BINARY;
else
{
- gold::gold_error(_("format '%s' not supported "
+ gold::gold_error(_("format '%s' not supported; treating as elf "
"(supported formats: elf, binary)"),
arg);
return gold::General_options::OBJECT_FORMAT_ELF;
@@ -628,6 +628,22 @@ General_options::finalize()
if (this->thread_count() > 0 && this->thread_count_final() == 0)
this->set_thread_count_final(this->thread_count());
+ // Let's warn if you set the thread-count but we're going to ignore it.
+#ifndef ENABLE_THREADS
+ if (this->threads())
+ {
+ gold_warning(_("ignoring --threads: "
+ "%s was compiled without thread support"),
+ program_name);
+ this->set_threads(false);
+ }
+ if (this->thread_count() > 0 || this->thread_count_initial() > 0
+ || this->thread_count_middle() > 0 || this->thread_count_final() > 0)
+ gold_warning(_("ignoring --thread-count: "
+ "%s was compiled without thread support"),
+ program_name);
+#endif
+
// Even if they don't specify it, we add -L /lib and -L /usr/lib.
// FIXME: We should only do this when configured in native mode.
this->add_to_library_path_with_sysroot("/lib");