Hi Armin,
The test `rpython.rtyper.lltypesystem.test.TestPlatform.test_prefix` illustrates the problem quite well. Currently this test is skipped on non-linux platforms. When that is turned off,
the test fails on macOS X.
With `Darwin_x86.so_prefix == (‘’, )`, line ll2ctypes:1218 will fail, because it’s trying to load `c_file.dylib` rather than `libc_file.dylib`.
Shared libraries on macOS X should also have ‘lib’ prefix just as on linux.
According to man page of `ld`:
-lx This option tells the linker to search for libx.dylib or libx.a in the library search path. If string x is of the form y.o, then that file is searched for in the same places, but
without prepending `lib' or appending `.a' or `.dylib' to the filename.
The filename of a dynamic library normally contains the library’s name with the
lib prefix and the .dylib extension. For example, a library called Dynamo would have the filename
libDynamo.dylib.
So I think it’s right to make a simple fix as suggested in the patch to include ‘lib’ in the so_prefix on Darwin platforms.
The attached is a suggested solution patch.
Regards,
John Zhang