]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: avoid exporting all symbols on windows buildmode=c-shared
authorQuim Muntal <quimmuntal@gmail.com>
Thu, 15 Oct 2020 21:12:49 +0000 (23:12 +0200)
committerIan Lance Taylor <iant@golang.org>
Thu, 22 Oct 2020 22:40:17 +0000 (22:40 +0000)
commit6f7b553c82b69b47becbe36d9115971d30fdab48
tree61e0919083d23ea9ef8c1d617aab8f0168dc8935
parent4ce9ea52c9ac48f85fba1233b6e7d563f89dff8b
cmd/cgo: avoid exporting all symbols on windows buildmode=c-shared

Disable default symbol auto-export behaviour by marking exported
function with the __declspec(dllexport) attribute. Old behaviour can
still be used by setting -extldflags=-Wl,--export-all-symbols.

See https://sourceware.org/binutils/docs/ld/WIN32.html for more info.

This change cuts 50kb of a "hello world" dll.

Updates #6853
Fixes #30674

Change-Id: I9c7fb09c677cc760f24d0f7d199740ae73981413
Reviewed-on: https://go-review.googlesource.com/c/go/+/262797
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
misc/cgo/testcshared/cshared_test.go
src/cmd/cgo/out.go