Skip to content

LibClang not building against ghc 7.4.1 #9

chetant opened this Issue Apr 10, 2012 · 7 comments

2 participants

chetant commented Apr 10, 2012

Multiple errors:

Ambiguous occurrence `unsafePerformIO'
It could refer to either `Foreign.GreenCard.unsafePerformIO',
                         imported from `Foreign.GreenCard' at dist/build/Clang/FFI.hs:171:1-24
                         (and originally defined in `Foreign')
                      or `System.IO.Unsafe.unsafePerformIO',
                         imported from `System.IO.Unsafe' at dist/build/Clang/FFI.hs:176:25-39
                         (and originally defined in `GHC.IO')
@chetant chetant was assigned Apr 10, 2012
chetant commented Apr 10, 2012

Fixed in trunk, will release to Hackage soon

@chetant chetant closed this Apr 10, 2012

This looks like it's still broken on Hackage (LibClang-0.1.0). Building from the source at master, I get different, scarier errors. Are there any assumptions about the version(s) of llvm/clang/ghc needed to make this work? I'm building with ghc-7.4.2 and llvm-3.2.

chetant commented Feb 10, 2013

Could you post the errors here? It would help.


At the current master (61f4a12) I get these warnings and errors from cabal build:

In file included from ./src/Clang/FFI_stub_ffi.h:7,

                 from src/Clang/FFI_stub_ffi.c:5:0: 

     warning: "__STDC_LIMIT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
src/Clang/FFI_stub_ffi.c: In function ‘prim_getCString’:

     warning: assignment discards qualifiers from pointer target type
src/Clang/FFI_stub_ffi.c: In function ‘prim_getDiagnosticCategoryName’:

     warning: ‘clang_getDiagnosticCategoryName’ is deprecated (declared at /usr/local/Cellar/llvm/3.2/include/clang-c/Index.h:862)
src/Clang/FFI_stub_ffi.c: In function ‘prim_translationUnit_CXXPrecompiledPreamble’:

     error: ‘CXTranslationUnit_CXXPrecompiledPreamble’ undeclared (first use in this function)

     error: (Each undeclared identifier is reported only once

     error: for each function it appears in.)
src/Clang/FFI_stub_ffi.c: In function ‘prim_translationUnit_NestedMacroExpansions’:

     error: ‘CXTranslationUnit_NestedMacroExpansions’ undeclared (first use in this function)
src/Clang/FFI_stub_ffi.c: In function ‘prim_translationUnit_NestedMacroInstantiations’:

     error: ‘CXTranslationUnit_NestedMacroInstantiations’ undeclared (first use in this function)

I guess I should also mention that I'm on OSX 10.7.5, in case that's a sticking point.

chetant commented Feb 12, 2013

It looks like they removed CXTranslationUnit_NestedMacroExpansions, CXTranslationUnit_NestedMacroInstantiations and CXTranslationUnit_CXXPrecompiledPreamble flags from llvm 3.2. Either that, or you have a bad setup. I've tested LibClang uptil llvm 3.0.

It'll take atleast till the weekend for me to update my setup and test this, but you could try just deleting the entries causing errors from this line here and trying to recompile.

chetant commented Feb 23, 2013

I finally got some time to update to llvm 3.2 and fixed the errors and cleaned up some tests.
I've however put this in the llvm3.2 branch, as I'm getting some string conversions being botched up and I'm currently unable to figure out why they're happening. The issue is in Test_ChildVisitor, some of the cursor names have the first four chars zeroed out.

@chetant chetant reopened this Feb 23, 2013
chetant commented Feb 23, 2013

Closing this issue, will continue this in a new issue.

@chetant chetant closed this Feb 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.