<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - cairo-trace fails to compile with clang"
href="https://bugs.freedesktop.org/show_bug.cgi?id=96467#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - cairo-trace fails to compile with clang"
href="https://bugs.freedesktop.org/show_bug.cgi?id=96467">bug 96467</a>
from <span class="vcard"><a class="email" href="mailto:fsvm88@gmail.com" title="Fabio Scaccabarozzi <fsvm88@gmail.com>"> <span class="fn">Fabio Scaccabarozzi</span></a>
</span></b>
<pre>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
(<a href="https://en.wikipedia.org/wiki/Binary_File_Descriptor_library">https://en.wikipedia.org/wiki/Binary_File_Descriptor_library</a>,
<a href="https://en.wikipedia.org/wiki/Libiberty">https://en.wikipedia.org/wiki/Libiberty</a>), 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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>