[cairo-bugs] [Bug 96467] cairo-trace fails to compile with clang

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jun 10 20:29:37 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=96467

--- Comment #2 from Fabio Scaccabarozzi <fsvm88 at gmail.com> ---
I don't know what libiberty.h contains either.
Please note that the two files are not supposed to be idempotent - bfd and
libiberty are two distinct libraries. I've read the documentation and the wikis
(https://en.wikipedia.org/wiki/Binary_File_Descriptor_library,
https://en.wikipedia.org/wiki/Libiberty), apparently they are two libraries
with two different goals in mind, which share a very important building block
for implementation (ansidecl.h - "ANSI and traditional C compatibility
macros").

It seems that lookup-symbol.c was first committed with both headers included in
cairo, and that didn't change over releases. I have no clue why clang behaves
this way when both are included and GCC happily ignores this, my guess is that
clang is somehow more strict on checking includes and doesn't like duplicate
definitions, even though they come from the very same header.

What I have tested is that without libiberty both compilers compile fine, but
without bfd both will fail. That is due to bfd functions being used in
lookup-symbol.c. Apparently no libiberty-specific symbols are included,
otherwise both compilers would fail as well.

I don't think it's a bug in the headers, as they are written for two different
things, even though they share a common include.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20160610/6cc3b97e/attachment.html>


More information about the cairo-bugs mailing list