#2615: ghci doesn't play nice with linker scripts
------------------------------------------+---------------------------------
  Reporter:  AlecBerryman                 |          Owner:  hgolden            
    
      Type:  bug                          |         Status:  new                
    
  Priority:  normal                       |      Milestone:  6.14.1             
    
 Component:  GHCi                         |        Version:  6.10.1             
    
Resolution:                               |       Keywords:  dlopen, dynamic 
linking
Difficulty:  Unknown                      |             Os:  Linux              
    
  Testcase:                               |   Architecture:  Unknown/Multiple   
    
   Failure:  Incorrect result at runtime  |  
------------------------------------------+---------------------------------
Changes (by guest):

 * cc: g...@henning-thielemann.de (added)

Comment:

 I want to use the llvm package in GHCi.
 To this end I converted all of the libLLVM*.a files to local libLLVM*.so.
 When I start the main function of a Haskell program using LLVM functions
 then I get the known:

 {{{
   Loading package llvm-0.6.7.0 ... can't load .so/.DLL for: pthread
 (/usr/lib/libpthread.so: invalid ELF header)
 }}}

 My libpthread.so is also a script like that shown by Christian Maeder.
 However, pthread is not mentioned in llvm wrapper source files.
 It only appears in the files generated by configuration.

 {{{
   $ grep -r pthread .
   Match in binary file ./dist/setup/setup.
   ./config.status:S["llvm_ldflags"]="-L/usr/lib/llvm  -lpthread -ldl -lm "
   ./config.status:S["LDFLAGS"]="-L/usr/lib/llvm  -lpthread -ldl -lm  "
   ./config.log:configure:3698: gcc -o conftest -g -O2 -I/usr/include
 -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
 -L/usr/lib/llvm  -lpthread -ldl -lm   conftest.c  >&5
   ./config.log:configure:4010: g++ -o conftest -g -O2 -I/usr/include
 -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
 -L/usr/lib/llvm  -lpthread -ldl -lm   conftest.c -lLLVMCore  -lLLVMSupport
 -lLLVMSystem  >&5
   ./config.log:LDFLAGS='-L/usr/lib/llvm  -lpthread -ldl -lm  '
   ./config.log:llvm_ldflags='-L/usr/lib/llvm  -lpthread -ldl -lm '
   ./llvm.buildinfo:ld-options: -L/usr/lib/llvm  -lpthread -ldl -lm
 /usr/lib/llvm/LLVMX86AsmPrinter.o /usr/lib/llvm/LLVMX86CodeGen.o
 -lLLVMSelectionDAG -lLLVMAsmPrinter /usr/lib/llvm/LLVMExecutionEngine.o
 /usr/lib/llvm/LLVMJIT.o -lLLVMCodeGen -lLLVMScalarOpts
 -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMCore
 -lLLVMSupport -lLLVMSystem -lstdc++
 }}}

 Where do I have to remove pthread?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2615#comment:16>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to