tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: .debug objects build rule need some care



On Tue, Jul 20, 2010 at 03:14:00PM +0100, Julio M. Merino Vidal wrote:
> On Tue, Jul 20, 2010 at 2:54 PM, Nicolas Joly <njoly%pasteur.fr@localhost> 
> wrote:
> >
> >        On Tue, Jul 20, 2010 at 02:45:49PM +0100, Julio M. Merino Vidal 
> > wrote:
> >> On Tue, Jul 20, 2010 at 2:37 PM, Nicolas Joly <njoly%pasteur.fr@localhost> 
> >> wrote:
> >> >
> >> > Ack, but i now rembember why i did it that way ...
> >> >
> >> > With the following construct, it won't work as the .gnu_debuglink
> >> > section will record the file name to be opened for loading the debug
> >> > symbols ... x.debug.tmp instead of installed x.debug file.
> >> >
> >> > ${_PROGDEBUG.${_P}}: ${_P}
> >> >        ${_MKTARGET_CREATE}
> >> >        ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}}.tmp
> >> >        ${OBJCOPY} --strip-debug \
> >> >            -R .gnu_debuglink
> >> >        --add-gnu-debuglink=${_PROGDEBUG.${_P}}.tmp ${_P}
> >> >        mv ${_PROGDEBUG.${_P}}.tmp ${_PROGDEBUG.${_P}}
> >>
> >> I haven't tried but looking at this code: it looks like that passing
> >> the non-tmp name to --add-gnu-debuglink and keeping .tmp everywhere
> >> else may DTRT.
> >
> > Unfortunately no ... i already tried it, and it needs the real
> > file. Grrr ...
> >
> > #    create  df/df.debug
> > /local/src/NetBSD/tool/bin/x86_64--netbsd-objcopy --only-keep-debug df 
> > df.debug.tmp
> > /local/src/NetBSD/tool/bin/x86_64--netbsd-objcopy --strip-debug  -R 
> > .gnu_debuglink --add-gnu-debuglink=df.debug df
> > /local/src/NetBSD/tool/bin/x86_64--netbsd-objcopy:st24479a: cannot fill 
> > debug link section `df.debug': No such file or directory
> 
> Interesting.  So it only keeps the basename?  In that case, we could
> generate the files in a 'tmp' subdirectory and then move them back
> into the parent directory.  Not sure if it's worth the effort though.

Yep. In then mean time, i can amend my original patch to avoid the
hackish touch command; and use the `--preserve-dates' option to the
second objcopy call.

.if defined(_PROGDEBUG.${_P})
${_PROGDEBUG.${_P}}: ${_P}
        ${_MKTARGET_CREATE}
        ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}}
        ${OBJCOPY} --preserve-dates --strip-debug \
            -R .gnu_debuglink --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P}
.endif

But this only solve the timestamp ordering issue.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


Home | Main Index | Thread Index | Old Index