-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link failures (pthreads) on OpenBSD #78
Comments
I should have mentioned that the problem appeared between test runs on May 26 (with no problem) and May 31 (all tests failed to link). I didn't have any OpenBSD+clang-upc tests between those two dates. |
It seems that -lpthread is missing on the linker line. I am not sure why linux does not require it. I also noticed the following linker warning on openbsd:
|
Nenad, OpenBSD says to use "-pthread" in CFLAGS and LDFLAGS, and so do FreeBSD and NetBSD. OpenBSD in particular does NOT recommend "-lpthreads" because their system has gone through multiple (at least 2, IIRC) distinct implementations of POSIX threads and libpthread.{a,so} might not be the right one. The linker warnings are a "feature" on security-centric OpenBSD. The harness normally filters these away. They only show in the nightly test output because in the event an error or non-filtered warning appears we emit the unfiltered stdout and stderr. The warnings are generated once per symbol which means if you fix the warnings above you will just change the warning to reference the next instance of each of those functions. Starting down that path is a looong journey, complicated by the fact that the recommended "strlcpy()" family of replacements for "strncpy()" and related functions are not present on most platforms. -Paul |
-pthread on the command line should be ok. But ultimately this will end On 6/8/15 2:17 PM, Paul H. Hargrove wrote:
|
Nenad asks:
That is correct today. -Paul |
This commit corrects the reported alignment for the struct PTS on a target with 32-bit pointers. It should be the same as a 32-bit integer, not a 64-bit one as was the case previously. This did not show on x86_64, where the ILP32 ABI (x86) requires only 4-byte alignment for both 32- and 64-bit integers. However on PPC64 both the LP64 and ILP32 ABIs specify 8-byte alignment of 8-byte integers, leading to a mismatch between clang-upc and the C code in UPCR.
Just for completeness, here is the relevant goop from
However, on NetBSD the preprocessor defines So, I feel that the right behavior would be for the driver to assert the "-pthread" option for (at least) preprocess and link stages when the language is UPC, rather than assuming |
This commit corrects the reported alignment for the struct PTS on a target with 32-bit pointers. It should be the same as a 32-bit integer, not a 64-bit one as was the case previously. This did not show on x86_64, where the ILP32 ABI (x86) requires only 4-byte alignment for both 32- and 64-bit integers. However on PPC64 both the LP64 and ILP32 ABIs specify 8-byte alignment of 8-byte integers, leading to a mismatch between clang-upc and the C code in UPCR.
This commit corrects the reported alignment for the struct PTS on a target with 32-bit pointers. It should be the same as a 32-bit integer, not a 64-bit one as was the case previously. This did not show on x86_64, where the ILP32 ABI (x86) requires only 4-byte alignment for both 32- and 64-bit integers. However on PPC64 both the LP64 and ILP32 ABIs specify 8-byte alignment of 8-byte integers, leading to a mismatch between clang-upc and the C code in UPCR.
Fixed by cbec6de |
All clang-upc compilations on OpenBSD are now failing with:
This clang-upc build was configured via autoconf, in case that matters.
-Paul
The text was updated successfully, but these errors were encountered: