Chris, et al., I'm having a bit of difficulty using LLVM to compile system programs (e.g. rsh) on FreeBSD 5.x. Basically 'lli' is bombing out with "ERROR: Program used external function 'blah' which could not be resolved!" I was hoping that you could please point me to a sample Makefile that might both use external (i.e. system) libraries as well as the LLVM libraries & programs. At this point, LLVM makefiles seem clear, as do the makefiles that the system programs use, but merging them is proving complicated. Thanks.
On Mon, 7 Nov 2005, Sean Peisert wrote:> I'm having a bit of difficulty using LLVM to compile system programs > (e.g. rsh) on FreeBSD 5.x. Basically 'lli' is bombing out with > "ERROR: Program used external function 'blah' which could not be > resolved!" I was hoping that you could please point me to a sample > Makefile that might both use external (i.e. system) libraries as well > as the LLVM libraries & programs. At this point, LLVM makefiles seem > clear, as do the makefiles that the system programs use, but merging > them is proving complicated. Thanks.There are three basic options here: 1. Build all your code with LLVM. 2. Build the non-llvm parts into a dynamic library, and use "lli -load x.so <other options>" to load it. 3. Link the non-llvm parts into LLI. The best one depends on what you're trying to do. If you're interested in the LLVM makefiles, there is a good doc in http://llvm.org/docs/ on the makefiles. -Chris -- http://nondot.org/sabre/ http://llvm.org/
Thanks, Chris.> > I'm having a bit of difficulty using LLVM to compile system programs > > (e.g. rsh) on FreeBSD 5.x.> There are three basic options here: > > 1. Build all your code with LLVM. > 2. Build the non-llvm parts into a dynamic library, and use "lli -load > x.so <other options>" to load it. > 3. Link the non-llvm parts into LLI.Option #2 turned out to be the easiest option for a single program, however if I were interested in recompiling _all_ of the system programs, I suspect that it would not be. However I assume, option #3 would require linking LLI with _all_ of the system's libraries, which seems nutty, and option #1 is likely to fail for at least some system libraries due to inline assembly. Do my assumptions seem correct? Has an OS (or at least the sytem applications on it) ever been compiled with LLVM? Thanks, Sean