NICTA / cplusplus-th

C++ Foreign Import Generation
http://hackage.haskell.org/package/cplusplus-th
BSD 3-Clause "New" or "Revised" License
34 stars 0 forks source link

Does not build on Trisquel 6 with clang++ 3.0-6ubuntu3 (LLVM 3.0) #1

Closed singpolyma closed 10 years ago

singpolyma commented 10 years ago
src/Foreign/CPlusPlusStdLib.hs:1:1:
    Exception when trying to run compile-time code:
     symbol "haskell::fromCString(char const*, int)" missing from object file
      Code: cplusplus
              "haskell::fromCString(char const*, int)"
              "cbits/hsstring.o"
              [t| CString -> Int -> IO Std__basic_string |]
singpolyma commented 10 years ago

It seems the likely culprit is the output of my nm is different

mxswd commented 10 years ago

@singpolyma thanks for finding this problem! Do you mind posting the output of nm hsstring.o and nm hsstring.o | c++filt? I will have a look at what's wrong.

singpolyma commented 10 years ago

nm:

00000000 r GCC_except_table1
0000002c r GCC_except_table4
000001c0 t _GLOBAL__I_a
         U _Unwind_Resume
00000130 T _ZN7haskell10cstringLenERKSs
00000040 T _ZN7haskell11fromCStringEPKci
00000150 T _ZN7haskell12deleteStringEPKSs
00000110 T _ZN7haskell9toCStringERKSs
         U _ZNKSs5c_strEv
         U _ZNKSs6lengthEv
         U _ZNSaIcEC1Ev
         U _ZNSaIcED1Ev
         U _ZNSsC1EPKcjRKSaIcE
         U _ZNSsD1Ev
         U _ZNSt8ios_base4InitC1Ev
         U _ZNSt8ios_base4InitD1Ev
00000000 b _ZStL8__ioinit
         U _ZdlPv
         U _Znwj
         U __cxa_atexit
00000000 t __cxx_global_var_init
         U __dso_handle
         U __gxx_personality_v0

nm | c++filt:

00000000 r GCC_except_table1
0000002c r GCC_except_table4
000001c0 t global constructors keyed to a
         U _Unwind_Resume
00000130 T haskell::cstringLen(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
00000040 T haskell::fromCString(char const*, int)
00000150 T haskell::deleteString(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const*)
00000110 T haskell::toCString(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
         U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const
         U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::length() const
         U std::allocator<char>::allocator()
         U std::allocator<char>::~allocator()
         U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, unsigned int, std::allocator<char> c
onst&)
         U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
         U std::ios_base::Init::Init()
         U std::ios_base::Init::~Init()
00000000 b std::__ioinit
         U operator delete(void*)
         U operator new(unsigned int)
         U __cxa_atexit
00000000 t __cxx_global_var_init
         U __dso_handle
         U __gxx_personality_v0
mxswd commented 10 years ago

@singpolyma thanks! Fixed, I didn't think about 32-bit.