hughperman / pure-lang

Automatically exported from code.google.com/p/pure-lang
0 stars 0 forks source link

Build failure on x86-64, related to LLVM (r588) #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
g++ -shared -o libpure-0.16.so  expr.o interpreter.o matcher.o printer.o
runtime.o symtable.o util.o lexer.o parser.o `llvm-config --ldflags --libs
core jit native` -lgsl -lgslcblas -lm -lreadline -lgmp 
/usr/bin/ld: /usr/local/lib/LLVMX86AsmPrinter.o: relocation R_X86_64_32
against `llvm::MachineModuleInfo::ID' can not be used when making a shared
object; recompile with -fPIC
/usr/local/lib/LLVMX86AsmPrinter.o: could not read symbols: Bad value

I remember reading something about x84-64 and -fPIC, but I can't recall
where I saw it. AFAIK both LLVM and Pure were compiled with -fPIC.

Original issue reported on code.google.com by sedill...@gmail.com on 8 Jan 2009 at 3:34

GoogleCodeExporter commented 8 years ago
What are the exact options used when configuring LLVM? You can find these at the
beginning of config.log in the LLVM source directory. Likewise for Pure.

Original comment by aggraef@gmail.com on 8 Jan 2009 at 8:12

GoogleCodeExporter commented 8 years ago
I didn't give any options when configuring LLVM. I can't find anything in 
config.log
to indicate that it was compiled with -fPIC. I can't actually verify whether it 
was
or not because the Makefiles are so considerate as to conceal what they are 
doing
from me. I tried adding -fPIC to CFLAGS, and using configure options --with-pic 
and
--enable-shared, with no luck. (Who knows, those could be for the code that LLVM
_generates_ rather than the code of LLVM itself.)

If there are some special things that I need to do to compile LLVM on x86-64 so 
that
it works with Pure (beyond './configure && make && make install') then please 
share. 

Original comment by sedill...@gmail.com on 9 Jan 2009 at 4:20

GoogleCodeExporter commented 8 years ago
As explained in the INSTALL file, you need to configure LLVM with --enable-pic 
to
make it linkable into a shared library. Here's the configure line that use:

./configure --enable-optimized --disable-assertions --disable-expensive-checks
--enable-targets=host-only --enable-pic

Does that help?

Original comment by aggraef@gmail.com on 10 Jan 2009 at 1:16

GoogleCodeExporter commented 8 years ago
Yep that was it.

Original comment by sedill...@gmail.com on 11 Jan 2009 at 1:27

GoogleCodeExporter commented 8 years ago
Ok, I'm marking this as done.

Original comment by aggraef@gmail.com on 11 Jan 2009 at 11:18

GoogleCodeExporter commented 8 years ago

Original comment by aggraef@gmail.com on 11 Jan 2009 at 11:59