<p dir="auto">by <strong>Ostsol</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?

Given the following files, compile and link with the following steps.

// p.go
package p

type T int

// main.go
package main

import "fmt"
import "./p"

func main () {
    i := p.T (1);
    fmt.Printf ("%v\n", i)
}

6g p.go
6g main.go
6l main.6

What is the expected output? What do you see instead?

Based on the discussion on the golang-nuts group:

<a href="http://groups.google.com/group/golang-nuts/tree/browse_frm/" rel="nofollow">http://groups.google.com/group/golang-nuts/tree/browse_frm/</a>
thread/66466cc48d4a3ce1/51028e84ef8e345f?rnum=1&amp;_done=%2Fgroup%2Fgolang-
nuts%2Fbrowse_frm%2Fthread%2F66466cc48d4a3ce1%2Fe1e40ca5389faf1a
%3F#doc_797953fae50b1017

. . . this should compile and link successfully.  Compilation does in fact 
occur without error, however, linking results in many 
'MHeapMap_Preallocate: multiple initialization' errors.

What is your $GOOS?  $GOARCH?

linux amd64

Which revision are you using?  (hg identify)

bdfc3faa253a tip

Please provide any additional information below.

One might decide to use gopack to produce p.a given main.6 and p.6 from 
the previous steps.

gopack grc p.a p.6
6l main.6

This produces similar errors to the above.  It appears that without p.a 
already produces, 6g had compiled main.go in a manner incompatible with 
p.a.  Recompiling main.go will allow successful linking.</pre>
<p dir="auto">by <strong>beoran</strong>:</p>
<pre class="notranslate">This bug report is due to the discussion at:

<a href="http://groups.google.com/group/golang-nuts/browse_thread/thread/34d6a5b928242d25" rel="nofollow">http://groups.google.com/group/golang-nuts/browse_thread/thread/34d6a5b928242d25</a>

What steps will reproduce the problem?
1. Write a .go file for cgo with a syntax error in some line 
2. Compile using the standard makefile 

What is the expected output?

The error message refers to the right line number.

What do you see instead?
The error message may refer to the wrong line number.

What is your $GOOS?  $GOARCH?
Linux 386

Which revision are you using?  (hg identify)
f776656df34c+ release.2010-06-09/release

Please provide any additional information below.

This is kind of annoying since it makes it hard to find back the syntax error. In the
discussion it was stated that this should be solved using a //line comment that corrects
the line number. It would be nice if this could be fixed. :)</pre>