]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: Plan 9 build needs an additional include path
authorLucio De Re <lucio.dere@gmail.com>
Fri, 6 Sep 2013 06:15:44 +0000 (16:15 +1000)
committerRob Pike <r@golang.org>
Fri, 6 Sep 2013 06:15:44 +0000 (16:15 +1000)
cmd/cc: bv.c imports libc.h twice

When using the Plan 9 compiler, the invocation

        #include <../ld/textflag.h>

works for the toolchain, but not for the MACH library.

Module cmd/cc/bv.c includes libc.h and "cc.h", which in
turn also includes libc.h.  In the Plan 9 context, this
causes a number of duplicate definitions.

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/13303047

src/cmd/cc/bv.c
src/cmd/dist/build.c

index 38d9e4377c8a2f6dbb96f0a0f1cbc7cf552c5c6a..51b7f4076fc39022da7deb1f35937a2eae60a4f2 100644 (file)
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 #include <u.h>
-#include <libc.h>
 #include "cc.h"
 
 enum {
index f02bfd8e71109a6df7d412e9e7afcf5410247ad3..f46771d20d556aee80ec2b119cd8c6e1f85f7954 100644 (file)
@@ -932,6 +932,8 @@ install(char *dir)
                                        vadd(&compile, "-Bp+");
                                vadd(&compile, bpathf(&b, "-I%s/include/plan9", goroot));
                                vadd(&compile, bpathf(&b, "-I%s/include/plan9/%s", goroot, gohostarch));
+                               // Work around Plan 9 C compiler's handling of #include with .. path.
+                               vadd(&compile, bpathf(&b, "-I%s/src/cmd/ld", goroot));
                        } else {
                                vcopy(&compile, gccargs.p, gccargs.len);
                                vadd(&compile, "-c");