<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Refine the grouping of the linker-related flags"
href="http://llvm.org/bugs/show_bug.cgi?id=19526">19526</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Refine the grouping of the linker-related flags
</td>
</tr>
<tr>
<th>Product</th>
<td>Build scripts
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>cmake
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>emanuelecestari@yahoo.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>When building with llvm, clang, clang-tools-extra, compiler-rt, libcxx and lldb
I noticed that the linking phase is weird, it doesn't take into account the
linker-related cache entries that I'm giving to cmake, basically anything in
the form CMAKE_*_LINKER_FLAGS, and it doesn't even use the specific cache
entries ( specific to the library ) to form the correct set of flags that you
have to pass to ld or gcc, even when cmake gets something like
LIBXML2_LIBRARIES set to the correct value, it doesn't make any good use of it.
Another example concerns passing the correct values for the -L and -l flags to
the aformentioned CMAKE_*_LINKER_FLAGS cache entries because this serves no
purpose and the building fails to find the library to link to the final
executable. Why not simplifying everything and just set 1 cache entry for the
<root> dir of the library that needs to be found ? You can easily find the
headers under <root>/include or the libs under <root>/lib .
To be fair this isn't always the case, for example with libxml2 the headers are
under <root>/include/libxml2 and not <root>/include, but my idea is that you
shouldn't set so many variables for just 1 library, it's redundant and leads to
confusion most of the time, and I invite you to try for yourself.
A minor fix will also be to force the use of some "gcc signed" cache entries
since I don't know how many still link with ld under linux when linking with
gcc it's probably a more modern approach, so something like "GCC_LINKER_FLAGS"
will probably fit better, but I think that the linking phase as it is now it's
not predictable and consistent in its own behaviour as it should be . And in
the end it doesn't even work.
-----
this is about the r206684 from the svn trunk, I also posted my configuration
and softwares used in a dedicated discussion on llvm-dev here
<a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-April/072312.html">http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-April/072312.html</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>