Commit 95ccd17c by Ian Lance Taylor

re PR go/77809 ("_LITTLE_ENDIAN" redefined)

	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

From-SVN: r240724
parent 606dda21
f3fb9bf2d5a009a707962a416fcd1a8435756218 325f8074c5224ae537f8e00aede5c780b70f914c
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -1284,8 +1284,13 @@ runtime_go_lo_GOCFLAGS = -fgo-c-header=runtime.inc.tmp -fgo-compiling-runtime ...@@ -1284,8 +1284,13 @@ runtime_go_lo_GOCFLAGS = -fgo-c-header=runtime.inc.tmp -fgo-compiling-runtime
runtime-go.lo: runtime-go.lo:
$(BUILDPACKAGE) $(BUILDPACKAGE)
runtime.inc: s-runtime-inc; @true runtime.inc: s-runtime-inc; @true
s-runtime-inc: runtime-go.lo s-runtime-inc: runtime-go.lo Makefile
$(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp runtime.inc 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) $@ $(STAMP) $@
runtime_check_GOCFLAGS = -fgo-compiling-runtime runtime_check_GOCFLAGS = -fgo-compiling-runtime
runtime/check: $(CHECK_DEPS) runtime/check: $(CHECK_DEPS)
......
...@@ -3886,8 +3886,13 @@ runtime-go.lo.dep: $(srcdir)/go/runtime/*.go $(extra_go_files_runtime) ...@@ -3886,8 +3886,13 @@ runtime-go.lo.dep: $(srcdir)/go/runtime/*.go $(extra_go_files_runtime)
runtime-go.lo: runtime-go.lo:
$(BUILDPACKAGE) $(BUILDPACKAGE)
runtime.inc: s-runtime-inc; @true runtime.inc: s-runtime-inc; @true
s-runtime-inc: runtime-go.lo s-runtime-inc: runtime-go.lo Makefile
$(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp runtime.inc 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) $@ $(STAMP) $@
runtime/check: $(CHECK_DEPS) runtime/check: $(CHECK_DEPS)
@$(CHECK) @$(CHECK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment