Commit 3887549c authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by Ian Lance Taylor

[release-branch.go1.12] cmd/go: accept -Wl,-R/path/

This is a backport of CL 178397.

Updates #32167
Fixes #32168

Change-Id: Idb16a01d56814ea09ad277798787355dc6a3121f
Reviewed-on: https://go-review.googlesource.com/c/go/+/181437Reviewed-by: default avatarJason Donenfeld <Jason@zx2c4.com>
Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Jason Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 451e6d61
...@@ -177,6 +177,8 @@ var validLinkerFlags = []*regexp.Regexp{ ...@@ -177,6 +177,8 @@ var validLinkerFlags = []*regexp.Regexp{
re(`-Wl,-framework,[^,@\-][^,]+`), re(`-Wl,-framework,[^,@\-][^,]+`),
re(`-Wl,-headerpad_max_install_names`), re(`-Wl,-headerpad_max_install_names`),
re(`-Wl,--no-undefined`), re(`-Wl,--no-undefined`),
re(`-Wl,-R([^@\-][^,@]*$)`),
re(`-Wl,--just-symbols[=,]([^,@\-][^,@]+)`),
re(`-Wl,-rpath(-link)?[=,]([^,@\-][^,]+)`), re(`-Wl,-rpath(-link)?[=,]([^,@\-][^,]+)`),
re(`-Wl,-s`), re(`-Wl,-s`),
re(`-Wl,-search_paths_first`), re(`-Wl,-search_paths_first`),
...@@ -206,6 +208,8 @@ var validLinkerFlagsWithNextArg = []string{ ...@@ -206,6 +208,8 @@ var validLinkerFlagsWithNextArg = []string{
"-target", "-target",
"-Wl,-framework", "-Wl,-framework",
"-Wl,-rpath", "-Wl,-rpath",
"-Wl,-R",
"-Wl,--just-symbols",
"-Wl,-undefined", "-Wl,-undefined",
} }
......
...@@ -125,6 +125,11 @@ var goodLinkerFlags = [][]string{ ...@@ -125,6 +125,11 @@ var goodLinkerFlags = [][]string{
{"-pthread"}, {"-pthread"},
{"-Wl,-rpath,foo"}, {"-Wl,-rpath,foo"},
{"-Wl,-rpath,$ORIGIN/foo"}, {"-Wl,-rpath,$ORIGIN/foo"},
{"-Wl,-R", "/foo"},
{"-Wl,-R", "foo"},
{"-Wl,-R,foo"},
{"-Wl,--just-symbols=foo"},
{"-Wl,--just-symbols,foo"},
{"-Wl,--warn-error"}, {"-Wl,--warn-error"},
{"-Wl,--no-warn-error"}, {"-Wl,--no-warn-error"},
{"foo.so"}, {"foo.so"},
...@@ -197,6 +202,9 @@ var badLinkerFlags = [][]string{ ...@@ -197,6 +202,9 @@ var badLinkerFlags = [][]string{
{"-x", "--c"}, {"-x", "--c"},
{"-x", "@obj"}, {"-x", "@obj"},
{"-Wl,-rpath,@foo"}, {"-Wl,-rpath,@foo"},
{"-Wl,-R,foo,bar"},
{"-Wl,-R,@foo"},
{"-Wl,--just-symbols,@foo"},
{"../x.o"}, {"../x.o"},
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment