[PATCH] Allow overriding -split-dwarf-file

Lubos Lunak l.lunak at centrum.cz
Fri Apr 4 08:24:32 PDT 2014


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). 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.

> -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



More information about the cfe-commits mailing list