see https://sourceware.org/ml/binutils/2015-10/msg00227.html
Created attachment 8743 [details] A patch This patch matches emulation "foo" with "foo_XXX".
> This patch matches emulation "foo" with "foo_XXX". I don't think that will solve the problem for the aarch64 emulations. He's asking for "aarch64-linux", and gold wants "aarch64_elf(32|64)_[bl]e_vec".
Created attachment 8744 [details] A different patch
> Created attachment 8744 [details] > A different patch How about just printing a warning instead when we ignore the -m option? diff --git a/gold/parameters.cc b/gold/parameters.cc index 15df42a..5f5dae0 100644 --- a/gold/parameters.cc +++ b/gold/parameters.cc @@ -301,11 +301,8 @@ set_parameters_target(Target* target) { const char* emulation = parameters->options().m(); Target* output = select_target_by_emulation(emulation); - if (!output) - gold_error(_("unrecognised output emulation: %s"), emulation); - else if (output != target) - gold_error(_("input file is incompatible with %s output emulation"), - emulation); + if (output != target) + gold_warning(_("ignoring requested emulation %s"), emulation); } static_parameters.set_target(target); }
(In reply to Cary Coutant from comment #4) > > Created attachment 8744 [details] > > A different patch > > How about just printing a warning instead when we ignore the -m option? > > diff --git a/gold/parameters.cc b/gold/parameters.cc > index 15df42a..5f5dae0 100644 > --- a/gold/parameters.cc > +++ b/gold/parameters.cc > @@ -301,11 +301,8 @@ set_parameters_target(Target* target) > { > const char* emulation = parameters->options().m(); > Target* output = select_target_by_emulation(emulation); > - if (!output) > - gold_error(_("unrecognised output emulation: %s"), emulation); > - else if (output != target) > - gold_error(_("input file is incompatible with %s output emulation"), > - emulation); > + if (output != target) > + gold_warning(_("ignoring requested emulation %s"), emulation); > } > static_parameters.set_target(target); > } It is wrong to ignore the unrecognised output emulation.
*** Bug 19200 has been marked as a duplicate of this bug. ***
The master branch has been updated by Cary Coutant <ccoutant@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=96f9814df23564e16909bb5ba00de4a202c63417 commit 96f9814df23564e16909bb5ba00de4a202c63417 Author: Cary Coutant <ccoutant@gmail.com> Date: Thu Nov 5 12:59:02 2015 -0800 Revert patch for PR 19119, which led to PR 19172 and 19197. Gold does not support all the emulations that Gnu ld does, and supports only one spelling per target. The -m option is used only in the rare case where there are no ELF input files, and we produce an empty output file. In those cases, users are expected to supply a -m option naming one of the supported emulations. In the many cases where a build script provides an unnecessary -m option naming an emulation that gold does not support, we will simply ignore the option, as we did before the reverted patch. gold/ PR gold/19119 PR gold/19172 PR gold/19197 Revert commit 6457197210144f50a696097c0d308d81d46d5510: 2015-10-16 H.J. Lu <hongjiu.lu@intel.com> * options.h (General_options): Remove "obsolete" from -m. * parameters.cc (set_parameters_target): Check if input target is compatible with output emulation set by "-m emulation".
I have reverted the patch that caused gold to print an error message. Now, as before, gold will ignore the -m option unless there are no ELF input files.