| Summary: | Inline assembly is not supported in llvm virtual machine | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Panos Christopoulos Charitos <godlike> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED WONTFIX | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | clubjuggler |
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
Panos Christopoulos Charitos
2011-07-06 05:00:31 UTC
In what way are you using LLVM? Is this through clang? We should probably just add some #ifdefs there to use the C fallbacks. --ryan. I use clang++ to create LLVM bytecode "object files" instead of ELF object files. The only extra flag I add (compared to the gcc build) is the -emit-llvm. Then I link them using llvm-ld. The linker works just like ld without extra flags or anything and produces an LLVM bytecode executable (and a shell script to run it). I run it using the the LLVM virtual machine (a.k.a. lli) but it fails when it finds inline asm code. Note: The above description presents the creation and run of LLVM bytecode executables and not native ones. In native executables LLVM and clang work like a charm. Thanks. (In reply to comment #1) > In what way are you using LLVM? Is this through clang? We should probably just > add some #ifdefs there to use the C fallbacks. > > --ryan. Note this is now affecting compilation on OS X Lion since XCode 4.2 only ships with an LLVM compiler and not a GCC compiler. See the discussions here: https://github.com/mxcl/homebrew/pull/7798 https://github.com/mxcl/homebrew/pull/8475 As far as I know we can't actually tell that we're going to be compiled to llvm bytecode. Even if we fixed the SDL headers to avoid inline assembly, there's still inline assembly in SDL_cpuinfo.c that chokes lli (I checked) I'll welcome a patch, but as far as I'm concerned this is a bug in llvm. Actually, it IS a bug in llvm. :) http://llvm.org/bugs/show_bug.cgi?id=1343 FYI, this doesn't affect Mac OS X Lion because their llvm compiler is compiling to native code, not being interpreted by the JIT compiler. |