<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - [thinLTO] Unable to compile with IFUNC symbol"
href="https://bugs.llvm.org/show_bug.cgi?id=46488">46488</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[thinLTO] Unable to compile with IFUNC symbol
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</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>och95@yandex.ru
</td>
</tr>
<tr>
<th>Reporter</th>
<td>och95@yandex.ru
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Assignee</th>
<td>och95@yandex.ru
</td>
</tr></table>
<p>
<div>
<pre>The code example:
$ cat thinlto-ifunc.c
typedef int (*func)(void);
int called(void)
{
return 1;
}
func resolver(void)
{
return called;
}
__attribute__ ((ifunc ("resolver"))) int foo(void);
int main(int argc, char *argv[])
{
foo();
}
$ clang -O3 -flto=thin thinlto-ifunc.c -o out
/usr/bin/ld: /tmp/lto-llvm-1798eb.o: in function `main':
thinlto-ifunc.c:(.text.main+0x2): undefined reference to `resolver'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And in case if ifunc call is in another C file:
$ clang -O3 -flto=thin thinlto-ifunc.c ex.c -o out
/tmp/lto-llvm-d8c1fd.o: in function `main':
ex.c:(.text.main+0x2): undefined reference to `foo'
clang: error: linker command failed with exit code 1 (use -v to see invocation)</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>