Index: driver/cfa.cc
===================================================================
--- driver/cfa.cc	(revision d231700d6ebda52b790c9c45a3fe6bbb1022aec2)
+++ driver/cfa.cc	(revision 92a97685f5aabd9745b94f924132f4ef5f9d6868)
@@ -411,5 +411,7 @@
 		args[nargs++] = "-lcfathread";
 		args[nargs++] = "-Wl,--pop-state";
+		args[nargs++] = "-Wl,--push-state,--no-as-needed";
 		args[nargs++] = "-lcfa";
+		args[nargs++] = "-Wl,--pop-state";
 		args[nargs++] = "-pthread";
 		args[nargs++] = "-ldl";
Index: tests/linking/.expect/nostdlib.txt
===================================================================
--- tests/linking/.expect/nostdlib.txt	(revision 92a97685f5aabd9745b94f924132f4ef5f9d6868)
+++ tests/linking/.expect/nostdlib.txt	(revision 92a97685f5aabd9745b94f924132f4ef5f9d6868)
@@ -0,0 +1,1 @@
+NO
Index: tests/linking/nostdlib.cfa
===================================================================
--- tests/linking/nostdlib.cfa	(revision 92a97685f5aabd9745b94f924132f4ef5f9d6868)
+++ tests/linking/nostdlib.cfa	(revision 92a97685f5aabd9745b94f924132f4ef5f9d6868)
@@ -0,0 +1,34 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// nostdlib.cfa --
+//
+// Author           : Thierry Delisle
+// Created On       : Tue Jul 16 12:14:39 2019
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+extern _Bool threading_enabled(void) __attribute__((weak));
+
+int main() {
+	if(threading_enabled) {
+		if(threading_enabled()) {
+			printf("YES\n");
+		} else {
+			printf("NO\n");
+		}
+	} else {
+		printf("NO LIB\n");
+	}
+	return 0;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa nostdlib.cfa" //
+// End: //
