Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 Aug 2017 05:45:28 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 221297] Crossbuidling of lang/go explicitly requires CGO_ENABLED=1
Message-ID:  <bug-221297-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221297

            Bug ID: 221297
           Summary: Crossbuidling of lang/go explicitly requires
                    CGO_ENABLED=3D1
           Product: Ports & Packages
           Version: Latest
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: jlaffaye@FreeBSD.org
          Reporter: tagattie@yandex.com
                CC: freebsd-arm@FreeBSD.org
          Assignee: jlaffaye@FreeBSD.org
                CC: freebsd-arm@FreeBSD.org
             Flags: maintainer-feedback?(jlaffaye@FreeBSD.org)

Created attachment 185109
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D185109&action=
=3Dedit
A patch for Makefile

Crossbuilding of lang/go (using Poudriere) ends up with the following error:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<phase=
: package        >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D>  Building package for go-1.8.3,1
pkg-static: Unable to access file
/wrkdirs/usr/ports/lang/go/work/stage/usr/loca
l/go/pkg/freebsd_arm/runtime/cgo.a:No such file or directory
*** Error code 1

According to the Go source code at
https://github.com/golang/go/blob/master/src/go/build/build.go#L307, "cgo m=
ust
be explicitly enabled for cross compilation builds".

I tried attached the patch and crossbuilding succeeded without an error.
(GOARM=3D7 is to cope with the bug #205820)

I'm not sure how I can know host arch of crossbuilding (target arch is
${ARCH}), so I just simply put the line there, which should be better only =
when
crossbuilding.

Thanks,
Hiroki Tagato

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-221297-13>