Lane Schwartz
2008-Apr-15 13:45 UTC
[LLVMdev] Bugs in Kaleidoscope tutorial code, and a bus error
I'm working through the Kaleidoscope tutorial through section 2.4, and I've encountered some problems: several minor bugs, and finally a bus error that has me stumped: ------- In the code listed in LLVM Tutorial section 2.2 Implementing a Parser and AST. Line 19 has a comma at the end of line that shouldn't be there Line 120 is missing a closing angle bracket. Line 120 should be std::vector<std::string> Args; Line 319 should be PrototypeAST *Proto = new PrototypeAST("", std::vector<std::string>()); ------- Likewise, in the code for LLVM Tutorial section 2.3 Code Generation to LLVM IR, Line 27 has a comma at the end of line that shouldn't be there ------- Likewise, in the code for LLVM Tutorial section 2.4 Adding JIT and Optimizer Support, Line 29 has a comma at the end of line that shouldn't be there I get several link errors when compiling the code for section 2.4. These errors go away if I make the following change to the relevant Makefile (tools/sample/Makefile): old: LINK_COMPONENTS = core new LINK_COMPONENTS = core scalaropts ExecutionEngine ------- After successfully compiling the code in section 2.4 Adding JIT and Optimizer Support, I attempted to run that code: $ ./Release/bin/Sample ready> 4 + 5; Bus error I was able to successfully run the program using the code in section 2.2, and also the code in section 2.3 of the tutorial. I successfully worked my way through the other problems listed above, but this one has me stumped. I'd really like to see the JIT in action. Any thoughts or advice on how to proceed, or what might be causing this error? I'm running on Mac OS X 10.5 on 32 bit PPC. I compiled LLVM 2.2, but did not compile the gcc frontends. Thanks, Lane
Lane Schwartz
2008-Apr-15 14:59 UTC
[LLVMdev] Bugs in Kaleidoscope tutorial code, and a bus error
On Tue, Apr 15, 2008 at 8:45 AM, Lane Schwartz <dowobeha at gmail.com> wrote:> I get several link errors when compiling the code for section 2.4. > These errors go away if I make the following change to the relevant > Makefile (tools/sample/Makefile): > > old: LINK_COMPONENTS = core > new LINK_COMPONENTS = core scalaropts ExecutionEngine > > ------- > > After successfully compiling the code in section 2.4 Adding JIT and > Optimizer Support, I attempted to run that code: > > $ ./Release/bin/Sample > ready> 4 + 5; > Bus errorTo get rid of the bus error, I made the change: LINK_COMPONENTS = core scalaropts engine Thanks, Lane
Chris Lattner
2008-Apr-15 18:10 UTC
[LLVMdev] Bugs in Kaleidoscope tutorial code, and a bus error
On Tue, 15 Apr 2008, Lane Schwartz wrote:> I'm working through the Kaleidoscope tutorial through section 2.4, and > I've encountered some problems: several minor bugs, and finally a bus > error that has me stumped:Hi Lane, Please make the suggested changes to your local tree and send me a patch for the tutorial, thanks! -Chris> ------- > In the code listed in LLVM Tutorial section 2.2 Implementing a Parser and AST. > > Line 19 has a comma at the end of line that shouldn't be there > > Line 120 is missing a closing angle bracket. > Line 120 should be std::vector<std::string> Args; > > Line 319 should be PrototypeAST *Proto = new PrototypeAST("", > std::vector<std::string>()); > > ------- > > Likewise, in the code for LLVM Tutorial section 2.3 Code Generation to LLVM IR, > > Line 27 has a comma at the end of line that shouldn't be there > > ------- > > Likewise, in the code for LLVM Tutorial section 2.4 Adding JIT and > Optimizer Support, > > Line 29 has a comma at the end of line that shouldn't be there > > I get several link errors when compiling the code for section 2.4. > These errors go away if I make the following change to the relevant > Makefile (tools/sample/Makefile): > > old: LINK_COMPONENTS = core > new LINK_COMPONENTS = core scalaropts ExecutionEngine > > ------- > > After successfully compiling the code in section 2.4 Adding JIT and > Optimizer Support, I attempted to run that code: > > $ ./Release/bin/Sample > ready> 4 + 5; > Bus error > > > I was able to successfully run the program using the code in section > 2.2, and also the code in section 2.3 of the tutorial. > > I successfully worked my way through the other problems listed above, > but this one has me stumped. I'd really like to see the JIT in action. > Any thoughts or advice on how to proceed, or what might be causing > this error? I'm running on Mac OS X 10.5 on 32 bit PPC. I compiled > LLVM 2.2, but did not compile the gcc frontends. > > Thanks, > Lane > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-Chris -- http://nondot.org/sabre/ http://llvm.org/
Maybe Matching Threads
- [LLVMdev] Linking to LLVM libs from new project
- [LLVMdev] Error when building tutorial example
- [LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
- [LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
- [LLVMdev] Getting Kaleidoscope to compile