[PATCH] Allow overriding -split-dwarf-file

David Blaikie dblaikie at gmail.com
Fri Apr 4 08:35:32 PDT 2014


Oops, re-add cfe-commits.

On Fri, Apr 4, 2014 at 8:34 AM, David Blaikie <dblaikie at gmail.com> wrote:
> On Fri, Apr 4, 2014 at 8:24 AM, Lubos Lunak <l.lunak at centrum.cz> wrote:
>> On Friday 04 of April 2014, Eric Christopher wrote:
>>> ... Why would you want to do this?
>>
>>  The compile itself happens in a chroot and the expected and actual output
>> locations differ (and don't even exist in the other tree).
>
> In your scenario the .dwo is not side-by-side with the .o? Or are you
> overriding the .o name as well in some way?
>
>> I could do with
>> changing DW_AT_GNU_dwo_name explicitly after the build, but that seems
>> needlessly complex given that this seems to be exactly what the option does.
>> I don't see why I would be allowed to override any option except for this
>> one.
>
> -Xclang and the underlying driver arguments aren't really a
> stable/guaranteed interface. I'd be more inclined to accept this
> change if it were just for some debugging, but since it sounds like
> you want to rely on it, it's good for us to understand the goal and
> perhaps suggest or provide the best way of achieving it long-term.
>
>>
>>> -eric
>>>
>>> On Apr 4, 2014 12:26 AM, "Lubos Lunak" <l.lunak at centrum.cz> wrote:
>>> >  The option -split-dwarf-file is passed by the driver to the compiler
>>> > after processing -Xclang options, thus overriding any possible explicitly
>>> > specified
>>> > option:
>>> >
>>> > $ clang++ -c -gsplit-dwarf a.cpp -o a.o -Xclang -split-dwarf-file -Xclang
>>> > b.dwo
>>> > $ readelf -wi a.o | grep dwo_name
>>> >     <c>   DW_AT_GNU_dwo_name: (indirect string, offset: 0x0): a.dwo
>>> >
>>> >  This is because the driver invokes the compiler as
>>> > /usr/bin/clang-3.4 -cc1 ... -split-dwarf-file b.dwo -o a.o -x c++
>>> > a.cpp -split-dwarf-file a.dwo
>>> >
>>> >  The attached patch fixes this. Ok to push?
>>
>> --
>>  Lubos Lunak
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list