<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 --- - LTO default target CPU should be "pentium4" for 32-bit Linux"
href="http://llvm.org/bugs/show_bug.cgi?id=22715">22715</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LTO default target CPU should be "pentium4" for 32-bit Linux
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>t.poechtrager@gmail.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>Created <span class=""><a href="attachment.cgi?id=13954" name="attach_13954" title="lto cpu patch">attachment 13954</a> <a href="attachment.cgi?id=13954&action=edit" title="lto cpu patch">[details]</a></span>
lto cpu patch
... otherwise codegening bitcode files may fail:
For explanation: bc2obj is a tool I wrote to convert bitcode libraries into
native ones, now feeding it with Linux 32-bit LLVM libraries I came
accross the following problem:
$ bc2obj [...]libclangBasic.a
[...]
codegen'ing [...]libclangBasic.a(SourceManager.o) to
/tmp/-9b1d81/SourceManager.o
LLVM ERROR: Do not know how to split this operator's operand!
Inspecting the compilation command reveals that the default 32-bit target cpu
is
"pentium4":
$ clang++ -m32 [...] -fPIC -fvisibility-inlines-hidden [...] -fdata-sections
-O3 -DNDEBUG [...] SourceManager.cpp -flto -c -v
"/opt/compiler/llvm-3.6/bin/clang-3.6" -cc1 -triple i386-unknown-linux-gnu
-emit-llvm-bc [...] -target-cpu pentium4 [...]
Now either setting the target cpu to pentium4 or enabling sse2 gets rid of the
problem:
$ bc2obj SourceManager.o -cpu=pentium4
codegen'ing SourceManager.o to native/SourceManager.o
$ file native/SourceManager.o
native/SourceManager.o: ELF 32-bit LSB relocatable, Intel 80386, version 1
(GNU/Linux), not stripped
$ bc2obj SourceManager.o -attrs=+sse2
codegen'ing SourceManager.o to native/SourceManager.o
$ file native/SourceManager.o
native/SourceManager.o: ELF 32-bit LSB relocatable, Intel 80386, version 1
(GNU/Linux), not stripped
A possible fix is attached (but totally untested besides the pentium4 part).</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>