-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c13899e
commit ca72831
Showing
79 changed files
with
2,977 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//--from | ||
func TestMirrorWithReflect(t *testing.T) { | ||
//--to | ||
func TestMirrorWithReflect(t *testing.T) { | ||
t.Skip("file is not supported in this environment") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//--from | ||
func Fcntl(fd int, cmd int, arg int) (int, error) { | ||
val, errno := fcntl(int32(fd), int32(cmd), int32(arg)) | ||
if val == -1 { | ||
return int(val), syscall.Errno(errno) | ||
} | ||
return int(val), nil | ||
} | ||
//--to | ||
func Fcntl(fd int, cmd int, arg int) (int, error) { | ||
return 0, syscall.ENOSYS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//--from | ||
func tryExec() error { | ||
//--to | ||
func tryExec() error { | ||
return fmt.Errorf("can't probe for exec support") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//--from | ||
func HasGoBuild() bool { | ||
//--to | ||
func HasGoBuild() bool { | ||
return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//--from | ||
//go:build windows || plan9 || (js && wasm) || wasip1 | ||
//--to | ||
//go:build windows || plan9 || (js && wasm) || wasip1 || linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//--from | ||
//go:build unix | ||
//--to | ||
//go:build unix && !linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//--from | ||
func TestLinkerGC(t *testing.T) { | ||
//--to | ||
func TestLinkerGC(t *testing.T) { | ||
t.Skip("go tools are not supported in this environment") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//--from | ||
func TestDefaultRace(t *testing.T) { | ||
//--to | ||
func TestDefaultRace(t *testing.T) { | ||
t.Skip("os.Getenv and creating processes are not supported in this environment") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//--from | ||
func TestAtomicAlignment(t *testing.T) { | ||
//--to | ||
func TestAtomicAlignment(t *testing.T) { | ||
t.Skip("file is not supported in this environment") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//--from | ||
func TestCallersNilPointerPanic(t *testing.T) { | ||
//--to | ||
func TestCallersNilPointerPanic(t *testing.T) { | ||
t.Skip("handling nil pointer access is not supported in this environment") | ||
//--from | ||
func TestCallersDeferNilFuncPanic(t *testing.T) { | ||
//--to | ||
func TestCallersDeferNilFuncPanic(t *testing.T) { | ||
t.Skip("handling nil pointer access is not supported in this environment") | ||
//--from | ||
func TestCallersDeferNilFuncPanicWithLoop(t *testing.T) { | ||
//--to | ||
func TestCallersDeferNilFuncPanicWithLoop(t *testing.T) { | ||
t.Skip("handling nil pointer access is not supported in this environment") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//--from | ||
*/ | ||
import "C" | ||
//--to | ||
#cgo !darwin LDFLAGS: -Wl,-unresolved-symbols=ignore-all | ||
#cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup | ||
*/ | ||
import "C" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
//--from | ||
#include <pthread.h> | ||
#include <errno.h> | ||
#include <string.h> // strerror | ||
#include <signal.h> | ||
#include <stdlib.h> | ||
#include "libcgo.h" | ||
#include "libcgo_unix.h" | ||
//--to | ||
#include <pthread.h> | ||
#include <errno.h> | ||
#include <string.h> // strerror | ||
#include <stdlib.h> | ||
#include "libcgo.h" | ||
#include "libcgo_unix.h" | ||
//--from | ||
void | ||
_cgo_sys_thread_start(ThreadStart *ts) | ||
{ | ||
pthread_attr_t attr; | ||
sigset_t ign, oset; | ||
pthread_t p; | ||
size_t size; | ||
int err; | ||
|
||
sigfillset(&ign); | ||
pthread_sigmask(SIG_SETMASK, &ign, &oset); | ||
|
||
pthread_attr_init(&attr); | ||
pthread_attr_getstacksize(&attr, &size); | ||
// Leave stacklo=0 and set stackhi=size; mstart will do the rest. | ||
ts->g->stackhi = size; | ||
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts); | ||
|
||
pthread_sigmask(SIG_SETMASK, &oset, nil); | ||
|
||
if (err != 0) { | ||
fatalf("pthread_create failed: %s", strerror(err)); | ||
} | ||
} | ||
//--to | ||
void | ||
_cgo_sys_thread_start(ThreadStart *ts) | ||
{ | ||
pthread_attr_t attr; | ||
pthread_t p; | ||
size_t size; | ||
int err; | ||
|
||
pthread_attr_init(&attr); | ||
pthread_attr_getstacksize(&attr, &size); | ||
// Leave stacklo=0 and set stackhi=size; mstart will do the rest. | ||
ts->g->stackhi = size; | ||
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts); | ||
|
||
if (err != 0) { | ||
fatalf("pthread_create failed: %s", strerror(err)); | ||
} | ||
} | ||
//--from | ||
static void* | ||
threadentry(void *v) | ||
{ | ||
//--to | ||
static void* | ||
threadentry(void *v) | ||
{ | ||
extern void hitsumabushi_initializeThread(void); | ||
hitsumabushi_initializeThread(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
//--from | ||
void | ||
_cgo_sys_thread_start(ThreadStart *ts) | ||
{ | ||
pthread_attr_t attr; | ||
sigset_t ign, oset; | ||
pthread_t p; | ||
size_t size; | ||
int err; | ||
|
||
sigfillset(&ign); | ||
pthread_sigmask(SIG_SETMASK, &ign, &oset); | ||
|
||
pthread_attr_init(&attr); | ||
pthread_attr_getstacksize(&attr, &size); | ||
// Leave stacklo=0 and set stackhi=size; mstart will do the rest. | ||
ts->g->stackhi = size; | ||
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts); | ||
|
||
pthread_sigmask(SIG_SETMASK, &oset, nil); | ||
|
||
if (err != 0) { | ||
fatalf("pthread_create failed: %s", strerror(err)); | ||
} | ||
} | ||
//--to | ||
void | ||
_cgo_sys_thread_start(ThreadStart *ts) | ||
{ | ||
pthread_attr_t attr; | ||
sigset_t ign, oset; | ||
pthread_t p; | ||
size_t size; | ||
int err; | ||
|
||
sigfillset(&ign); | ||
pthread_sigmask(SIG_SETMASK, &ign, &oset); | ||
|
||
pthread_attr_init(&attr); | ||
pthread_attr_setstacksize(&attr, 16 * 4096); // Hack for some special environments | ||
pthread_attr_getstacksize(&attr, &size); | ||
// Leave stacklo=0 and set stackhi=size; mstart will do the rest. | ||
ts->g->stackhi = size; | ||
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts); | ||
|
||
pthread_sigmask(SIG_SETMASK, &oset, nil); | ||
|
||
if (err != 0) { | ||
fatalf("pthread_create failed: %s", strerror(err)); | ||
} | ||
} | ||
//--from | ||
static void* | ||
threadentry(void *v) | ||
{ | ||
//--to | ||
static void* | ||
threadentry(void *v) | ||
{ | ||
// Note that threadentry will also be defined in gcc_linux.go in Go 1.22. | ||
extern void hitsumabushi_initializeThread(void); | ||
hitsumabushi_initializeThread(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//--from | ||
void | ||
x_cgo_setenv(char **arg) | ||
{ | ||
_cgo_tsan_acquire(); | ||
setenv(arg[0], arg[1], 1); | ||
_cgo_tsan_release(); | ||
} | ||
//--to | ||
void | ||
x_cgo_setenv(char **arg) | ||
{ | ||
} | ||
//--from | ||
void | ||
x_cgo_unsetenv(char **arg) | ||
{ | ||
_cgo_tsan_acquire(); | ||
unsetenv(arg[0]); | ||
_cgo_tsan_release(); | ||
} | ||
//--to | ||
void | ||
x_cgo_unsetenv(char **arg) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//--from | ||
//go:build linux && (amd64 || arm64 || ppc64le) | ||
//--to | ||
//go:build linux && (arm64 || ppc64le) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors | ||
|
||
#include <time.h> | ||
|
||
int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) { | ||
return clock_gettime(clk_id, tp); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors | ||
|
||
#include <stdint.h> | ||
|
||
int32_t hitsumabushi_getproccount() { | ||
return 1; | ||
} |
Oops, something went wrong.