]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.15] cmd/cgo: avoid exporting all symbols on windows buildmode...
authorQuim Muntal <quimmuntal@gmail.com>
Thu, 15 Oct 2020 21:12:49 +0000 (23:12 +0200)
committerDmitri Shuralyov <dmitshur@golang.org>
Wed, 31 Mar 2021 21:39:27 +0000 (21:39 +0000)
commit5055314a5749664ab66a24beed8158552e276959
treefd317bed928975311fdc353b967ff355eb846151
parenta07f9d2f82598d2f5cc0df0e813a6a2309cb96e6
[release-branch.go1.15] 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.
Updates #30674.
Fixes #43591.

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>
Reviewed-on: https://go-review.googlesource.com/c/go/+/300693
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: David Chase <drchase@google.com>
misc/cgo/testcshared/cshared_test.go
src/cmd/cgo/out.go