Closed tschuxxi closed 7 years ago
@tschuxxi I think we might need to use -pthread
instead of -lpthread
as an argument to gcc (see https://stackoverflow.com/a/23251828 and https://groups.google.com/forum/#!topic/comp.programming.threads/NCEpG0EOCCY).
Can you try changing the makefile line 352 (https://github.com/ponylang/ponyc/blob/master/Makefile#L352) from:
llvm.libs += -lpthread -lexecinfo
to:
llvm.libs += -pthread -lexecinfo
and line 287 in genexe.c (https://github.com/ponylang/ponyc/blob/master/src/libponyc/codegen/genexe.c#L287) from:
"%s %s %s %s -lpthread %s -lm %s",
to
"%s %s %s %s -pthread %s -lm %s",
and then compiling to see if it works?
@tschuxxi if you can verify this as a fix and get it in soon (next hour or so) it can make it into the 0.16.1 release I am doing soon.
I changed the files but still get the same error message
@tschuxxi Thanks for trying and confirming that fix didn't work.
The following makefile fix should resolve the issue (I did a quick test via vagrant):
diff --git a/Makefile b/Makefile
index a20c48fa..abe47cc4 100644
--- a/Makefile
+++ b/Makefile
@@ -465,6 +465,8 @@ ifeq ($(OSTYPE),linux)
endif
ifeq ($(OSTYPE),freebsd)
+ libponyc.tests.links += libpthread
+ libponyrt.tests.links += libpthread
libponyc.benchmarks.links += libpthread
libponyrt.benchmarks.links += libpthread
endif
The issue was that when linking tests on freebsd
, we should be including libpthread
or else symbol resolution for pthread
functions doesn't work.
If would be ideal if you can confirm the fix and then we can try and get it into the release for 0.16.1 that @SeanTAllen is doing soon.
Hi,
i tried to to build ponyc like described in the readme for FreeBSD but I always get the following error message:
I'm running 11.1-RELEASE FreeBSD 11.1-RELEASE with GNU Make 4.2.1