[m-dev.] diff: add -ldl to THREAD_LIBS on Linux

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Sep 22 19:27:20 AEDT 2000


Estimated hours taken: 0.5

scripts/ml.in:
	For Linux, add `-ldl' to THREAD_LIBS.
	This avoids link errors in grade asm_fast.par.gc.
	Also add some comments.

Workspace: /home/pgrad/fjh/ws/hg
Index: scripts/ml.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/ml.in,v
retrieving revision 1.83
diff -u -d -r1.83 ml.in
--- scripts/ml.in	2000/09/22 08:23:45	1.83
+++ scripts/ml.in	2000/09/22 08:26:02
@@ -555,10 +555,22 @@
 
 case $use_thread_libs in
 	true)
+		# For Linux, Irix, Solaris, and HPUX,
+		# the thread-enabled version of the Boehm
+		# collector contains a reference to dlopen(), so 
+		# if threads are enabled, we need to link with the
+		# appropriate extra library for that (-ldl on Linux
+		# and Solaris, -lrt on HPUX, and nothing on Irix).
+		# XXX That should only be done if conservative GC
+		#     is enabled.
+
 		case "$FULLARCH" in
  		*-osf*)		THREAD_LIBS="-lpthreads -lmach -lc_r" ;;
-		*-linux*)	THREAD_LIBS="-lpthread" ;;
+		*-linux*)	THREAD_LIBS="-lpthread -ldl" ;;
 		*-solaris*)	THREAD_LIBS="-lpthread -ldl" ;;
+		### We don't yet support threads on HPUX and IRIX
+		### *-hpux*)	THREAD_LIBS="-lpthread -lrt" ;;
+		### *-irix*)	THREAD_LIBS="-lpthread" ;;
 		*cygwin*)
 			case $COMPILER in
 				cl)	ARCH_OPTS="/MD"

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list