Skip to content

cmd/cgo: ignores arguments in $CC #14551

Closed
@hirochachacha

Description

@hirochachacha

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version devel +ff27421 Sun Feb 28 11:06:40 2016 +0000 darwin/amd64
  2. What operating system and processor architecture are you using (go env)?
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/hiro/.go"
    GORACE=""
    GOROOT="/Users/hiro/work/go"
    GOTOOLDIR="/Users/hiro/work/go/pkg/tool/darwin_amd64"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"
    CXX="clang++"
    CGO_ENABLED="1"
  3. What did you do?
    (Use play.golang.org to provide a runnable example, if possible.)

$ CC="$(xcrun --sdk iphoneos --find clang) -arch armv7 -isysroot $(xcrun --sdk iphoneos --show-sdk-path)" GOARCH=arm go tool cgo -godefs input.go

input.go

package p

/*
typedef void * ptr;
*/
import "C"

type Ptr C.ptr
  1. What did you expect to see?
    No errors.
  2. What did you see instead?
unexpected: 8-byte pointer type - *void

XCode 7.2.1 (latest)

$(xcrun --sdk iphoneos --find clang) --version

Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.3.0
Thread model: posix

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions