Skip to content

Can't link to cgo packages in a package subdirectory after revision 4658 #560

Closed
@rsaarelm

Description

@rsaarelm
Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Patch the cgo stdio example with the following patch. It changes the
package path from "stdio" to "stdlib/stdio", putting the cgo package
in a
subdirectory.
2. In the stdio example dir, do "make hello"

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

It should compile. Instead, I get an error about the generated C function
names:

/home/rsaarelm/bin/8l -o hello hello.8
stdlib/stdio.Puts: undefined: stdlib/stdio._C_CString
stdlib/stdio.Puts: undefined: stdlib/stdio._C_puts
stdlib/stdio.Puts: undefined: stdlib/stdio._C_free
stdlib/stdio.Puts: undefined: stdlib/stdio._C_fflushstdout
make: *** [hello] Error 1

What is your $GOOS?  $GOARCH?

linux 386

Which revision are you using?  (hg identify)

b7185292b7c5+ tip

Please provide any additional information below.

Attachments:

  1. subdir.diff (585 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions