abduld / llvm-lua

Automatically exported from code.google.com/p/llvm-lua
Other
0 stars 0 forks source link

The built llvm-lua.exe on Windows is broken. #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
  1. Fresh clean build of llvm from source
  2. Fresh clean build of clang-3.1 from source
  3. Build llvm-lua from trunk using above dependencies
  4. Run the produced "llvm-lua.exe -O0"

What is the expected output? What do you see instead?

  Running "llvm-lua.exe -O0" produces the following:

    $ llvm-lua -O0
    Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
    > f = 1
    LLVM ERROR: Program used external function 'luaV_settable' which could not be re
    solved!
    Stack dump:
    0.      Running pass 'X86 Machine Code Emitter' on function '@vm_OP_SETGLOBAL'

What version of the product are you using? On what operating system?

  Built llvm-lua from latest trunk with CMake under Windows 7 64-bit using Mingw gcc 4.6.3 + MSYS, clang-3.1 as bitcode emitter.

Please provide any additional information below.

It seems like there is something wrong with how llvm-lua's build is setup. 
There are various problems when it tries to piece itself together during build. 
For example, if you try to build it with just lua-dynamic then the linking step 
fails with unresolved symbols to lua functions that should be private to lua's 
internal implementation.

The above error is coming from a llvm-lua.exe linked with lua-static. Again, we 
see here that it cannot resolve yet another internal lua function 
`luaV_settable`.

Furthermore, running the interpreter without the `-O0` switch would outright 
crash when it attempts to evaluate any lua statements:

    $ llvm-lua
    Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
    > print 'test'
    pseudo instructions should be removed before code emission
    UNREACHABLE executed at g:/OSS/llvm.src3.1/lib/Target/X86/X86CodeEmitter.cpp:736!

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.

I'm not sure why this is happening but there seems to be a common theme that 
surrounds all these errors. Namely, all those problems seem to point back to 
x86 machine code emitter in llvm.

I am unfamiliar the llvm framework so I can't really diagnose this problem 
further. If there's any other piece of info you need me to provide please let 
me know.

Original issue reported on code.google.com by gooogle....@gmail.com on 20 Sep 2013 at 8:56