]> Cypherpunks repositories - gostls13.git/commitdiff
libcgo: fix NaCl build.
authorNigel Tao <nigeltao@golang.org>
Mon, 13 Sep 2010 03:12:46 +0000 (13:12 +1000)
committerNigel Tao <nigeltao@golang.org>
Mon, 13 Sep 2010 03:12:46 +0000 (13:12 +1000)
R=r, rsc, nigeltao
CC=golang-dev
https://golang.org/cl/2110046

src/libcgo/Makefile
src/libcgo/nacl_386.c
src/pkg/os/dir_nacl.go

index 380bc596e9d8b8d2b00f477e5642676e30e52ce4..259799c92f6b8264e961c59d8cf875cc73c084ca 100755 (executable)
@@ -16,9 +16,10 @@ OFILES=\
 HOST_CFLAGS_386=-m32
 HOST_CFLAGS_amd64=-m64
 
-LDFLAGS_linux=-shared -lpthread -lm
 LDFLAGS_darwin=-dynamiclib -Wl,-undefined,dynamic_lookup /usr/lib/libpthread.dylib
-LDFLAGS_freebsd=-pthread -shared -lm
+LDFLAGS_freebsd=-shared -lm -pthread
+LDFLAGS_linux=-shared -lm -lpthread
+LDFLAGS_nacl=-shared -lm -lpthread
 LDFLAGS_windows=-shared -lm -mthreads
 
 %.o: %.c
index 32d8629849b5408fa536ee7543b9a19a639d28a1..d674aca1df61f821145ef957ff67492b3cfd78f0 100644 (file)
@@ -1 +1,17 @@
-/* unimplemented */
+// Copyright 2010 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "libcgo.h"
+
+void
+initcgo(void)
+{
+}
+
+void
+libcgo_sys_thread_start(ThreadStart *ts)
+{
+       // unimplemented
+       *(int*)0 = 0;
+}
index e76b2bea09c8a0346be9c85024d9ba8a84021f21..42cc88a8a7792dba1ac914433178ba4f497119a9 100644 (file)
@@ -57,7 +57,7 @@ func (file *File) Readdirnames(count int) (names []string, err Error) {
                                continue
                        }
                        bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
-                       var name = string(bytes[0:clen(bytes)])
+                       var name = string(bytes[0:clen(bytes[0:])])
                        if name == "." || name == ".." { // Useless names
                                continue
                        }