From 8ab3cc1b878ac5915295e6f31ac9b592a4bde8c6 Mon Sep 17 00:00:00 2001 From: Gabor Pali Date: Sat, 27 Apr 2013 23:13:12 +0200 Subject: [PATCH 1/2] Set DYNAMIC_GHC_PROGRAMS=NO for FreeBSD because $ORIGIN is not resolved properly (see #7819) --- mk/config.mk.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mk/config.mk.in b/mk/config.mk.in index 55f57568be43..5ef1f5cbad79 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -134,6 +134,10 @@ DYNAMIC_TOO = YES ifeq "$(TargetOS_CPP)" "mingw32" # This doesn't work on Windows yet DYNAMIC_GHC_PROGRAMS = NO +else ifeq "$(TargetOS_CPP)" "freebsd" +# FreeBSD cannot do proper resolution for $ORIGIN (due to a bug in +# rtld(1)), so disable it by default (see #7819). +DYNAMIC_GHC_PROGRAMS = NO else DYNAMIC_GHC_PROGRAMS = YES endif From c7974998200ee6c65d2358d13379ccc86457471d Mon Sep 17 00:00:00 2001 From: Gabor Pali Date: Sat, 27 Apr 2013 23:17:01 +0200 Subject: [PATCH 2/2] Fix linking with binutils 2.22 or later on FreeBSD 9.1, where one should explicitly link against any dependent library --- rts/package.conf.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rts/package.conf.in b/rts/package.conf.in index 9aef05dbb59d..279cb0401780 100644 --- a/rts/package.conf.in +++ b/rts/package.conf.in @@ -41,6 +41,9 @@ extra-libraries: ,"gdi32" /* for the linker */ ,"winmm" /* for the linker */ #endif +#ifdef freebsd_HOST_OS + , "pthread" /* for pthread_getthreadid_np() */ +#endif #if defined(DEBUG) && defined(HAVE_LIBBFD) ,"bfd", "iberty" /* for debugging */ #endif