[LLVMdev] dyld: lazy symbol binding failed: fast lazy bind offset out of range

Jack Howarth howarth at bromo.med.uc.edu
Tue Oct 23 07:16:49 PDT 2012


On Tue, Oct 23, 2012 at 03:58:09PM +0200, Duncan Sands wrote:
> Hi Jack,
>
>> It is interesting though that LLVMPolly.so shows the linkage...
>>
>> /sw/opt/llvm-3.2/lib/LLVMPolly.so:
>> 	/sw/lib/libisl.10.dylib (compatibility version 11.0.0, current version 11.0.0)
>> 	/sw/lib/gmp5/libgmp.10.dylib (compatibility version 11.0.0, current version 11.5.0)
>> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
>> 	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
> ...
>> However I have managed to shift the error with the following linkage...
>>
>> LLVMPolly.so:
>> 	/sw/lib/libcloog-isl.3.dylib (compatibility version 4.0.0, current version 4.0.0)
>> 	/sw/lib/libisl.10.dylib (compatibility version 11.0.0, current version 11.0.0)
>> 	/sw/lib/gmp5/libgmpxx.4.dylib (compatibility version 7.0.0, current version 7.5.0)
>> 	/sw/lib/gmp5/libgmp.10.dylib (compatibility version 11.0.0, current version 11.5.0)
>> 	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
>> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
>
> why in this second case do you see libcloog (not present in the first) and two
> copies of libgmp?

My mistake, I grabbed the wrong lines. The stock build of LLVMPolly shows...

LLVMPolly.so:
	/sw/lib/libisl.10.dylib (compatibility version 11.0.0, current version 11.0.0)
	/sw/lib/gmp5/libgmp.10.dylib (compatibility version 11.0.0, current version 11.5.0)
	/sw/lib/libcloog-isl.3.dylib (compatibility version 4.0.0, current version 4.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)

which is different from what FSF gcc uses. Shouldn't the libraries be ordered so that if library A
is linked against library B that libA should appear before libB? Since on darwin, we have...

/sw/lib/libisl.10.dylib:
	/sw/lib/libisl.10.dylib (compatibility version 11.0.0, current version 11.0.0)
	/sw/lib/gmp5/libgmp.10.dylib (compatibility version 11.0.0, current version 11.5.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

/sw/lib/libcloog-isl.3.dylib:
	/sw/lib/libcloog-isl.3.dylib (compatibility version 4.0.0, current version 4.0.0)
	/sw/lib/libisl.10.dylib (compatibility version 11.0.0, current version 11.0.0)
	/sw/lib/gmp5/libgmp.10.dylib (compatibility version 11.0.0, current version 11.5.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

/sw/lib/gmp5/libgmp.10.dylib:
	/sw/lib/gmp5/libgmp.10.dylib (compatibility version 11.0.0, current version 11.5.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

I would expect the linkage to be "-lcloog-isl -lisl -lgmp' rather than the current
'-lisl -lcloog-isl -lgmp', no?
      As to the linkage of /sw/lib/gmp5/libgmpxx.4.dylib, that was a pure guess. Since we are
using a c++ compiler to compile LLVMPolly, I thought that we might needs some calls from the libgmpxx
library linked it. It is very curious that this linkage shift the error to...

dyld: lazy symbol binding failed: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 5 which is too large (4)

dyld: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 5 which is too large (4)

gcc-fsf-4.7: internal compiler error: Trace/BPT trap: 5 (progra[prrg4:~] howarth% himenoBMTxpa.c: In function 'main':

I can't find much on that error via google. In any case, if the library contains only unused symbols and 
didn't require additional linkages...

/sw/lib/gmp5/libgmpxx.4.dylib:
	/sw/lib/gmp5/libgmpxx.4.dylib (compatibility version 7.0.0, current version 7.5.0)
	/sw/lib/gmp5/libgmp.10.dylib (compatibility version 11.0.0, current version 11.5.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

I would have though it should have no effect on the bug. I find this interesting as the addition of
/sw/lib/gmp5/libgmpxx.4.dylib to the linkage was the first to shift the error way from
"lazy symbol binding failed: fast lazy bind offset out of range" to something else.
Note that just correcting the linkage order of libisl/libcloog-isl/libgmp doesn't have
any effect on the "lazy symbol binding failed: fast lazy bind offset out of range" dyld error.
                     Jack 

>
> Ciao, Duncan.



More information about the llvm-dev mailing list