summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-03 18:39:54 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-03 18:39:54 +0000
commit7389edf23f00e48c4b1f9cbc8deca95bd54dce5b (patch)
tree0c76240dd904927dcaadeb0e937ac447ab5d453d /libgo
parent06b286cb7b190e2258caa993e701aa313968bf79 (diff)
downloadgcc-7389edf23f00e48c4b1f9cbc8deca95bd54dce5b.tar.gz
PR go/77809
libgo: strip most C macros from runtime.inc The Go runtime package is picking up C macros from runtime_sysinfo.go and then re-exporting them to runtime.inc. This can cause name conflicts. Change the Makefile so that we only put the macros we need into runtime.inc. These are the constants that are actually defined by Go code, not runtime_sysinfo.go. There are only a few, so we can pattern match. This is an additional hack on runtime.inc. The long term goal is to convert the runtime package to Go and eliminate runtime.inc entirely, so a few hacks seem acceptable. Fixes GCC PR 77809. Reviewed-on: https://go-review.googlesource.com/30167 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240724 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/Makefile.am9
-rw-r--r--libgo/Makefile.in9
2 files changed, 14 insertions, 4 deletions
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index e5150693fab..a0566c10be6 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -1284,8 +1284,13 @@ runtime_go_lo_GOCFLAGS = -fgo-c-header=runtime.inc.tmp -fgo-compiling-runtime
runtime-go.lo:
$(BUILDPACKAGE)
runtime.inc: s-runtime-inc; @true
-s-runtime-inc: runtime-go.lo
- $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp runtime.inc
+s-runtime-inc: runtime-go.lo Makefile
+ rm -f runtime.inc.tmp2
+ grep -v "#define _" runtime.inc.tmp > runtime.inc.tmp2
+ for pattern in '_G[a-z]' '_P[a-z]' _Max _Lock _Sig _Trace _MHeap _Num; do \
+ grep "#define $$pattern" runtime.inc.tmp >> runtime.inc.tmp2; \
+ done
+ $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp2 runtime.inc
$(STAMP) $@
runtime_check_GOCFLAGS = -fgo-compiling-runtime
runtime/check: $(CHECK_DEPS)
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index bc6832dce0f..7a133f1b377 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -3886,8 +3886,13 @@ runtime-go.lo.dep: $(srcdir)/go/runtime/*.go $(extra_go_files_runtime)
runtime-go.lo:
$(BUILDPACKAGE)
runtime.inc: s-runtime-inc; @true
-s-runtime-inc: runtime-go.lo
- $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp runtime.inc
+s-runtime-inc: runtime-go.lo Makefile
+ rm -f runtime.inc.tmp2
+ grep -v "#define _" runtime.inc.tmp > runtime.inc.tmp2
+ for pattern in '_G[a-z]' '_P[a-z]' _Max _Lock _Sig _Trace _MHeap _Num; do \
+ grep "#define $$pattern" runtime.inc.tmp >> runtime.inc.tmp2; \
+ done
+ $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp2 runtime.inc
$(STAMP) $@
runtime/check: $(CHECK_DEPS)
@$(CHECK)