<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/136199>136199</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Missing `strlen` in libc for offloaded target nvptx64
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
KaruroChori
</td>
</tr>
</table>
<pre>
This code https://godbolt.org/z/5oqE4Es6q fails while linking as `strlen` cannot be resolved. Still it should be a basic libc function.
```cpp
#include <string.h>
#include <cstdio>
int main(int argc, const char* argv[]){
char str[256];
#pragma omp target map(tofrom:str)
{
printf("%ld\n",strlen(str));
}
return 0;
}
```
Is there any good reason why strlen is not available?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkUk2PnDAM_TXmYu0oOMDAgcPs7CJVVU_tHwhJgLSZhE3CbLe_vsow20_JEsYv9rOen4jRzE7rHupHqJ8KsaXFh_6jCFvw58UHU4xevfVfFhNReqVxSWmNwE9AA9AwezV6mw4-zEDDD6Ch9i_P1XNsXnASxkZ8XYzVaI37ZtyMIiI0LKZgtYOGoRTO-YSjxqCjt1etDvg5GWvRJIyL36zKoMBRRCPRmlHitDmZjHcHBHbK0bA95LrmX-LGSbspjcDPMQXj5sMC_Pk_TMakjN8R4xJehHFAbU5FmCXQGaV3MaFcRAA65ep1Fwqog-MjsNMNw5gC1I9UNxnitzoiAvE1iPki0F9WTCLMOpOsQG3yU_AX4KfcSd17wz5yDcalCagFIqDaKqjP7paf78pRe--j7g-649M9CzptwSHbsb3-S6VdtA8R06KDRuHecPZeYdAieoevyxvuLGgi5uOIqzBWjFYDHwrVc9XxThS6L49V1VFVllQsvay6ljSrGmpJ15yJSVX62MlKlV1DLS9MT4xqVpVHKlnL6aC1IqZFOzLF5CQVVExfhLEHa6-XbKjCxLjpvuRN2XWFFaO28eZTouyDLEj9VIQ-v38YtzlCxayJKf6ekEyyuv9kYszm-8t5xt3d5AP6abJeKK3ej-Sua_reVMUWbP-P4U1atvEg_QVoyDz3z8Ma_FctE9BwWzsCDffNrz39DAAA__-mRA1e">