Skip to content

Commit 87c03bd

Browse files
siddharthabgopherbot
authored andcommitted
cmd/link: fix flags order in linkerFlagSupported
Flags from CGo directives should be placed before extldflags so that extldflags get more preference. This is also the order followed by the final link command. Fixes #69350 Change-Id: I2cfb22ae4ea7a160cc614440e88ef2eb82ea7399 Reviewed-on: https://go-review.googlesource.com/c/go/+/614275 Reviewed-by: Cherry Mui <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]>
1 parent 0f23539 commit 87c03bd

File tree

1 file changed

+1
-1
lines changed
  • src/cmd/link/internal/ld

1 file changed

+1
-1
lines changed

src/cmd/link/internal/ld/lib.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2133,7 +2133,7 @@ func linkerFlagSupported(arch *sys.Arch, linker, altLinker, flag string) bool {
21332133

21342134
flags := hostlinkArchArgs(arch)
21352135

2136-
moreFlags := trimLinkerArgv(append(flagExtldflags, ldflag...))
2136+
moreFlags := trimLinkerArgv(append(ldflag, flagExtldflags...))
21372137
flags = append(flags, moreFlags...)
21382138

21392139
if altLinker != "" {

0 commit comments

Comments
 (0)