Symbol in .so file cannot be resolve by dlopen on Mac OSX
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pocl |
Invalid
|
Medium
|
Carlos Sánchez de La Lama |
Bug Description
While building pocl on Mac OSX, I receive the error:
dyld: lazy symbol binding failed: Symbol not found: __ZN4llvm2cl3op
Referenced from: /Users/
Expected in: flat namespace
This leads to a segfault and a core dump. The build continues, but when I "make check" afterwards, I see the same kinds of errors.
The complete error message is:
Making all in standalone
../../scripts/
dyld: lazy symbol binding failed: Symbol not found: __ZN4llvm2cl3op
Referenced from: /Users/
Expected in: flat namespace
dyld: Symbol not found: __ZN4llvm2cl3op
Referenced from: /Users/
Expected in: flat namespace
0 libLLVM-3.1.dylib 0x0000000109a2d872 _ZL15PrintStack
1 libLLVM-3.1.dylib 0x0000000109a2dd89 _ZL13SignalHandleri + 697
2 libsystem_c.dylib 0x00007fff8b042cfa _sigtramp + 26
3 libsystem_c.dylib 0x00007fff68c257a1 _sigtramp + 184467440731348
4 libsystem_c.dylib 0x00007fff68c23948 _sigtramp + 184467440731348
5 libdyld.dylib 0x00007fff909df716 dyld_stub_binder_ + 13
6 llvmopencl.so 0x000000010a7431c0 _ZN4llvm9Attrib
7 llvmopencl.so 0x000000010a6e139d llvm::cl:
8 llvmopencl.so 0x000000010a6e12c3 __cxx_global_
9 llvmopencl.so 0x000000010a6e1369 global constructors keyed to a + 9
10 llvmopencl.so 0x00007fff68c2eda6 global constructors keyed to a + 140730481039942
11 llvmopencl.so 0x00007fff68c2eaf2 global constructors keyed to a + 140730481039250
12 llvmopencl.so 0x00007fff68c2c2e4 global constructors keyed to a + 140730481028996
13 llvmopencl.so 0x00007fff68c2d0b7 global constructors keyed to a + 140730481032535
14 llvmopencl.so 0x00007fff68c221b9 global constructors keyed to a + 140730480987737
15 llvmopencl.so 0x00007fff68c28657 global constructors keyed to a + 140730481013495
16 libdyld.dylib 0x00007fff909df95b dlopen + 57
17 libLLVM-3.1.dylib 0x0000000109a194ec llvm::sys:
18 libLLVM-3.1.dylib 0x0000000109a29bdf llvm::PluginLoa
19 opt 0x000000010902910a llvm::cl:
20 libLLVM-3.1.dylib 0x0000000109a0616c _ZL28CommaSepar
21 libLLVM-3.1.dylib 0x0000000109a022df _ZL13ProvideOpt
22 libLLVM-3.1.dylib 0x0000000109a0055a llvm::cl:
23 opt 0x0000000109024d50 main + 208
24 opt 0x00000001090206e4 start + 52
Stack dump:
0. Program arguments: /opt/local/
../../scripts/
I configured with
$ env CC=clang CXX=clang++ CLANG=clang ./configure --enable-debug --prefix=
I am surprised to see a .so file -- on a Mac, these should be .dylib files instead. Could it be that the .so file is produced in a non-standard manner (e.g. not via libtool), so that some information necessary on a Mac is not present?
Changed in pocl: | |
assignee: | nobody → Carlos Sánchez de La Lama (csanchezdll) |
It seems to have correct looking (libtool) linkage flags:
AM_LDFLAGS = -module -export-dynamic `@LLVM_CONFIG@ --ldflags`
Although I do not know what the -export-dynamic does extra here.
Maybe you have static libraries of LLVM and it just doesn't link against all the LLVM libraries required. As I do not recall touching any build files for the passes, I suppose this is a new problem from later LLVM 3.1 instead of a pocl issue. Or there's a bug in the MacOS LLVM dynamic library creation and it doesn't link that symbol in for some reason. Vlado do you have this issue on Mac?