update link flags
This commit is contained in:
@@ -620,11 +620,11 @@ func buildLdflags(goos, goarch, targetTriple string) []string {
|
|||||||
args := []string{
|
args := []string{
|
||||||
"-target", targetTriple,
|
"-target", targetTriple,
|
||||||
"-Wno-override-module",
|
"-Wno-override-module",
|
||||||
|
"-Wl,--error-limit=0",
|
||||||
}
|
}
|
||||||
if goos == runtime.GOOS {
|
if goos == runtime.GOOS {
|
||||||
// Non-cross-compile
|
// Non-cross-compile
|
||||||
args = append(args,
|
args = append(args,
|
||||||
"-Wl,--error-limit=0",
|
|
||||||
"-fuse-ld=lld",
|
"-fuse-ld=lld",
|
||||||
"-Wno-override-module",
|
"-Wno-override-module",
|
||||||
)
|
)
|
||||||
@@ -648,19 +648,33 @@ func buildLdflags(goos, goarch, targetTriple string) []string {
|
|||||||
case "wasi", "wasip1", "js": // wasm-ld (WebAssembly)
|
case "wasi", "wasip1", "js": // wasm-ld (WebAssembly)
|
||||||
args = append(
|
args = append(
|
||||||
args,
|
args,
|
||||||
"-fdata-sections",
|
// "-fdata-sections",
|
||||||
"-ffunction-sections",
|
// "-ffunction-sections",
|
||||||
// "-nostdlib",
|
// "-nostdlib",
|
||||||
// "-Wl,--no-entry",
|
// "-Wl,--no-entry",
|
||||||
"-Wl,--export-all",
|
"-Wl,--export-all",
|
||||||
"-Wl,--allow-undefined",
|
"-Wl,--allow-undefined",
|
||||||
// "-Wl,--import-memory,",
|
// "-Wl,--import-memory,", // unknown import: `env::memory` has not been defined
|
||||||
"-Wl,--export-memory",
|
"-Wl,--export-memory",
|
||||||
"-Wl,--initial-memory=16777216", // 16MB
|
"-Wl,--initial-memory=16777216", // 16MB
|
||||||
// "-pthread",
|
// "-pthread", "-matomics", // undefined symbol: __atomic_load
|
||||||
// "-matomics",
|
"-mbulk-memory",
|
||||||
// "-mbulk-memory",
|
"-mmultimemory",
|
||||||
// "-mmultimemory",
|
"-lc",
|
||||||
|
"-lcrypt",
|
||||||
|
"-lm",
|
||||||
|
"-lrt",
|
||||||
|
"-lutil",
|
||||||
|
// "-lxnet",
|
||||||
|
// "-lresolv",
|
||||||
|
"-lsetjmp",
|
||||||
|
// "-lpthread",
|
||||||
|
"-lwasi-emulated-mman",
|
||||||
|
"-lwasi-emulated-getpid",
|
||||||
|
// "-lwasi-emulated-pthread",
|
||||||
|
"-lwasi-emulated-process-clocks",
|
||||||
|
"-lwasi-emulated-signal",
|
||||||
|
"-mllvm", "-wasm-enable-sjlj",
|
||||||
)
|
)
|
||||||
default: // ld.lld (Unix)
|
default: // ld.lld (Unix)
|
||||||
args = append(
|
args = append(
|
||||||
|
|||||||
Reference in New Issue
Block a user