<html>
<head>
<base href="https://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 --- - Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler"
href="https://llvm.org/bugs/show_bug.cgi?id=28427">28427</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler
</td>
</tr>
<tr>
<th>Product</th>
<td>compiler-rt
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>compiler-rt
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>noloader@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>When using MacPorts GCC on OS X and enlisting the Clang Integrated Assembler
via -Wa,-q, the assembler produces a stream of warnings for each file. A simple
test case is shown below (but a real project produces thousands of them).
I found LLVM Commit r250349, Stop generating coal sections. Here's the code
responsible, but its not clear to me how to disable the warning.
+ // Issue a warning if the target is not powerpc and Section is a *coal*
section.
+ Triple TT = getParser().getContext().getObjectFileInfo()->getTargetTriple();
+ Triple::ArchType ArchTy = TT.getArch();
+
+ if (ArchTy != Triple::ppc && ArchTy != Triple::ppc64) {
+ StringRef NonCoalSection = StringSwitch<StringRef>(Section)
+ .Case("__textcoal_nt", "__text")
+ .Case("__const_coal", "__const")
+ .Case("__datacoal_nt", "__data")
+ .Default(Section);
+
+ if (!Section.equals(NonCoalSection)) {
+ StringRef SectionVal(Loc.getPointer());
+ size_t B = SectionVal.find(',') + 1, E = SectionVal.find(',', B);
+ SMLoc BLoc = SMLoc::getFromPointer(SectionVal.data() + B);
+ SMLoc ELoc = SMLoc::getFromPointer(SectionVal.data() + E);
+ getParser().Warning(Loc, "section \"" + Section + "\" is deprecated",
+ SMRange(BLoc, ELoc));
+ getParser().Note(Loc, "change section name to \"" + NonCoalSection +
+ "\"", SMRange(BLoc, ELoc));
+ }
+ }
+
**********
The test case depends upon -g2 and -O2. if I omit them, then the warnings are
not present.
$ cat test.cxx
#include <iostream>
#include <algorithm>
int main(int argc, char* argv[])
{
std::for_each(argv, argv+argc, [](char* str)
{std::cout << str << std::endl;});
return 0;
}
$ /opt/local/bin/g++-mp-6 -march=native -g2 -O2 -std=c++11 -Wa,-q test.cxx -o
test.exe
/var/folders/mk/y7lk0xrx72lcn_2q3d12jcch0000gn/T//cc1dR6yG.s:3:11: warning:
section "__textcoal_nt" is deprecated
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
^ ~~~~~~~~~~~~~
/var/folders/mk/y7lk0xrx72lcn_2q3d12jcch0000gn/T//cc1dR6yG.s:3:11: note: change
section name to "__text"
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
^ ~~~~~~~~~~~~~
**********
When the MacPorts GCC compiler encounters -Wa,-q, it uses /opt/local/bin/clang
as the assembler rather than /opt/local/bin/as. Here are the relevant versions.
$ /opt/local/bin/g++-mp-6 --version
g++-mp-6 (MacPorts gcc6 6.1.0_0) 6.1.0
Copyright (C) 2016 Free Software Foundation, Inc.
$ /opt/local/bin/clang --version
clang version 3.8.0 (branches/release_38 262722)
Target: x86_64-apple-darwin12.6.0
$ /opt/local/bin/as -version
Apple Inc version cctools-877.8, GNU assembler version 1.38</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>