]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld: fix compilation when GOARCH != GOHOSTARCH
authorJan Ziak <0xe2.0x9a.0x9b@gmail.com>
Mon, 17 Sep 2012 21:18:21 +0000 (17:18 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 17 Sep 2012 21:18:21 +0000 (17:18 -0400)
R=rsc, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6493123

src/pkg/runtime/mgc0.c
src/pkg/runtime/runtime.h
src/pkg/runtime/typekind.h

index 147c78ad80e17d12da1131903d395f8da1dcb704..6dee9523bb0f7ca4990861c4bd2cb5804d8a23c9 100644 (file)
@@ -11,7 +11,6 @@
 
 enum {
        Debug = 0,
-       PtrSize = sizeof(void*),
        DebugMark = 0,  // run second pass to check mark
        DataBlock = 8*1024,
 
index c221e82c2917f5dab339f1aadcd45dd6cab7af6c..20fb8ddfe1e8eeb33015a2bf90a217e0fd3388ec 100644 (file)
@@ -118,6 +118,10 @@ enum
        true    = 1,
        false   = 0,
 };
+enum
+{
+       PtrSize = sizeof(void*),
+};
 
 /*
  * structures
index 8c58872e171a367a8d7fac1408de03e58fadaad0..97cb0a5a2dbc5f759fe269b0c5905edfed0a2bad 100644 (file)
@@ -2,6 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// PtrSize vs sizeof(void*): This file is also included from src/cmd/ld/...
+// which defines PtrSize to be different from sizeof(void*) when crosscompiling.
+
 enum {
        KindBool = 1,
        KindInt,
@@ -33,6 +36,6 @@ enum {
        KindNoPointers = 1<<7,
 
        // size of Type interface header + CommonType structure.
-       CommonSize = 2*sizeof(void*) + 6*sizeof(void*) + 8,
+       CommonSize = 2*PtrSize + 6*PtrSize + 8,
 };