<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 --- - /dev/null is not accepted as output"
href="https://llvm.org/bugs/show_bug.cgi?id=31408">31408</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>/dev/null is not accepted as output
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dima@golovin.in
</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 detecting compiler features it is common to use '-o /dev/null' option. It
fails with LLD.
Typical test would look like this:
$ echo 'typedef int x;' | clang -x c - -nostdlib -shared -o /dev/null
ld.lld: error: rename failed: Permission denied
So LLD is trying to rename /dev/null. What it is actually trying to do is the
following:
access("/dev/nulltmp4e940395", F_OK) = -1 ENOENT (No such file or
directory)
rename("/dev/null", "/dev/nulltmp4e940395") = -1 EACCES (Permission denied)
I don't know what is the right behavior to implement if /dev/null is an output,
but I think that is not it.
This should also affect NUL on Windows.</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>