diff --git a/internal/build/build.go b/internal/build/build.go index 1bc6078a..654b3746 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -490,8 +490,6 @@ func linkMainPkg(ctx *context, pkg *packages.Package, pkgs []*aPackage, conf *Co } linkArgs = append(linkArgs, exargs...) - fmt.Fprintf(os.Stderr, "linkArgs: %v\n", linkArgs) - err = compileAndLinkLLFiles(ctx, app, llFiles, linkArgs, verbose) check(err) diff --git a/runtime/internal/clite/bitcast/_cast/cast.cpp b/runtime/internal/clite/bitcast/_cast/cast.cpp index ae4d6707..8c5b12a1 100644 --- a/runtime/internal/clite/bitcast/_cast/cast.cpp +++ b/runtime/internal/clite/bitcast/_cast/cast.cpp @@ -1,33 +1,39 @@ -typedef union { +typedef union +{ double d; float f; long v; long long ll; } castUnion; -extern "C" { +extern "C" { -double llgoToFloat64(long long v) { +double llgoToFloat64(long long v) +{ castUnion k; k.ll = v; return k.d; } -float llgoToFloat32(int v) { +float llgoToFloat32(int v) +{ castUnion k; k.v = v; return k.f; } -long long llgoFromFloat64(double v) { +long long llgoFromFloat64(double v) +{ castUnion k; k.d = v; return k.ll; } -int llgoFromFloat32(float v) { +int llgoFromFloat32(float v) +{ castUnion k; k.f = v; return k.v; } -} \ No newline at end of file + +} diff --git a/runtime/internal/clite/debug/_wrap/debug.cpp b/runtime/internal/clite/debug/_wrap/debug.cpp index 441cd971..64d2a846 100644 --- a/runtime/internal/clite/debug/_wrap/debug.cpp +++ b/runtime/internal/clite/debug/_wrap/debug.cpp @@ -11,9 +11,13 @@ extern "C" { -void *llgo_address() { return __builtin_return_address(0); } +void *llgo_address() { + return __builtin_return_address(0); +} -int llgo_addrinfo(void *addr, Dl_info *info) { return dladdr(addr, info); } +int llgo_addrinfo(void *addr, Dl_info *info) { + return dladdr(addr, info); +} void llgo_stacktrace(int skip, void *ctx, int (*fn)(void *ctx, void *pc, void *offset, void *sp, char *name)) { unw_cursor_t cursor; @@ -31,10 +35,11 @@ void llgo_stacktrace(int skip, void *ctx, int (*fn)(void *ctx, void *pc, void *o if (unw_get_reg(&cursor, UNW_REG_IP, &pc) == 0) { unw_get_proc_name(&cursor, fname, sizeof(fname), &offset); unw_get_reg(&cursor, UNW_REG_SP, &sp); - if (fn(ctx, (void *)pc, (void *)offset, (void *)sp, fname) == 0) { + if (fn(ctx, (void*)pc, (void*)offset, (void*)sp, fname) == 0) { return; } } } } + } diff --git a/runtime/internal/clite/os/_os/os.cpp b/runtime/internal/clite/os/_os/os.cpp index cc3d29d5..db43043c 100644 --- a/runtime/internal/clite/os/_os/os.cpp +++ b/runtime/internal/clite/os/_os/os.cpp @@ -1,15 +1,18 @@ -#include #include +#include extern "C" { -int cliteClearenv() { - extern char **environ; - if (environ != NULL) { - *environ = NULL; - } - return 0; +int cliteClearenv() +{ + extern char **environ; + if (environ != NULL) + { + *environ = NULL; + } + return 0; } int cliteErrno() { return errno; } -} \ No newline at end of file + +} diff --git a/runtime/internal/lib/internal/syscall/unix/_unix/fcntl_unix.cpp b/runtime/internal/lib/internal/syscall/unix/_unix/fcntl_unix.cpp index fa1ad6f9..1224ab0e 100644 --- a/runtime/internal/lib/internal/syscall/unix/_unix/fcntl_unix.cpp +++ b/runtime/internal/lib/internal/syscall/unix/_unix/fcntl_unix.cpp @@ -9,6 +9,8 @@ struct fcntl_ret int32_t err; // Error code }; +extern "C" { + // llgo_fcntl implements the fcntl system call wrapper for Go // fd: file descriptor // cmd: fcntl command @@ -30,4 +32,6 @@ struct fcntl_ret llgo_fcntl2(int32_t fd, int32_t cmd, int32_t arg) } return ret; -} \ No newline at end of file +} + +} diff --git a/runtime/internal/lib/runtime/_wrap/runtime.cpp b/runtime/internal/lib/runtime/_wrap/runtime.cpp index f97d91bd..269a7b22 100644 --- a/runtime/internal/lib/runtime/_wrap/runtime.cpp +++ b/runtime/internal/lib/runtime/_wrap/runtime.cpp @@ -2,11 +2,13 @@ extern "C" { -int llgo_maxprocs() { +int llgo_maxprocs() +{ #ifdef _SC_NPROCESSORS_ONLN return (int)sysconf(_SC_NPROCESSORS_ONLN); #else return 1; #endif } -} \ No newline at end of file + +} diff --git a/xtool/clang/clang.go b/xtool/clang/clang.go index 78ca3e18..9ac3974d 100644 --- a/xtool/clang/clang.go +++ b/xtool/clang/clang.go @@ -91,7 +91,6 @@ func (p *Cmd) execWithFlags(flags []string, args ...string) error { if p.Env != nil { cmd.Env = p.Env } - fmt.Fprintln(os.Stderr, cmd.String()) return cmd.Run() } @@ -132,8 +131,6 @@ func (p *Cmd) CheckLinkArgs(cmdArgs []string, wasm bool) error { srcIn := strings.NewReader(src) p.Stdin = srcIn - fmt.Fprintf(os.Stderr, "args: %v\n", args) - // Execute the command return p.execWithFlags([]string{"LDFLAGS", "CCFLAGS"}, args...) }