From fd7ddad160bfcfd861db00e5d4df01ceaf0a66e9 Mon Sep 17 00:00:00 2001 From: Lucio De Re Date: Fri, 6 Sep 2013 16:15:44 +1000 Subject: [PATCH] cmd/dist: Plan 9 build needs an additional include path 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 | 1 - src/cmd/dist/build.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd/cc/bv.c b/src/cmd/cc/bv.c index 38d9e4377c8..51b7f4076fc 100644 --- a/src/cmd/cc/bv.c +++ b/src/cmd/cc/bv.c @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. #include -#include #include "cc.h" enum { diff --git a/src/cmd/dist/build.c b/src/cmd/dist/build.c index f02bfd8e711..f46771d20d5 100644 --- a/src/cmd/dist/build.c +++ b/src/cmd/dist/build.c @@ -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");