Re: [go-nuts] wrong ELF class error: How to compile 64 bit binary on Solaris 11 using gccgo

2018-10-01 Thread amandeep
mpiled, > helloworld.go > > with the following options and it compiled a 64 bit exectable: > > > > CC=/home/amandeep/workspace/mygcc.sh > > GCCGO=/home/amandeep/workspace/mygccgo.sh CGO_CFLAGS='-m64' > > CGO_LDFLAGS='-m64' GOARCH=sparc64 CGO_ENABLED=1 go build

Re: [go-nuts] wrong ELF class error: How to compile 64 bit binary on Solaris 11 using gccgo

2018-09-28 Thread amandeep
Hi Ian, Setting GCCGO env variable helped. I basically compiled, helloworld.go with the following options and it compiled a 64 bit exectable: CC=/home/amandeep/workspace/mygcc.sh GCCGO=/home/amandeep/workspace/mygccgo.sh CGO_CFLAGS='-m64' CGO_LDFLAGS='-m64' GOARCH=sparc64 CGO_ENABLED=1 go

Re: [go-nuts] wrong ELF class error: How to compile 64 bit binary on Solaris 11 using gccgo

2018-09-28 Thread amandeep
Actually, I now understand what you meant. And even that does not work: amandeep@s113ldom1:/opt/go_pkgs/src/github.com/golang/glog$ sudo GOPATH=/opt/go_pkgs CC='/home/amandeep/workspace/mygcc.sh' CGO_CFLAGS='-m64' CGO_LDFLAGS='-m64' GOARCH=sparc64 CGO_ENABLED=1 go install -x -gccgoflags=-m64

Re: [go-nuts] wrong ELF class error: How to compile 64 bit binary on Solaris 11 using gccgo

2018-09-28 Thread amandeep
for _buildid.o but even after that running ar rcD $WORK/b001/_pkg_.a $WORK/b001/_go_.o $WORK/b001/_buildid.o produces a 32-bit archive. Also, running buildid gives some error about 32 byte hash. Please see: amandeep@s113ldom1:~/workspace$ /usr/gnu/libexec/gcc/sparc-sun-solaris2.11/8.2.1/buildid -w

Re: [go-nuts] wrong ELF class error: How to compile 64 bit binary on Solaris 11 using gccgo

2018-09-28 Thread amandeep
nopes...doesn't work either. I tried both variations...with and without GOARCH=sparc64 flag. Following is the output with sparc64 flag: amandeep@s113ldom1:/opt/go_pkgs/src/github.com/golang/glog$ sudo GOPATH=/opt/go_pkgs CC='gcc -m64' CGO_CFLAGS='-m64' CGO_LDFLAGS='-m64' GOARCH=sparc64

Re: [go-nuts] wrong ELF class error: How to compile 64 bit binary on Solaris 11 using gccgo

2018-09-28 Thread amandeep
Seems like even that does not seem to work. Please see: amandeep@s113ldom1:/opt/go_pkgs/src/github.com/golang/glog$ sudo GOPATH=/opt/go_pkgs CGO_CFLAGS='-m64' CGO_LDFLAGS='-m64' go install -x -gccgoflags=-m64 WORK=/tmp/go-build357879094 mkdir -p $WORK/b001/ cd $WORK /usr/gnu/bin/gccgo -fgo

[go-nuts] wrong ELF class error: How to compile 64 bit binary on Solaris 11 using gccgo

2018-09-27 Thread Amandeep Gautam
Hi, I am trying to compile a 64bit executable using gccgo on Solaris 11/10. Following is what I have tried: CGO_LDFLAGS='-m64' go build hello_world.go GOARCH=sparc64 CGO_LDFLAGS='-m64' go build hello_world.go Below is the output of the first command: amandeep@s113ldom1:~/workspace

Re: [go-nuts] call of non-function C.testc

2018-09-24 Thread amandeep
Hello Ian, Since you mention about 32-bit SPARC, I did a little testing. It seems that gccgo is compiling 32-bit binary by default: -bash-4.3$ go build abcd.go -bash-4.3$ file abcd abcd: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped

Re: [go-nuts] call of non-function C.testc

2018-09-24 Thread amandeep
gt; The decoding of unwind sections for machine type Sparc is not > currently > >> > supported. > >> > > >> > Symbol table '.symtab' contains 18 entries: > >> >Num:Value Size TypeBind Vis Ndx Name > >> >

Re: [go-nuts] call of non-function C.testc

2018-09-18 Thread amandeep
12: 0 SECTION LOCAL DEFAULT 16 > > 13: 20 FUNCGLOBAL DEFAULT1 testc > > 14: 0 NOTYPE GLOBAL DEFAULT UND printf > > 15: 000016 OBJECT GLOBAL DEFAULT3 __cgodebug_floats > > 16: 0010

Re: [go-nuts] call of non-function C.testc

2018-09-14 Thread amandeep
0180814 -mcpu=v9 -gdwarf-2 -g -O2 <10> DW_AT_language: 12 (ANSI C99) <11> DW_AT_comp_dir: (indirect string, offset: 0x10b): /export/home/amandeep <15> DW_AT_low_pc : 0x0 <19> DW_AT_high_pc : 0x14 <1d>

Re: [go-nuts] call of non-function C.testc

2018-09-14 Thread amandeep
It would be the same. Please see below. -bash-3.2$ gcc --version gcc (GCC) 8.2.1 20180814 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. On

Re: [go-nuts] call of non-function C.testc

2018-09-14 Thread amandeep
WORK=/tmp/go-build151901300 mkdir -p $WORK/b001/ cd $WORK /usr/gnu/bin/gccgo -fsplit-stack -c -x c - || true cd /export/home/amandeep CGO_LDFLAGS='"-g" "-O2"' /usr/gnu/libexec/gcc/sparc-sun-solaris2.10/8.2.1/cgo -objdir $WORK/b001/ -imp

[go-nuts] call of non-function C.testc

2018-09-13 Thread amandeep
t;sparc" GOBIN="" GOCACHE="/export/home/amandeep/.cache/go-build" GOEXE="" GOHOSTARCH="sparc" GOHOSTOS="solaris" GOOS="solaris" GOPATH="/export/home/amandeep/go" GORACE="" GOROOT="/usr/gnu" GOTMPDIR=&quo

Re: [go-nuts] internal compilation error while compiling gccgo from source solaris 10

2018-08-27 Thread Amandeep Gautam
to /opt/csw/lib/libmpc.so.3 and that is how it was reaching to the buggy libmpfr. I changed the symlink for mpc/mpfr/gmp libs to point to the libs I have installed and it worked. On Saturday, August 25, 2018 at 10:25:39 AM UTC-7, Ian Lance Taylor wrote: > > On Fri, Aug 24, 2018 at 11:48 PM, Am

Re: [go-nuts] internal compilation error while compiling gccgo from source solaris 10

2018-08-25 Thread Amandeep Gautam
libmpfr.so.4 from the /opt/csw directory. I am guessing that I am not configuring something correctly. Can you please look. Output from GBD: -bash-3.2$ gdb /export/home/amandeep/gccgo-obj/./gcc/go1 GNU gdb (GDB) 7.7 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3

Re: [go-nuts] internal compilation error while compiling gccgo from source solaris 10

2018-08-23 Thread Amandeep Gautam
Running inside the gdb worked. Seems like a problem with libmpfr. Will try compiling it from source. Following is the end of the GDB output: /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go:658:43: error: expected integer, floating, complex, or string type s.errorString("integer ove

Re: [go-nuts] internal compilation error while compiling gccgo from source solaris 10

2018-08-23 Thread Amandeep Gautam
Thanks. I did do that befor but thought you meant different. I ran the following: /export/home/amandeep/gccgo-obj/./gcc/gccgo -B/export/home/amandeep/gccgo-obj/./gcc/ -B/usr/gnu/sparc-sun-solaris2.10/bin/ -B/usr/gnu/sparc-sun-solaris2.10/lib/ -isystem /usr/gnu/sparc-sun-solaris2.10/include

Re: [go-nuts] internal compilation error while compiling gccgo from source solaris 10

2018-08-23 Thread Amandeep Gautam
Hi Ian, I ran the following after changing directory to /export/home/amandeep/gccgo-obj/sparc-sun-solaris2.10/libgo/: files=`echo /export/home/amandeep/gccgo-src/libgo/go/fmt/doc.go /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go /export/home/amandeep/gccgo-src/libgo/go/fmt/print.go

[go-nuts] internal compilation error while compiling gccgo from source solaris 10

2018-08-19 Thread Amandeep Gautam
I have been trying to install GCCGO on Solaris 10 with the following script: dir=/export/home/amandeep srcdir=$dir/gccgo-src objdir=$dir/gccgo-obj prefix=/usr/gnu # Create Directory mkdir -p $objdir sudo mkdir -p $prefix # Exports export PATH=/opt/csw/bin:/usr/sbin:$PATH:/usr/sfw/bin:/usr

[go-nuts] unrecognized import paths error while using go get

2018-08-14 Thread Amandeep Gautam
Hi, I installed gccgo on Solaris 11.3 using: sudo /opt/csw/bin/pkgutil -y -i gcc5core Below is the output of go-5.5 env: amandeep@s113ldom1:~$ go-5.5 env GOARCH="sparc" GOBIN="" GOCHAR="" GOEXE="" GOHOSTARCH="sparc" GOHOSTOS="solaris&qu

Re: [go-nuts] Html is not parsing while parsing a template to send email

2018-05-04 Thread Amandeep Kaur
you may be using the word "parse" > in the opposite of it its common meaning. However, if you want to pass a > HTML fragment through a HTML template and have it not be escaped, look at > the template.HTML type: https://golang.org/pkg/html/template/#HTML > > //jb > >

[go-nuts] Html is not parsing while parsing a template to send email

2018-05-04 Thread Amandeep Kaur
Hello, I am working on a SAAS based project for which I need to send emails to different clients on different events. I am using email templates which use tokens (in format {{.TOKENNAME}}) that are made dynamic while sending emails. Now these token are parsed by using "html/template"

[go-nuts] Pdeathsig alternate for other operating systems

2018-02-12 Thread Amandeep Gautam
I am writing a process monitoring solution in go for AIX. I would like to signal the child process when the parent dies so that it does not become orphaned. In linux, one can set PdeathSig (https://golang.org/pkg/syscall/#SysProcAttr) and Go will take care of the rest. However this attribute

[go-nuts] Email sent via command line is not delivered in Golang

2018-01-24 Thread Amandeep Kaur
I am sending emails in one of my projects through command line. The project back end is written in Golang. I am using following code to send emails: package utils import( "bytes" "html/template" "os/exec" "fmt" ) type EmailRequest struct{

[go-nuts] Is there an equivalent of telldir in go. If not what are the alternatives?

2018-01-10 Thread Amandeep Gautam
Is there a equivalent of telldir in golang which can page reading of a directory. Just using filepath.walk would be inefficient for large file systems. >From one of the answers to this question https://stackoverflow.com/questions/39583522/how-do-i-use-seekdir-telldir-in-golang it looks like

[go-nuts] Client and server stub not generated for grpc-go

2018-01-04 Thread Amandeep Gautam
I am trying to write a grpc server in go but am unable get the generated client and server stub in the file generated by plugin. Here is the paste of the file generated: https://pastebin.com/kfi99MxK >From what I have researched, it is because of faulty protobuf installation but I am not sure

Re: [go-nuts] gRPC go on AIX

2017-12-21 Thread Amandeep Gautam
I am using precompiled binaries for AIX. But will keep your suggestion in mind. For now it was fixed by installing ca certificates. On Thursday, December 21, 2017 at 3:12:50 PM UTC-8, Ian Lance Taylor wrote: > > On Thu, Dec 21, 2017 at 1:43 PM, > wrote: > > > >

[go-nuts] Re: Update Mongodb fields with omitempty flag in Golang structure

2017-11-10 Thread Amandeep Kaur
ol `json:"single_use_per_user,omitempty" > bson:"single_use_per_user,omitempty"` > } > > > the bson/json Un/marshaller will then omit the values that are nil > pointers, so now yo ucan tell the difference between a false checkbox, and > a REST POST that d

[go-nuts] Update Mongodb fields with omitempty flag in Golang structure

2017-11-07 Thread Amandeep Kaur
Hi I am working on a Coupon form in which I have some optional fields. *Introduction:* All the form field values are received as JSON and mapped into a Golang structure. In the structure, I have added an "omitempty" flag with every field. So only those form values are mapped which have