 +GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \
 +	then echo -L${objroot}/../gcc ; fi`
 +
-+OUTPUTS = libenclave.a
++OUTPUTS = libenclave.a libpthread.a
 +SPECS = ${srcdir}/enclave.specs
 +
 +# Host specific makefile fragment comes in here.

diff -Naur ../newlib-2.5.0.20170922/libgloss/enclave/Makefile.in ./libgloss/enclave/Makefile.in
--- ../newlib-2.5.0.20170922/libgloss/enclave/Makefile.in
+++ ./libgloss/enclave/Makefile.in
@@ -0,0 +1,131 @@
+# Copyright (c) 1998 Cygnus Support
+#
+# The authors hereby grant permission to use, copy, modify, distribute,

+
+void _exit(int rc)
+{
+  enclave_exit(rc);
+}
+
+int _close(int fildes)
