etaoins / llambda

Scheme R7RS frontend for LLVM
Other
68 stars 6 forks source link

Cannot run test program with current master #61

Closed BartMassey closed 6 years ago

BartMassey commented 6 years ago

Here's the diagnostic.

$ sbt
[info] Loading project definition from /usr/local/src/llambda/project
[info] Set current project to llambda (in build file:/usr/local/src/llambda/)
> project compiler
[info] Set current project to compiler (in build file:/usr/local/src/llambda/)
> run /home/bart/test.scm
[info] Running io.llambda.compiler.CompilerApp /home/bart/test.scm
opt: <stdin>:201:95: error: expected value token
@_llambda_compiler_class_map = unnamed_addr constant [1 x i32*] [i32* getelementptr ([2 x i32], [2 x i32]* @"empty-closureMap1", i32 0, i32 0)]
                                                                                              ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[error] (run-main-0) io.llambda.compiler.ExternalCompilerException
io.llambda.compiler.ExternalCompilerException
    at io.llambda.compiler.Compiler$.compilePlanToFile(Compiler.scala:110)
    at io.llambda.compiler.Compiler$.abstractCompile(Compiler.scala:123)
    at io.llambda.compiler.Compiler$.compileFile(Compiler.scala:232)
    at io.llambda.compiler.CompilerApp$.$anonfun$new$11(CompilerApp.scala:132)
    at io.llambda.compiler.CompilerApp$.$anonfun$new$11$adapted(CompilerApp.scala:73)
    at scala.Option.map(Option.scala:146)
    at io.llambda.compiler.CompilerApp$.delayedEndpoint$io$llambda$compiler$CompilerApp$1(CompilerApp.scala:73)
    at io.llambda.compiler.CompilerApp$delayedInit$body.apply(CompilerApp.scala:6)
    at scala.Function0.apply$mcV$sp(Function0.scala:34)
    at scala.Function0.apply$mcV$sp$(Function0.scala:34)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App.$anonfun$main$1$adapted(App.scala:76)
    at scala.collection.immutable.List.foreach(List.scala:389)
    at scala.App.main(App.scala:76)
    at scala.App.main$(App.scala:74)
    at io.llambda.compiler.CompilerApp$.main(CompilerApp.scala:6)
    at io.llambda.compiler.CompilerApp.main(CompilerApp.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
[trace] Stack trace suppressed: run last compiler/compile:run for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
    at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compiler/compile:run for the full output.
[error] (compiler/compile:run) Nonzero exit code: 1
[error] Total time: 2 s, completed Jan 1, 2018 5:37:43 PM

test.scm was taken from the documentation.

(import (llambda base))
(import (llambda write))

(write "Hello, world!")
(newline)
etaoins commented 6 years ago

Which LLVM version are you using? The textual IR format isn't exactly compatible between releases. I'll try to reproduce against your LLVM version.

BartMassey commented 6 years ago

llvm-3.6, because that's what the README said to use. I can try a different version if you think it would help. It also looks like I compiled llambda with clang-4.0. I'll try to rebuild and get all the versions as right as I can figure out how and let you know how it goes.

BartMassey commented 6 years ago

Nope. Same issue with clang-3.6 and a clean build.

BartMassey commented 6 years ago

Works great with LLVM 4.0! Thanks much for the help getting it set up. Looking forward to trying it out.

etaoins commented 6 years ago

No worries. Sorry that the project was a bit stale. Let me know if you have any questions/feedback.