This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR driver/59321: -fuse-ld has no effect on -print-prog-name nor on --with-ld=


On Wed, Dec 18, 2013 at 4:13 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Mon, 2 Dec 2013, H.J. Lu wrote:
>
>> @@ -3952,6 +3955,10 @@ process_command (unsigned int decoded_options_count,
>>            free (fname);
>>         continue;
>>       }
>> +      else if (decoded_options[j].opt_index == OPT_fuse_ld_bfd)
>> +     use_ld = ".bfd";
>> +      else if (decoded_options[j].opt_index == OPT_fuse_ld_gold)
>> +     use_ld = ".gold";
>
> Is there a reason these options need handling there rather than in the
> switch statement in driver_handle_option?
>

It is because driver_handle_option isn't called for -fuse-ld=gold:

Starting program: /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B./ -print-prog-name=ld -fuse-ld=gold

Breakpoint 5, driver_handle_option (opts=0x6e5580 <global_options>,
    opts_set=0x6e6020 <global_options_set>, decoded=0x6fbab0,
    lang_mask=524288, kind=0, loc=0, handlers=0x7fffffffddc0,
    dc=0x6e6b00 <global_diagnostic_context>)
    at /export/gnu/import/git/gcc/gcc/gcc.c:3291
3291      size_t opt_index = decoded->opt_index;
$5 = {opt_index = 116, warn_message = 0x0, arg = 0x7fffffffe4f8 "./",
  orig_option_with_args_text = 0x6fa410 "-B./", canonical_option = {
    0x495bcc "-B", 0x7fffffffe4f8 "./", 0x0, 0x0},
  canonical_option_num_elements = 2, value = 1, errors = 0}
(gdb) c
Continuing.

Breakpoint 5, driver_handle_option (opts=0x6e5580 <global_options>,
    opts_set=0x6e6020 <global_options_set>, decoded=0x6fbb00,
    lang_mask=524288, kind=0, loc=0, handlers=0x7fffffffddc0,
    dc=0x6e6b00 <global_diagnostic_context>)
    at /export/gnu/import/git/gcc/gcc/gcc.c:3291
3291      size_t opt_index = decoded->opt_index;
$6 = {opt_index = 1212, warn_message = 0x0, arg = 0x7fffffffe50c "ld",
  orig_option_with_args_text = 0x6fa440 "-print-prog-name=ld",
  canonical_option = {0x6fa420 "-print-prog-name=ld", 0x0, 0x0, 0x0},
  canonical_option_num_elements = 1, value = 1, errors = 0}
(gdb) c
Continuing.
ld

Breakpoint 3, 0x0000003a91a39290 in exit () from /lib64/libc.so.6
(gdb)


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]