0

When I try to run this command

lli -force-interpreter file.ll

I have this error

LLVM ERROR: Tried to execute an unknown external function: posix_memalign

Also, when I search for this error I found this link

How could I solve this problem?

R.Omar
  • 645
  • 1
  • 6
  • 18
  • What is the minimal file.ll that exhibits this problem? – PaulR Jul 28 '17 at 11:47
  • What do you mean by minimal file.ll? – R.Omar Jul 28 '17 at 14:44
  • @PaulR if you mean what is file.ll for? it is the IR of one of polybench kernels. – R.Omar Jul 29 '17 at 20:51
  • I found the problem. When I run llvm-dis file.bc . The posix_memalign. Could I replace it? – R.Omar Jul 30 '17 at 20:03
  • Maybe you can replace posix_memalign with aligned_alloc. The signature is different and you will not get an error code, but the non-error behaviour should be identical. Your link points to an analysis, I do not think it is directly related to the interpreter. The interpreter does not seem to provide many library function implementations by itself, but use libffi to call the standard implementaton. For an implementation similar to posix_memalign look at this answer: https://stackoverflow.com/a/6563989, but in this case you also have to replace the free call for the allocated memory. – PaulR Jul 31 '17 at 11:54

0 Answers0