cmd/go/internal/work: allow single character values in -Wl, linker flags
Allow single character values in -Wl, linker flags by modifying the regular expressions to use the star operator instead of the plus operator. Fixes #70924 Change-Id: Ie7940197cc8503440a87c6b29409a13377a20534 GitHub-Last-Rev: 42e8ac87d600239ceff434eb202e2747f2cceb3c GitHub-Pull-Request: golang/go#70937 Reviewed-on: https://go-review.googlesource.com/c/go/+/638035 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
committed by
Gopher Robot
parent
05d8984781
commit
9f6c80a76a
@@ -201,23 +201,23 @@ var validLinkerFlags = []*lazyregexp.Regexp{
|
||||
re(`-Wl,--end-group`),
|
||||
re(`-Wl,--(no-)?export-dynamic`),
|
||||
re(`-Wl,-E`),
|
||||
re(`-Wl,-framework,[^,@\-][^,]+`),
|
||||
re(`-Wl,-framework,[^,@\-][^,]*`),
|
||||
re(`-Wl,--hash-style=(sysv|gnu|both)`),
|
||||
re(`-Wl,-headerpad_max_install_names`),
|
||||
re(`-Wl,--no-undefined`),
|
||||
re(`-Wl,--pop-state`),
|
||||
re(`-Wl,--push-state`),
|
||||
re(`-Wl,-R,?([^@\-,][^,@]*$)`),
|
||||
re(`-Wl,--just-symbols[=,]([^,@\-][^,@]+)`),
|
||||
re(`-Wl,-rpath(-link)?[=,]([^,@\-][^,]+)`),
|
||||
re(`-Wl,--just-symbols[=,]([^,@\-][^,@]*)`),
|
||||
re(`-Wl,-rpath(-link)?[=,]([^,@\-][^,]*)`),
|
||||
re(`-Wl,-s`),
|
||||
re(`-Wl,-search_paths_first`),
|
||||
re(`-Wl,-sectcreate,([^,@\-][^,]+),([^,@\-][^,]+),([^,@\-][^,]+)`),
|
||||
re(`-Wl,-sectcreate,([^,@\-][^,]*),([^,@\-][^,]*),([^,@\-][^,]*)`),
|
||||
re(`-Wl,--start-group`),
|
||||
re(`-Wl,-?-static`),
|
||||
re(`-Wl,-?-subsystem,(native|windows|console|posix|xbox)`),
|
||||
re(`-Wl,-syslibroot[=,]([^,@\-][^,]+)`),
|
||||
re(`-Wl,-undefined[=,]([^,@\-][^,]+)`),
|
||||
re(`-Wl,-syslibroot[=,]([^,@\-][^,]*)`),
|
||||
re(`-Wl,-undefined[=,]([^,@\-][^,]*)`),
|
||||
re(`-Wl,-?-unresolved-symbols=[^,]+`),
|
||||
re(`-Wl,--(no-)?warn-([^,]+)`),
|
||||
re(`-Wl,-?-wrap[=,][^,@\-][^,]*`),
|
||||
|
||||
@@ -182,6 +182,13 @@ var goodLinkerFlags = [][]string{
|
||||
{"-Wl,--pop-state"},
|
||||
{"-Wl,--push-state,--as-needed"},
|
||||
{"-Wl,--push-state,--no-as-needed,-Bstatic"},
|
||||
{"-Wl,--just-symbols,."},
|
||||
{"-Wl,-framework,."},
|
||||
{"-Wl,-rpath,."},
|
||||
{"-Wl,-rpath-link,."},
|
||||
{"-Wl,-sectcreate,.,.,."},
|
||||
{"-Wl,-syslibroot,."},
|
||||
{"-Wl,-undefined,."},
|
||||
}
|
||||
|
||||
var badLinkerFlags = [][]string{
|
||||
|
||||
Reference in New Issue
Block a user