I'd say gccgo does not support vendoring.

On Tue, 6 Jun 2017, 20:35 Joost Shao <joostshao1...@gmail.com> wrote:

>
>
> 在 2017年6月6日星期二 UTC+8下午6:35:23,Joost Shao写道:
>
>>
>>
>> 在 2017年6月6日星期二 UTC+8下午6:34:02,Joost Shao写道:
>>>
>>> thank you first, i have been stuck by gccgo-7.x for gopath and govendor
>>> many days.
>>>
>>> gopath is ok, like below.
>>>
>>> ubuntu@ubuntu-zesty:~/go/src/github.com/valyala$ tree
>>> .
>>> └── fasttemplate
>>>     ├── example_test.go
>>>     ├── LICENSE
>>>     ├── README.md
>>>     ├── template.go
>>>     ├── template_test.go
>>>     ├── template_timing_test.go
>>>     ├── unsafe_gae.go
>>>     ├── unsafe.go
>>>     └── vendor
>>>         └── github.com
>>>             └── valyala
>>>                 └── bytebufferpool
>>>                     ├── bytebuffer_example_test.go
>>>                     ├── bytebuffer.go
>>>                     ├── bytebuffer_test.go
>>>                     ├── bytebuffer_timing_test.go
>>>                     ├── doc.go
>>>                     ├── LICENSE
>>>                     ├── pool.go
>>>                     ├── pool_test.go
>>>                     └── README.md
>>>
>>> 5 directories, 17 files
>>>
>>>
>>>
>>> ubuntu@ubuntu-zesty:~$ go env
>>> GOARCH="amd64"
>>> GOBIN=""
>>> GOEXE=""
>>> GOHOSTARCH="amd64"
>>> GOHOSTOS="linux"
>>> GOOS="linux"
>>> GOPATH="/home/ubuntu/go"
>>> GORACE=""
>>> GOROOT="/usr/lib/go-1.7"
>>> GOTOOLDIR="/usr/lib/go-1.7/pkg/tool/linux_amd64"
>>> CC="gcc"
>>> GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0
>>> -fdebug-prefix-map=/tmp/go-build060029979=/tmp/go-build
>>> -gno-record-gcc-switches"
>>> CXX="g++"
>>> CGO_ENABLED="1"
>>>
>>>
>>> content of main.go
>>> ubuntu@ubuntu-zesty:~$ cat server.go
>>> package main
>>>
>>> import (
>>> "net/http"
>>> "github.com/labstack/echo"
>>> )
>>>
>>> func main() {
>>> e := echo.New()
>>> e.GET("/", func(c echo.Context) error {
>>> return c.String(http.StatusOK, "Hello, World!")
>>> })
>>> e.Logger.Fatal(e.Start(":1323"))
>>> }
>>>
>>> by gc compile , the result is OK.
>>> ubuntu@ubuntu-zesty:~$ go build -x -compiler gc server.go
>>> WORK=/tmp/go-build058937444
>>> mkdir -p $WORK/command-line-arguments/_obj/
>>> mkdir -p $WORK/command-line-arguments/_obj/exe/
>>> cd /home/ubuntu
>>> /usr/lib/go-1.7/pkg/tool/linux_amd64/compile -o
>>> $WORK/command-line-arguments.a -trimpath $WORK -p main -complete -buildid
>>> 10569227a53a83251f5b0ba912d076c91ac34779 -D _/home/ubuntu -I $WORK -I
>>> ./go/pkg/linux_amd64 -pack ./server.go
>>> cd .
>>> /usr/lib/go-1.7/pkg/tool/linux_amd64/link -o
>>> $WORK/command-line-arguments/_obj/exe/a.out -L $WORK -L
>>> /home/ubuntu/go/pkg/linux_amd64 -extld=gcc -buildmode=exe
>>> -buildid=10569227a53a83251f5b0ba912d076c91ac34779
>>> $WORK/command-line-arguments.a
>>> mv $WORK/command-line-arguments/_obj/exe/a.out server
>>>
>>> but by gccgo-7.0
>>> ubuntu@ubuntu-zesty:~$ go build -x -compiler gccgo server.go
>>> WORK=/tmp/go-build118667055
>>> mkdir -p $WORK/github.com/mattn/go-isatty/_obj/
>>> mkdir -p $WORK/github.com/mattn/
>>> cd /home/ubuntu/go/src/github.com/mattn/go-isatty
>>> /usr/bin/gccgo -I $WORK -c -g -m64 -fgo-pkgpath=
>>> github.com/mattn/go-isatty
>>> -fgo-relative-import-path=_/home/ubuntu/go/src/
>>> github.com/mattn/go-isatty -o $WORK/
>>> github.com/mattn/go-isatty/_obj/_go_.o ./doc.go ./isatty_linux.go
>>> ./isatty_others.go
>>> mkdir -p $WORK/github.com/mattn/go-colorable/_obj/
>>> cd /home/ubuntu/go/src/github.com/mattn/go-colorable
>>> /usr/bin/gccgo -I $WORK -c -g -m64 -fgo-pkgpath=
>>> github.com/mattn/go-colorable
>>> -fgo-relative-import-path=_/home/ubuntu/go/src/
>>> github.com/mattn/go-colorable -o $WORK/
>>> github.com/mattn/go-colorable/_obj/_go_.o ./colorable_others.go
>>> ./noncolorable.go
>>> ar rc $WORK/github.com/mattn/libgo-colorable.a $WORK/
>>> github.com/mattn/go-colorable/_obj/_go_.o
>>> mkdir -p $WORK/
>>> github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/_obj/
>>> mkdir -p $WORK/
>>> github.com/valyala/fasttemplate/vendor/github.com/valyala/
>>> cd /home/ubuntu/go/src/
>>> github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool
>>> /usr/bin/gccgo -I $WORK -c -g -m64 -fgo-pkgpath=
>>> github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool
>>> -fgo-relative-import-path=_/home/ubuntu/go/src/
>>> github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool
>>> -o $WORK/
>>> github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/_obj/_go_.o
>>> ./bytebuffer.go ./doc.go ./pool.go
>>> cd /home/ubuntu/go/src/github.com/mattn/go-isatty
>>> ar rc $WORK/github.com/mattn/libgo-isatty.a $WORK/
>>> github.com/mattn/go-isatty/_obj/_go_.o
>>> mkdir -p $WORK/github.com/labstack/gommon/color/_obj/
>>> mkdir -p $WORK/github.com/labstack/gommon/
>>> cd /home/ubuntu/go/src/github.com/labstack/gommon/color
>>> /usr/bin/gccgo -I $WORK -I /home/ubuntu/go/pkg/gccgo_linux_amd64 -c -g
>>> -m64 -fgo-pkgpath=github.com/labstack/gommon/color
>>> -fgo-relative-import-path=_/home/ubuntu/go/src/
>>> github.com/labstack/gommon/color -o $WORK/
>>> github.com/labstack/gommon/color/_obj/_go_.o ./color.go
>>> cd /home/ubuntu/go/src/
>>> github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool
>>> ar rc $WORK/
>>> github.com/valyala/fasttemplate/vendor/github.com/valyala/libbytebufferpool.a
>>> $WORK/
>>> github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/_obj/_go_.o
>>> mkdir -p $WORK/github.com/valyala/fasttemplate/_obj/
>>> mkdir -p $WORK/github.com/valyala/
>>> cd /home/ubuntu/go/src/github.com/valyala/fasttemplate
>>> /usr/bin/gccgo -I $WORK -I /home/ubuntu/go/pkg/gccgo_linux_amd64 -c -g
>>> -m64 -fgo-pkgpath=github.com/valyala/fasttemplate
>>> -fgo-relative-import-path=_/home/ubuntu/go/src/
>>> github.com/valyala/fasttemplate -o $WORK/
>>> github.com/valyala/fasttemplate/_obj/_go_.o ./template.go ./unsafe.go
>>> # github.com/valyala/fasttemplate
>>> go/src/github.com/valyala/fasttemplate/template.go:12:35: error: import
>>> file ‘github.com/valyala/bytebufferpool’ not found
>>>   "github.com/valyala/bytebufferpool"
>>>                                    ^
>>> go/src/github.com/valyala/fasttemplate/template.go:99:34: error:
>>> expected package
>>>  var byteBufferPool bytebufferpool.Pool
>>>                                   ^
>>> go/src/github.com/valyala/fasttemplate/template.go:124:31: error:
>>> expected package
>>>   byteBufferPool bytebufferpool.Pool
>>>                                ^
>>> go/src/github.com/valyala/fasttemplate/template.go:140:2: error: return
>>> with value in function with no return type
>>>   return t
>>>   ^
>>> go/src/github.com/valyala/fasttemplate/template.go:152:3: error: return
>>> with value in function with no return type
>>>    return nil, err
>>>    ^
>>> go/src/github.com/valyala/fasttemplate/template.go:154:2: error: return
>>> with value in function with no return type
>>>   return &t, nil
>>>   ^
>>> go/src/github.com/valyala/fasttemplate/template.go:267:2: error: not
>>> enough arguments to return
>>>   return t.ExecuteFunc(w, func(w io.Writer, tag string) (int, error) {
>>> return stdTagFunc(w, tag, m) })
>>>   ^
>>> mkdir -p $WORK/golang.org/x/crypto/acme/_obj/
>>> mkdir -p $WORK/golang.org/x/crypto/
>>> cd /home/ubuntu/go/src/golang.org/x/crypto/acme
>>> /usr/bin/gccgo -I $WORK -c -g -m64 -fgo-pkgpath=golang.org/x/crypto/acme
>>> -fgo-relative-import-path=_/home/ubuntu/go/src/golang.org/x/crypto/acme
>>> -o $WORK/golang.org/x/crypto/acme/_obj/_go_.o ./acme.go ./jws.go
>>> ./types.go
>>> cd /home/ubuntu/go/src/github.com/labstack/gommon/color
>>> ar rc $WORK/github.com/labstack/gommon/libcolor.a $WORK/
>>> github.com/labstack/gommon/color/_obj/_go_.o
>>> cd /home/ubuntu/go/src/golang.org/x/crypto/acme
>>> ar rc $WORK/golang.org/x/crypto/libacme.a $WORK/
>>> golang.org/x/crypto/acme/_obj/_go_.o
>>> mkdir -p $WORK/golang.org/x/crypto/acme/autocert/_obj/
>>> mkdir -p $WORK/golang.org/x/crypto/acme/
>>> cd /home/ubuntu/go/src/golang.org/x/crypto/acme/autocert
>>> /usr/bin/gccgo -I $WORK -I /home/ubuntu/go/pkg/gccgo_linux_amd64 -c -g
>>> -m64 -fgo-pkgpath=golang.org/x/crypto/acme/autocert
>>> -fgo-relative-import-path=_/home/ubuntu/go/src/
>>> golang.org/x/crypto/acme/autocert -o $WORK/
>>> golang.org/x/crypto/acme/autocert/_obj/_go_.o ./autocert.go ./cache.go
>>> ./listener.go ./renewal.go
>>> ar rc $WORK/golang.org/x/crypto/acme/libautocert.a $WORK/
>>> golang.org/x/crypto/acme/autocert/_obj/_go_.o
>>>
>>> which confused me is what is "gccgo_linux_amd64" directory, i install
>>> gccgo-7.x with ubuntu ppa, i confused.
>>>
>>> 在 2017年6月6日星期二 UTC+8下午3:28:37,Dave Cheney写道:
>>>>
>>>> Does the missing package exist in your gopath?
>>>>
>>>> On Tue, 6 Jun 2017, 17:24 Joost Shao <joosts...@gmail.com> wrote:
>>>>
>>>>> what about now ? i used gccgo-7 to compile framework echo, but failed .
>>>>>
>>>>> error is blow:
>>>>>
>>>>> ubuntu@ubuntu-zesty:~$ gccgo-7 -v
>>>>> Using built-in specs.
>>>>> COLLECT_GCC=gccgo-7
>>>>> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
>>>>> OFFLOAD_TARGET_NAMES=nvptx-none
>>>>> OFFLOAD_TARGET_DEFAULT=1
>>>>> Target: x86_64-linux-gnu
>>>>> Configured with: ../src/configure -v --with-pkgversion='Ubuntu
>>>>> 7-20170407-0ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs
>>>>> --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
>>>>> --with-gcc-major-version-only --program-suffix=-7
>>>>> --program-prefix=x86_64-linux-gnu- --enable-shared 
>>>>> --enable-linker-build-id
>>>>> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
>>>>> --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
>>>>> --enable-libstdcxx-debug --enable-libstdcxx-time=yes
>>>>> --with-default-libstdcxx-abi=new --enable-gnu-unique-object
>>>>> --disable-vtable-verify --enable-libmpx --enable-plugin
>>>>> --enable-default-pie --with-system-zlib --with-target-system-zlib
>>>>> --enable-objc-gc=auto --enable-multiarch --disable-werror
>>>>> --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
>>>>> --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none
>>>>> --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
>>>>> --host=x86_64-linux-gnu --target=x86_64-linux-gnu
>>>>> Thread model: posix
>>>>> gcc version 7.0.1 20170407 (experimental) [trunk revision 246759]
>>>>> (Ubuntu 7-20170407-0ubuntu2)
>>>>>
>>>>>
>>>>> ubuntu@ubuntu-zesty:~$ go build -compiler gccgo  server.go
>>>>> # github.com/valyala/fasttemplate
>>>>> go/src/github.com/valyala/fasttemplate/template.go:12:35: error:
>>>>> import file ‘github.com/valyala/bytebufferpool’ not found
>>>>>   "github.com/valyala/bytebufferpool"
>>>>>                                    ^
>>>>> go/src/github.com/valyala/fasttemplate/template.go:99:34: error:
>>>>> expected package
>>>>>  var byteBufferPool bytebufferpool.Pool
>>>>>                                   ^
>>>>> go/src/github.com/valyala/fasttemplate/template.go:124:31: error:
>>>>> expected package
>>>>>   byteBufferPool bytebufferpool.Pool
>>>>>                                ^
>>>>> go/src/github.com/valyala/fasttemplate/template.go:140:2: error:
>>>>> return with value in function with no return type
>>>>>   return t
>>>>>   ^
>>>>> go/src/github.com/valyala/fasttemplate/template.go:152:3: error:
>>>>> return with value in function with no return type
>>>>>    return nil, err
>>>>>    ^
>>>>> go/src/github.com/valyala/fasttemplate/template.go:154:2: error:
>>>>> return with value in function with no return type
>>>>>   return &t, nil
>>>>>   ^
>>>>> go/src/github.com/valyala/fasttemplate/template.go:267:2: error: not
>>>>> enough arguments to return
>>>>>   return t.ExecuteFunc(w, func(w io.Writer, tag string) (int, error) {
>>>>> return stdTagFunc(w, tag, m) })
>>>>>   ^
>>>>>
>>>>>
>>>>> it seems not support import third party package.
>>>>>
>>>>> anyone can help me ?
>>>>>
>>>>> 在 2015年12月11日星期五 UTC+8上午10:48:49,Zhongwei Yao写道:
>>>>>>
>>>>>> OK, I'll give a try to newer gccgo.
>>>>>>
>>>>>
>>>>>> On 11 December 2015 at 10:28, Dave Cheney <da...@cheney.net> wrote:
>>>>>>
>>>>>>> I think gccgo is well supported and benefits from the mature gcc
>>>>>>> toolchain, ubuntu is just shipping an out of date version.
>>>>>>>
>>>>>>> On Friday, 11 December 2015 13:17:12 UTC+11, Zhongwei Yao wrote:
>>>>>>>>
>>>>>>>> Hi, Dave, Thanks for your information! I've built and run several
>>>>>>>> programs by gc without any problem on arm64. Programs include benchmark
>>>>>>>> cases like build, garbage, http, json in golang.org/x/benchmark
>>>>>>>> package. The gc is built from recently master branch. And we also have
>>>>>>>> tried go 1.5.1 to run docker on arm64, it also works. If you want more
>>>>>>>> details, please tell me.
>>>>>>>>
>>>>>>>> What I want to do is comparing the performance between gccgo and
>>>>>>>> gc. BTW, I'm new to golang. And I don't know why the community is
>>>>>>>> supporting both gccgo and gc. Gccgo seems support a lot of 
>>>>>>>> architecture,
>>>>>>>> but it is not well supported in cases like my problem.
>>>>>>>>
>>>>>>>> On 10 December 2015 at 20:17, Dave Cheney <da...@cheney.net> wrote:
>>>>>>>>
>>>>>>>>> I believe gccgo 4.9 only implements the go 1.3 spec. sync.Pool was
>>>>>>>>> added in 1.4.
>>>>>>>>>
>>>>>>>>> You will have to compile a newer gccgo to.compile that program.
>>>>>>>>>
>>>>>>>>> BTW, did you know what go 1.5 and later support arm64 natively?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> Dave
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>> Groups "golang-nuts" group.
>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>> send an email to golang-nuts...@googlegroups.com.
>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Best regards,
>>>>>>>> Zhongwei
>>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "golang-nuts" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to golang-nuts...@googlegroups.com.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Best regards,
>>>>>> Zhongwei
>>>>>>
>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to