]> Cypherpunks repositories - gostls13.git/commit
cmd/link: pass flags to external linker in deterministic order
authorCherry Mui <cherryyz@google.com>
Wed, 12 Jul 2023 20:54:32 +0000 (16:54 -0400)
committerCherry Mui <cherryyz@google.com>
Thu, 20 Jul 2023 20:54:38 +0000 (20:54 +0000)
commit57e2eb64ebdd441356eb3fb57bc06636cbfa58c0
tree84efab16029e2c081912a0a8b97c18f57a2cb916
parente201ff2b98981807c4d57ed15d42d308817e138a
cmd/link: pass flags to external linker in deterministic order

Currently we may pass C linker flags in nondeterministic order,
as on ELf systems we pass --export-dynamic-symbol for symbols from
a map. This is usally not a big problem because even if the flags
are passed in nondeterministic order the resulting binary is
probably still deterministic. This CL makes it pass them in a
deterministic order to be extra sure. This also helps build
systems where e.g. there is a build cache for the C linking action.

Change-Id: I930524dd2c3387f49d62be7ad2cef937cb2c2238
Reviewed-on: https://go-review.googlesource.com/c/go/+/509215
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
src/cmd/link/internal/ld/lib.go
src/cmd/link/link_test.go