This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [committed] Don't pass -m32 to libcc1 on arm-linux


On Fri, Jan 19, 2018 at 4:34 PM, Pedro Alves <palves@redhat.com> wrote:
> On 01/19/2018 04:24 PM, Andreas Schwab wrote:
>> On Jan 19 2018, Yao Qi <qiyaoltc@gmail.com> wrote:
>>
>>> This patch fixes it by implementing gcc_target_options gdbarch method
>>> for arm-linux to override option "-m32".
>>
>> Why is that not the default?
> I think for really no good reason other than the coincidence that
> the first couple ports that implemented this hook could share the
> same set of "-m" options.

The compile project was started for x86, so it had x86 options in
default.

char *
default_gcc_target_options (struct gdbarch *gdbarch)
{
  return xstrprintf ("-m%d%s", gdbarch_ptr_bit (gdbarch),
    gdbarch_ptr_bit (gdbarch) == 64 ? " -mcmodel=large" : "");
}

which is not correct for other arches.  What is more, we have
no way to disable "compile" feature even it is not support on
some arches.  If libcc1.so can be loaded in GDB, GDB thinks
everything is OK, and use it unconditionally for "compile"
feature.

-- 
Yao (齐尧)


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