[PATCH] Use dwarf-2 by default on OpenBSD and FreeBSD

Eric Christopher echristo at gmail.com
Thu Jun 12 22:40:56 PDT 2014


On Thu, Jun 12, 2014 at 8:23 PM, Brad Smith <brad at comstyle.com> wrote:
> On 12/06/14 10:38 PM, Eric Christopher wrote:
>>
>> On Thu, Jun 12, 2014 at 5:27 PM, Brad Smith <brad at comstyle.com> wrote:
>>>
>>> On 12/06/14 8:11 PM, Eric Christopher wrote:
>>>>
>>>>
>>>> On Thu, Jun 12, 2014 at 5:04 PM, Brad Smith <brad at comstyle.com> wrote:
>>>>>
>>>>>
>>>>> On 12/06/14 2:17 PM, Eric Christopher wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> Sad.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Yes, the real world is sad.
>>>>>
>>>>>> Why?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> The toolchain won't be changing anytime soon (that would require an
>>>>> option
>>>>> to be able to move to anyway which there isn't). The current toolchain
>>>>> only
>>>>> supports DWARF-2.
>>>>>
>>>>
>>>> Any way you can conditionalize this based on OS version that may have
>>>> a newer gdb/lldb that'll support non-dwarf2? If not, that's fine.
>>>
>>>
>>>
>>> Can you clarify what you have in mind? I'm just getting into hacking on
>>> LLVM/Clang but I was thinking maybe having a variable in
>>> include/clang/Driver/ToolChain.h and lib/Driver/ToolChains.h that
>>> specifies
>>> the
>>> default DWARF version and whatever the override is that way making
>>> it easier to adjust for particular OS versions. I haven't written
>>> anything yet it was just an idea after I sent out the initial diff.
>>>
>>>
>>
>> Was hoping that you had a, say, freebsd12 that would magically solve
>> this problem and you could conditionalize on that.
>>
>> Sounds like no though :)
>
>
> Definitely no, but that's not really the point. My point was how to
> go about "conditionalizing" the code. So that when and if the time
> comes it is easier to change what the default setting is for the
> relevant OS's. Anyway, I'll commit this and then see about coming
> up with something to conditionalize things and see how whatever I
> come up with goes over.
>

Oh, I see what you mean.

You've got a Triple as part of the target and you'll just want to
check for the OS version ala:

  unsigned getOSMajorVersion() const;

and then conditionalize on >= some minimal version.

-eric



More information about the cfe-commits mailing list