8
8
"os"
9
9
"strings"
10
10
"testing"
11
-
12
- "cmd/go/internal/cfg"
13
11
)
14
12
15
13
var goodCompilerFlags = [][]string {
@@ -247,8 +245,6 @@ var badLinkerFlags = [][]string{
247
245
{"-Wl,--hash-style=foo" },
248
246
{"-x" , "--c" },
249
247
{"-x" , "@obj" },
250
- {"-Wl,-dylib_install_name,@foo" },
251
- {"-Wl,-install_name,@foo" },
252
248
{"-Wl,-rpath,@foo" },
253
249
{"-Wl,-R,foo,bar" },
254
250
{"-Wl,-R,@foo" },
@@ -265,21 +261,6 @@ var badLinkerFlags = [][]string{
265
261
{"./-Wl,--push-state,-R.c" },
266
262
}
267
263
268
- var goodLinkerFlagsOnDarwin = [][]string {
269
- {"-Wl,-dylib_install_name,@rpath" },
270
- {"-Wl,-dylib_install_name,@rpath/" },
271
- {"-Wl,-dylib_install_name,@rpath/foo" },
272
- {"-Wl,-install_name,@rpath" },
273
- {"-Wl,-install_name,@rpath/" },
274
- {"-Wl,-install_name,@rpath/foo" },
275
- {"-Wl,-rpath,@executable_path" },
276
- {"-Wl,-rpath,@executable_path/" },
277
- {"-Wl,-rpath,@executable_path/foo" },
278
- {"-Wl,-rpath,@loader_path" },
279
- {"-Wl,-rpath,@loader_path/" },
280
- {"-Wl,-rpath,@loader_path/foo" },
281
- }
282
-
283
264
func TestCheckLinkerFlags (t * testing.T ) {
284
265
for _ , f := range goodLinkerFlags {
285
266
if err := checkLinkerFlags ("test" , "test" , f ); err != nil {
@@ -291,31 +272,6 @@ func TestCheckLinkerFlags(t *testing.T) {
291
272
t .Errorf ("missing error for %q" , f )
292
273
}
293
274
}
294
-
295
- goos := cfg .Goos
296
-
297
- cfg .Goos = "darwin"
298
- for _ , f := range goodLinkerFlagsOnDarwin {
299
- if err := checkLinkerFlags ("test" , "test" , f ); err != nil {
300
- t .Errorf ("unexpected error for %q: %v" , f , err )
301
- }
302
- }
303
-
304
- cfg .Goos = "ios"
305
- for _ , f := range goodLinkerFlagsOnDarwin {
306
- if err := checkLinkerFlags ("test" , "test" , f ); err != nil {
307
- t .Errorf ("unexpected error for %q: %v" , f , err )
308
- }
309
- }
310
-
311
- cfg .Goos = "linux"
312
- for _ , f := range goodLinkerFlagsOnDarwin {
313
- if err := checkLinkerFlags ("test" , "test" , f ); err == nil {
314
- t .Errorf ("missing error for %q" , f )
315
- }
316
- }
317
-
318
- cfg .Goos = goos
319
275
}
320
276
321
277
func TestCheckFlagAllowDisallow (t * testing.T ) {
0 commit comments