[PATCH] D27676: [ELF] - Use full object name if source file name exist when reporting errors.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 01:49:21 PST 2016


grimar added a comment.

In https://reviews.llvm.org/D27676#621936, @davide wrote:

> In https://reviews.llvm.org/D27676#621926, @grimar wrote:
>
> > In https://reviews.llvm.org/D27676#621721, @ruiu wrote:
> >
> > > I think my concern is that we are going to print out at most three filenames like this
> > >
> > >   foo.a(foo.o)(foo.c)
> > >   
> > >
> > > and that error string format looks odd. It is indistinguishable from
> > >
> > >   foo.o(foo.c)
> > >   
> > >
> > > where in this case foo.o is not an archive but an object file. I think we are using too many parentheses.
> >
> >
> > Speaking about this one "duplicate symbol" issue, as a user I would probably be happy to see something close to Sean suggestion with additional info.
> >
> > What about if we have next form here:
> >  /usr/bin/ld: error: byte_copy.c:(.text+0x0): duplicate symbol 'byte_copy'
> >  /usr/bin/ld: error: byte_copy.c:(function byte_copy): previous definition was here
> >  note: 'byte_copy' definitions were found both in usr/ports/sysutils/safecat/work/safecat-1.13/byte_copy.o and usr/ports/sysutils/safecat/work/safecat-1.13/str.a(byte_copy.o),
> >  check that you do not include objects files twice.
>
>
> I'm not entirely sure about this diagnostic, and I think the problem is different here (in the general case).
>  It's not an object file included twice. It's that there are two object files providing a non-weak definition of the same symbol and the order on which you fetch the members from the archive matters.


My wording may be inaccurate. Idea was to place details in note (like suggested by Sean) but also add some reasonable hint about possible reason of issue.


https://reviews.llvm.org/D27676





More information about the llvm-commits mailing list