]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld: pass -Qunused-arguments to clang during host linking.
authorShenghou Ma <minux.ma@gmail.com>
Sat, 29 Mar 2014 21:10:25 +0000 (17:10 -0400)
committerShenghou Ma <minux.ma@gmail.com>
Sat, 29 Mar 2014 21:10:25 +0000 (17:10 -0400)
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/82140043

src/cmd/ld/lib.c

index 888bc2ce0d733027782f278eee9ccdaf9a4f28a5..d49e6bcf8fbfa4f6b548860a163c1fc175e7ca33 100644 (file)
@@ -562,7 +562,7 @@ hostlink(void)
                p = strchr(p + 1, ' ');
        }
 
-       argv = malloc((13+nhostobj+nldflag+c)*sizeof argv[0]);
+       argv = malloc((14+nhostobj+nldflag+c)*sizeof argv[0]);
        argc = 0;
        if(extld == nil)
                extld = "gcc";
@@ -605,6 +605,9 @@ hostlink(void)
        if(iself)
                argv[argc++] = "-rdynamic";
 
+       if(strstr(argv[0], "clang") != nil)
+               argv[argc++] = "-Qunused-arguments";
+
        // already wrote main object file
        // copy host objects to temporary directory
        for(i=0; i<nhostobj; i++) {