Undefined references in thread lib.
cbakgly opened this issue · 2 comments
After upgrading to Freebsd 9.1 libs, libthr now needs extra APIs to work.
/Users/yeli/repos/cb-futures/sdk/usr/bin/../../usr/lib//stdlibs_abc/libthr.a: error: undefined reference to '___sys_setcontext'
/Users/yeli/repos/cb-futures/sdk/usr/bin/../../usr/lib//stdlibs_abc/libthr.a: error: undefined reference to '___sys_swapcontext'
/Users/yeli/repos/cb-futures/sdk/usr/bin/../../usr/lib//stdlibs_abc/libthr.a: error: undefined reference to '___sys_sigreturn'
/Users/yeli/repos/cb-futures/sdk/usr/bin/../../usr/lib//stdlibs_abc/libthr.a: error: undefined reference to '_getcontext'
/Users/yeli/repos/cb-futures/sdk/usr/bin/../../usr/lib//stdlibs_abc/libthr.a: error: undefined reference to '_check_suspend'
These APIs seem newly involved in thread lib in Freebsd 9.1 and yet to be implemented (mock?) in crossbridge.
Anyone who would like to give a try is appreciated!
Steps:
1 get the newest code base
2 make all (dmalloc and libsdl now will fail)
3 build the hello world sample with option -pthread
[opt] for a better investigation, download Freebsd 9.1
4 svn co http://svn.freebsd.org/base/release/9.1.0/ freebsd-9.1
Just finished building on cygwin, 32-bit (some patching is needed). The last stage of the build (submittests) fails with
/cygdrive/e/crossbridge/crossbridge/sdk/usr/bin/../../usr/lib/libthr.a: error: undefined reference to '___sys_swapcontext'
/cygdrive/e/crossbridge/crossbridge/sdk/usr/bin/../../usr/lib/libthr.a: error: undefined reference to '_check_suspend'
This appears similar, but I am too new to the crossbridge codebase to determine if it is indeed the same issue.
Should be the same issue. Because pthread in freebsd 9 depends on some new OS APIs (could be different names on different OSes), a simple workaround for linking is define those two functions in posix/libchack.cpp.
For a workable pthread, those may need to be written via AS.