https://bugzilla.redhat.com/show_bug.cgi?id=1253668

            Bug ID: 1253668
           Summary: Create cross build for windows amd64
           Product: Fedora
           Version: rawhide
         Component: golang
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected], [email protected],
                    [email protected]



Description of problem:
Some time need build binaries for windows on linux host. It would be very
convenient to do so could golang.

Version-Release number of selected component (if applicable):
golang-bin-1.5-0.11.rc1.el6.x86_64
golang-docs-1.5-0.11.rc1.el6.noarch
golang-src-1.5-0.11.rc1.el6.noarch
golang-1.5-0.11.rc1.el6.x86_64
golang-tests-1.5-0.11.rc1.el6.noarch
golang-misc-1.5-0.11.rc1.el6.noarch


How reproducible:
GOOS=windows GOARCH=amd64 go build

Steps to Reproduce:
1. install golang
2. GOOS=windows GOARCH=amd64 go build


Expected results:
The binaries for windows.

diff --git a/golang.spec b/golang.spec
index 8ea0170..2fdd3da 100644
--- a/golang.spec
+++ b/golang.spec
@@ -49,7 +49,7 @@ URL:            http://golang.org/
 Source0:       
https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz

 # go1.5 bootstrapping. The compiler is written in golang.
-BuildRequires:  golang > 1.4
+BuildRequires:  golang > 1.4 mingw64-gcc-c++ mingw64-gcc
 # use the arch dependent path in the bootstrap
 Patch212:       ./golang-1.5-bootstrap-binary-path.patch

@@ -236,6 +236,14 @@ CC_FOR_TARGET="gcc" \
 GOOS=linux \
 GOARCH=%{gohostarch} \
        ./make.bash --no-clean
+
+CFLAGS="$RPM_OPT_FLAGS" \
+LDFLAGS="$RPM_LD_FLAGS" \
+CC="gcc" \
+CC_FOR_TARGET="gcc" \
+GOOS=windows \
+GOARCH=amd64 \
+       ./make.bash --no-clean
 popd

 %install

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
golang mailing list
[email protected]
https://lists.fedoraproject.org/mailman/listinfo/golang

Reply via email to