Re: [go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-10 Thread Ian Lance Taylor
On Mon, Jun 10, 2019 at 7:44 AM Nitish Saboo  wrote:
>
> Does the successful compilation makes sure that the Go code is properly 
> linked to the C header files ?

I'm sorry, I don't know how to answer that question.

Does your program run as expected?

The `ldd` program will show the set of dynamic libraries loaded at
program startup time.

Ian



> On Sat, Jun 8, 2019 at 12:21 PM Nitish Saboo  wrote:
>>
>> Hi Ian,
>>
>> So I observed a very strange thing.If I leave it out completely then also 
>> the project gets compiled.
>> I thought that linker file is binding my Go code to the C code.Why am I not 
>> getting any error ?
>> How the Go code is then getting linked to the C code ?
>>
>> Compiled Succesfully
>> ---
>>
>> gcc -L/usr/local/lib -lsyslog-ng -o syslog-node.so 
>> -L/usr/local/lib/syslog-ng -ldbparser -c `pkg-config --libs --cflags 
>> glib-2.0` -I/usr/local/include/syslog-ng/ -I./lib/syslog-ng-3.6.2/ -I. 
>> -I/usr/local/include/eventlog/ ./lib/syslog-node.c
>> go build -v -x main.go
>> WORK=/tmp/go-build054960160
>> mkdir -p $WORK/b001/
>> cat >$WORK/b001/importcfg.link << 'EOF' # internal
>> packagefile 
>> command-line-arguments=/home/nsaboo/.cache/go-build/5d/5db621e46792693a43911a7fc99e450f7198b1a62956677a4a47f7f1a8ebc0b2-d
>> packagefile 
>> PAS/Godeps/_workspace/src/ghe.eng.fireeye.com/helix/tapgo.git=/home/nsaboo/.cache/go-build/25/255a89666be841631d45f43b7b900a38971218b4e53d88bab29a6f89de1fa2a5-d
>> packagefile 
>> PAS/Godeps/_workspace/src/github.com/Sirupsen/logrus=/home/nsaboo/.cache/go-build/ac/ac0b35d28e0801df885605564391f3b660cb2d1212b0c4df659e5e89d5bb7ed6-d
>> packagefile 
>> PAS/aws=/home/nsaboo/.cache/go-build/c1/c1b4eb19b03247ff0e834c9e652dd9024af2f74c4f817cbf8b8b577d4be8d608-d
>> packagefile 
>> PAS/config=/home/nsaboo/.cache/go-build/1b/1b9780455e160d33364e0c69669e8d4999562c4a6180d5e21f3ce8bfee470046-d
>> packagefile time=/usr/local/go/pkg/linux_amd64/time.a
>> packagefile runtime=/usr/local/go/pkg/linux_amd64/runtime.a
>> packagefile encoding/json=/usr/local/go/pkg/linux_amd64/encoding/json.a
>> packagefile fmt=/usr/local/go/pkg/linux_amd64/fmt.a
>> packagefile 
>> github.com/Sirupsen/logrus=/home/nsaboo/.cache/go-build/89/8914c444f75bb96cc629fec71f0db3864f1b5f6ec0cfdcd959eb5459b497953d-d
>> packagefile 
>> github.com/garyburd/redigo/redis=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/garyburd/redigo/redis.a
>> packagefile 
>> github.com/quipo/statsd=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/quipo/statsd.a
>> packagefile 
>> github.com/stretchr/testify/mock=/home/nsaboo/.cache/go-build/4d/4d2b87d8985068509cec6f143bbc904330303f9fa1e89e5981c47468a84d6a6d-d
>> packagefile 
>> github.com/xeipuuv/gojsonschema=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/xeipuuv/gojsonschema.a
>> packagefile io/ioutil=/usr/local/go/pkg/linux_amd64/io/ioutil.a
>> packagefile os=/usr/local/go/pkg/linux_amd64/os.a
>> packagefile strconv=/usr/local/go/pkg/linux_amd64/strconv.a
>> packagefile strings=/usr/local/go/pkg/linux_amd64/strings.a
>> packagefile bufio=/usr/local/go/pkg/linux_amd64/bufio.a
>> packagefile bytes=/usr/local/go/pkg/linux_amd64/bytes.a
>> packagefile io=/usr/local/go/pkg/linux_amd64/io.a
>> packagefile log=/usr/local/go/pkg/linux_amd64/log.a
>> packagefile sort=/usr/local/go/pkg/linux_amd64/sort.a
>> packagefile sync=/usr/local/go/pkg/linux_amd64/sync.a
>> packagefile syscall=/usr/local/go/pkg/linux_amd64/syscall.a
>> packagefile 
>> PAS/Godeps/_workspace/src/github.com/nu7hatch/gouuid=/home/nsaboo/.cache/go-build/36/36d9f2d9bb47cb906a96fbff8ef49774a2ed2909c1dd828540ebea88c5b66375-d
>> packagefile 
>> PAS/constants=/home/nsaboo/.cache/go-build/9f/9f64de8861eeb80afe7d44fe64f90a63917210b38d88150f61941db84d1281a0-d
>> packagefile 
>> PAS/lib=/home/nsaboo/.cache/go-build/f5/f548701c9d2403fdd2c4a5cb630b2fd2b98ddeafc512290f318a298d0d7cf382-d
>> packagefile 
>> PAS/models=/home/nsaboo/.cache/go-build/6a/6a5b8ed822a9cda39e0482e171d3d45f54cceab20e5a8d35dc78ab1a5a6c8677-d
>> packagefile compress/zlib=/usr/local/go/pkg/linux_amd64/compress/zlib.a
>> packagefile errors=/usr/local/go/pkg/linux_amd64/errors.a
>> packagefile 
>> github.com/aws/aws-sdk-go/aws=/home/nsaboo/.cache/go-build/09/097a3abd3003faf1b8b1063ff6b83c9ea7b621b7f24d07dd97f38988567eb838-d
>> packagefile 
>> github.com/aws/aws-sdk-go/aws/session=/home/nsaboo/.cache/go-build/cd/cd9b89755b069cb1766be47dd648b4571f2738a81ebfb061286a77d23e38b909-d
>> packagefile 
>> github.com/aws/aws-sdk-go/service/s3=/home/nsaboo/.cache/go-build/a0/a0b4f9349013d85866b327cc613509c58702c1eb901f56fca00a5f1897869622-d
>> packagefile 
>> github.com/aws/aws-sdk-go/service/s3/s3manager=/home/nsaboo/.cache/go-build/2d/2d98542103b3ef7dc46e7f4836bf4af8254b3b148917ea8b06d44cf15f19339d-d
>> packagefile 
>> github.com/aws/aws-sdk-go/service/sqs=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/aws/aws-sdk-go/service/sqs.a
>> packagefile 

Re: [go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-10 Thread Nitish Saboo
Hi Ian

On Sat, Jun 8, 2019 at 12:21 PM Nitish Saboo 
wrote:

> Hi Ian,
>
> So I observed a very strange thing.If I leave it out completely then also
> the project gets compiled.
> I thought that linker file is binding my Go code to the C code.Why am I
> not getting any error ?
> How the Go code is then getting linked to the C code ?
>
> Compiled Succesfully
> ---
>
> gcc -L/usr/local/lib -lsyslog-ng -o syslog-node.so
> -L/usr/local/lib/syslog-ng -ldbparser -c `pkg-config --libs --cflags
> glib-2.0` -I/usr/local/include/syslog-ng/ -I./lib/syslog-ng-3.6.2/ -I.
> -I/usr/local/include/eventlog/ ./lib/syslog-node.c
> go build -v -x main.go
> WORK=/tmp/go-build054960160
> mkdir -p $WORK/b001/
> cat >$WORK/b001/importcfg.link << 'EOF' # internal
> packagefile
> command-line-arguments=/home/nsaboo/.cache/go-build/5d/5db621e46792693a43911a7fc99e450f7198b1a62956677a4a47f7f1a8ebc0b2-d
> packagefile PAS/Godeps/_workspace/src/
> ghe.eng.fireeye.com/helix/tapgo.git=/home/nsaboo/.cache/go-build/25/255a89666be841631d45f43b7b900a38971218b4e53d88bab29a6f89de1fa2a5-d
> packagefile PAS/Godeps/_workspace/src/
> github.com/Sirupsen/logrus=/home/nsaboo/.cache/go-build/ac/ac0b35d28e0801df885605564391f3b660cb2d1212b0c4df659e5e89d5bb7ed6-d
> packagefile
> PAS/aws=/home/nsaboo/.cache/go-build/c1/c1b4eb19b03247ff0e834c9e652dd9024af2f74c4f817cbf8b8b577d4be8d608-d
> packagefile
> PAS/config=/home/nsaboo/.cache/go-build/1b/1b9780455e160d33364e0c69669e8d4999562c4a6180d5e21f3ce8bfee470046-d
> packagefile time=/usr/local/go/pkg/linux_amd64/time.a
> packagefile runtime=/usr/local/go/pkg/linux_amd64/runtime.a
> packagefile encoding/json=/usr/local/go/pkg/linux_amd64/encoding/json.a
> packagefile fmt=/usr/local/go/pkg/linux_amd64/fmt.a
> packagefile
> github.com/Sirupsen/logrus=/home/nsaboo/.cache/go-build/89/8914c444f75bb96cc629fec71f0db3864f1b5f6ec0cfdcd959eb5459b497953d-d
> packagefile
> github.com/garyburd/redigo/redis=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/garyburd/redigo/redis.a
> packagefile
> github.com/quipo/statsd=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/quipo/statsd.a
> packagefile
> github.com/stretchr/testify/mock=/home/nsaboo/.cache/go-build/4d/4d2b87d8985068509cec6f143bbc904330303f9fa1e89e5981c47468a84d6a6d-d
> packagefile
> github.com/xeipuuv/gojsonschema=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/xeipuuv/gojsonschema.a
> packagefile io/ioutil=/usr/local/go/pkg/linux_amd64/io/ioutil.a
> packagefile os=/usr/local/go/pkg/linux_amd64/os.a
> packagefile strconv=/usr/local/go/pkg/linux_amd64/strconv.a
> packagefile strings=/usr/local/go/pkg/linux_amd64/strings.a
> packagefile bufio=/usr/local/go/pkg/linux_amd64/bufio.a
> packagefile bytes=/usr/local/go/pkg/linux_amd64/bytes.a
> packagefile io=/usr/local/go/pkg/linux_amd64/io.a
> packagefile log=/usr/local/go/pkg/linux_amd64/log.a
> packagefile sort=/usr/local/go/pkg/linux_amd64/sort.a
> packagefile sync=/usr/local/go/pkg/linux_amd64/sync.a
> packagefile syscall=/usr/local/go/pkg/linux_amd64/syscall.a
> packagefile PAS/Godeps/_workspace/src/
> github.com/nu7hatch/gouuid=/home/nsaboo/.cache/go-build/36/36d9f2d9bb47cb906a96fbff8ef49774a2ed2909c1dd828540ebea88c5b66375-d
> packagefile
> PAS/constants=/home/nsaboo/.cache/go-build/9f/9f64de8861eeb80afe7d44fe64f90a63917210b38d88150f61941db84d1281a0-d
> packagefile
> PAS/lib=/home/nsaboo/.cache/go-build/f5/f548701c9d2403fdd2c4a5cb630b2fd2b98ddeafc512290f318a298d0d7cf382-d
> packagefile
> PAS/models=/home/nsaboo/.cache/go-build/6a/6a5b8ed822a9cda39e0482e171d3d45f54cceab20e5a8d35dc78ab1a5a6c8677-d
> packagefile compress/zlib=/usr/local/go/pkg/linux_amd64/compress/zlib.a
> packagefile errors=/usr/local/go/pkg/linux_amd64/errors.a
> packagefile
> github.com/aws/aws-sdk-go/aws=/home/nsaboo/.cache/go-build/09/097a3abd3003faf1b8b1063ff6b83c9ea7b621b7f24d07dd97f38988567eb838-d
> packagefile
> github.com/aws/aws-sdk-go/aws/session=/home/nsaboo/.cache/go-build/cd/cd9b89755b069cb1766be47dd648b4571f2738a81ebfb061286a77d23e38b909-d
> packagefile
> github.com/aws/aws-sdk-go/service/s3=/home/nsaboo/.cache/go-build/a0/a0b4f9349013d85866b327cc613509c58702c1eb901f56fca00a5f1897869622-d
> packagefile
> github.com/aws/aws-sdk-go/service/s3/s3manager=/home/nsaboo/.cache/go-build/2d/2d98542103b3ef7dc46e7f4836bf4af8254b3b148917ea8b06d44cf15f19339d-d
> packagefile
> github.com/aws/aws-sdk-go/service/sqs=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/aws/aws-sdk-go/service/sqs.a
> packagefile net/http=/usr/local/go/pkg/linux_amd64/net/http.a
> packagefile net/url=/usr/local/go/pkg/linux_amd64/net/url.a
> packagefile
> internal/bytealg=/usr/local/go/pkg/linux_amd64/internal/bytealg.a
> packagefile internal/cpu=/usr/local/go/pkg/linux_amd64/internal/cpu.a
> packagefile
> runtime/internal/atomic=/usr/local/go/pkg/linux_amd64/runtime/internal/atomic.a
> packagefile
> runtime/internal/math=/usr/local/go/pkg/linux_amd64/runtime/internal/math.a
> packagefile
> 

Re: [go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-10 Thread Nitish Saboo
Hi Ian,

Does the successful compilation makes sure that the Go code is properly
linked to the C header files ?

Thanks,
Nitish

On Sat, Jun 8, 2019 at 12:21 PM Nitish Saboo 
wrote:

> Hi Ian,
>
> So I observed a very strange thing.If I leave it out completely then also
> the project gets compiled.
> I thought that linker file is binding my Go code to the C code.Why am I
> not getting any error ?
> How the Go code is then getting linked to the C code ?
>
> Compiled Succesfully
> ---
>
> gcc -L/usr/local/lib -lsyslog-ng -o syslog-node.so
> -L/usr/local/lib/syslog-ng -ldbparser -c `pkg-config --libs --cflags
> glib-2.0` -I/usr/local/include/syslog-ng/ -I./lib/syslog-ng-3.6.2/ -I.
> -I/usr/local/include/eventlog/ ./lib/syslog-node.c
> go build -v -x main.go
> WORK=/tmp/go-build054960160
> mkdir -p $WORK/b001/
> cat >$WORK/b001/importcfg.link << 'EOF' # internal
> packagefile
> command-line-arguments=/home/nsaboo/.cache/go-build/5d/5db621e46792693a43911a7fc99e450f7198b1a62956677a4a47f7f1a8ebc0b2-d
> packagefile PAS/Godeps/_workspace/src/
> ghe.eng.fireeye.com/helix/tapgo.git=/home/nsaboo/.cache/go-build/25/255a89666be841631d45f43b7b900a38971218b4e53d88bab29a6f89de1fa2a5-d
> packagefile PAS/Godeps/_workspace/src/
> github.com/Sirupsen/logrus=/home/nsaboo/.cache/go-build/ac/ac0b35d28e0801df885605564391f3b660cb2d1212b0c4df659e5e89d5bb7ed6-d
> packagefile
> PAS/aws=/home/nsaboo/.cache/go-build/c1/c1b4eb19b03247ff0e834c9e652dd9024af2f74c4f817cbf8b8b577d4be8d608-d
> packagefile
> PAS/config=/home/nsaboo/.cache/go-build/1b/1b9780455e160d33364e0c69669e8d4999562c4a6180d5e21f3ce8bfee470046-d
> packagefile time=/usr/local/go/pkg/linux_amd64/time.a
> packagefile runtime=/usr/local/go/pkg/linux_amd64/runtime.a
> packagefile encoding/json=/usr/local/go/pkg/linux_amd64/encoding/json.a
> packagefile fmt=/usr/local/go/pkg/linux_amd64/fmt.a
> packagefile
> github.com/Sirupsen/logrus=/home/nsaboo/.cache/go-build/89/8914c444f75bb96cc629fec71f0db3864f1b5f6ec0cfdcd959eb5459b497953d-d
> packagefile
> github.com/garyburd/redigo/redis=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/garyburd/redigo/redis.a
> packagefile
> github.com/quipo/statsd=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/quipo/statsd.a
> packagefile
> github.com/stretchr/testify/mock=/home/nsaboo/.cache/go-build/4d/4d2b87d8985068509cec6f143bbc904330303f9fa1e89e5981c47468a84d6a6d-d
> packagefile
> github.com/xeipuuv/gojsonschema=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/xeipuuv/gojsonschema.a
> packagefile io/ioutil=/usr/local/go/pkg/linux_amd64/io/ioutil.a
> packagefile os=/usr/local/go/pkg/linux_amd64/os.a
> packagefile strconv=/usr/local/go/pkg/linux_amd64/strconv.a
> packagefile strings=/usr/local/go/pkg/linux_amd64/strings.a
> packagefile bufio=/usr/local/go/pkg/linux_amd64/bufio.a
> packagefile bytes=/usr/local/go/pkg/linux_amd64/bytes.a
> packagefile io=/usr/local/go/pkg/linux_amd64/io.a
> packagefile log=/usr/local/go/pkg/linux_amd64/log.a
> packagefile sort=/usr/local/go/pkg/linux_amd64/sort.a
> packagefile sync=/usr/local/go/pkg/linux_amd64/sync.a
> packagefile syscall=/usr/local/go/pkg/linux_amd64/syscall.a
> packagefile PAS/Godeps/_workspace/src/
> github.com/nu7hatch/gouuid=/home/nsaboo/.cache/go-build/36/36d9f2d9bb47cb906a96fbff8ef49774a2ed2909c1dd828540ebea88c5b66375-d
> packagefile
> PAS/constants=/home/nsaboo/.cache/go-build/9f/9f64de8861eeb80afe7d44fe64f90a63917210b38d88150f61941db84d1281a0-d
> packagefile
> PAS/lib=/home/nsaboo/.cache/go-build/f5/f548701c9d2403fdd2c4a5cb630b2fd2b98ddeafc512290f318a298d0d7cf382-d
> packagefile
> PAS/models=/home/nsaboo/.cache/go-build/6a/6a5b8ed822a9cda39e0482e171d3d45f54cceab20e5a8d35dc78ab1a5a6c8677-d
> packagefile compress/zlib=/usr/local/go/pkg/linux_amd64/compress/zlib.a
> packagefile errors=/usr/local/go/pkg/linux_amd64/errors.a
> packagefile
> github.com/aws/aws-sdk-go/aws=/home/nsaboo/.cache/go-build/09/097a3abd3003faf1b8b1063ff6b83c9ea7b621b7f24d07dd97f38988567eb838-d
> packagefile
> github.com/aws/aws-sdk-go/aws/session=/home/nsaboo/.cache/go-build/cd/cd9b89755b069cb1766be47dd648b4571f2738a81ebfb061286a77d23e38b909-d
> packagefile
> github.com/aws/aws-sdk-go/service/s3=/home/nsaboo/.cache/go-build/a0/a0b4f9349013d85866b327cc613509c58702c1eb901f56fca00a5f1897869622-d
> packagefile
> github.com/aws/aws-sdk-go/service/s3/s3manager=/home/nsaboo/.cache/go-build/2d/2d98542103b3ef7dc46e7f4836bf4af8254b3b148917ea8b06d44cf15f19339d-d
> packagefile
> github.com/aws/aws-sdk-go/service/sqs=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/aws/aws-sdk-go/service/sqs.a
> packagefile net/http=/usr/local/go/pkg/linux_amd64/net/http.a
> packagefile net/url=/usr/local/go/pkg/linux_amd64/net/url.a
> packagefile
> internal/bytealg=/usr/local/go/pkg/linux_amd64/internal/bytealg.a
> packagefile internal/cpu=/usr/local/go/pkg/linux_amd64/internal/cpu.a
> packagefile
> 

Re: [go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-08 Thread Nitish Saboo
Hi Ian,

So I observed a very strange thing.If I leave it out completely then also
the project gets compiled.
I thought that linker file is binding my Go code to the C code.Why am I not
getting any error ?
How the Go code is then getting linked to the C code ?

Compiled Succesfully
---

gcc -L/usr/local/lib -lsyslog-ng -o syslog-node.so
-L/usr/local/lib/syslog-ng -ldbparser -c `pkg-config --libs --cflags
glib-2.0` -I/usr/local/include/syslog-ng/ -I./lib/syslog-ng-3.6.2/ -I.
-I/usr/local/include/eventlog/ ./lib/syslog-node.c
go build -v -x main.go
WORK=/tmp/go-build054960160
mkdir -p $WORK/b001/
cat >$WORK/b001/importcfg.link << 'EOF' # internal
packagefile
command-line-arguments=/home/nsaboo/.cache/go-build/5d/5db621e46792693a43911a7fc99e450f7198b1a62956677a4a47f7f1a8ebc0b2-d
packagefile PAS/Godeps/_workspace/src/
ghe.eng.fireeye.com/helix/tapgo.git=/home/nsaboo/.cache/go-build/25/255a89666be841631d45f43b7b900a38971218b4e53d88bab29a6f89de1fa2a5-d
packagefile PAS/Godeps/_workspace/src/
github.com/Sirupsen/logrus=/home/nsaboo/.cache/go-build/ac/ac0b35d28e0801df885605564391f3b660cb2d1212b0c4df659e5e89d5bb7ed6-d
packagefile
PAS/aws=/home/nsaboo/.cache/go-build/c1/c1b4eb19b03247ff0e834c9e652dd9024af2f74c4f817cbf8b8b577d4be8d608-d
packagefile
PAS/config=/home/nsaboo/.cache/go-build/1b/1b9780455e160d33364e0c69669e8d4999562c4a6180d5e21f3ce8bfee470046-d
packagefile time=/usr/local/go/pkg/linux_amd64/time.a
packagefile runtime=/usr/local/go/pkg/linux_amd64/runtime.a
packagefile encoding/json=/usr/local/go/pkg/linux_amd64/encoding/json.a
packagefile fmt=/usr/local/go/pkg/linux_amd64/fmt.a
packagefile
github.com/Sirupsen/logrus=/home/nsaboo/.cache/go-build/89/8914c444f75bb96cc629fec71f0db3864f1b5f6ec0cfdcd959eb5459b497953d-d
packagefile
github.com/garyburd/redigo/redis=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/garyburd/redigo/redis.a
packagefile
github.com/quipo/statsd=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/quipo/statsd.a
packagefile
github.com/stretchr/testify/mock=/home/nsaboo/.cache/go-build/4d/4d2b87d8985068509cec6f143bbc904330303f9fa1e89e5981c47468a84d6a6d-d
packagefile
github.com/xeipuuv/gojsonschema=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/xeipuuv/gojsonschema.a
packagefile io/ioutil=/usr/local/go/pkg/linux_amd64/io/ioutil.a
packagefile os=/usr/local/go/pkg/linux_amd64/os.a
packagefile strconv=/usr/local/go/pkg/linux_amd64/strconv.a
packagefile strings=/usr/local/go/pkg/linux_amd64/strings.a
packagefile bufio=/usr/local/go/pkg/linux_amd64/bufio.a
packagefile bytes=/usr/local/go/pkg/linux_amd64/bytes.a
packagefile io=/usr/local/go/pkg/linux_amd64/io.a
packagefile log=/usr/local/go/pkg/linux_amd64/log.a
packagefile sort=/usr/local/go/pkg/linux_amd64/sort.a
packagefile sync=/usr/local/go/pkg/linux_amd64/sync.a
packagefile syscall=/usr/local/go/pkg/linux_amd64/syscall.a
packagefile PAS/Godeps/_workspace/src/
github.com/nu7hatch/gouuid=/home/nsaboo/.cache/go-build/36/36d9f2d9bb47cb906a96fbff8ef49774a2ed2909c1dd828540ebea88c5b66375-d
packagefile
PAS/constants=/home/nsaboo/.cache/go-build/9f/9f64de8861eeb80afe7d44fe64f90a63917210b38d88150f61941db84d1281a0-d
packagefile
PAS/lib=/home/nsaboo/.cache/go-build/f5/f548701c9d2403fdd2c4a5cb630b2fd2b98ddeafc512290f318a298d0d7cf382-d
packagefile
PAS/models=/home/nsaboo/.cache/go-build/6a/6a5b8ed822a9cda39e0482e171d3d45f54cceab20e5a8d35dc78ab1a5a6c8677-d
packagefile compress/zlib=/usr/local/go/pkg/linux_amd64/compress/zlib.a
packagefile errors=/usr/local/go/pkg/linux_amd64/errors.a
packagefile
github.com/aws/aws-sdk-go/aws=/home/nsaboo/.cache/go-build/09/097a3abd3003faf1b8b1063ff6b83c9ea7b621b7f24d07dd97f38988567eb838-d
packagefile
github.com/aws/aws-sdk-go/aws/session=/home/nsaboo/.cache/go-build/cd/cd9b89755b069cb1766be47dd648b4571f2738a81ebfb061286a77d23e38b909-d
packagefile
github.com/aws/aws-sdk-go/service/s3=/home/nsaboo/.cache/go-build/a0/a0b4f9349013d85866b327cc613509c58702c1eb901f56fca00a5f1897869622-d
packagefile
github.com/aws/aws-sdk-go/service/s3/s3manager=/home/nsaboo/.cache/go-build/2d/2d98542103b3ef7dc46e7f4836bf4af8254b3b148917ea8b06d44cf15f19339d-d
packagefile
github.com/aws/aws-sdk-go/service/sqs=/home/nsaboo/Documents/goworkspace/pkg/linux_amd64/github.com/aws/aws-sdk-go/service/sqs.a
packagefile net/http=/usr/local/go/pkg/linux_amd64/net/http.a
packagefile net/url=/usr/local/go/pkg/linux_amd64/net/url.a
packagefile
internal/bytealg=/usr/local/go/pkg/linux_amd64/internal/bytealg.a
packagefile internal/cpu=/usr/local/go/pkg/linux_amd64/internal/cpu.a
packagefile
runtime/internal/atomic=/usr/local/go/pkg/linux_amd64/runtime/internal/atomic.a
packagefile
runtime/internal/math=/usr/local/go/pkg/linux_amd64/runtime/internal/math.a
packagefile
runtime/internal/sys=/usr/local/go/pkg/linux_amd64/runtime/internal/sys.a
packagefile encoding=/usr/local/go/pkg/linux_amd64/encoding.a
packagefile encoding/base64=/usr/local/go/pkg/linux_amd64/encoding/base64.a
packagefile 

Re: [go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-08 Thread Ian Lance Taylor
On Fri, Jun 7, 2019 at 8:59 PM Nitish Saboo  wrote:
>
> I have tried the following three scenarios and one of them compiles 
> successfully that is with -L option.
> Let me know If am I missing something here .

You should use what works, although I don't know why it works.  I
would have thought that that -L option would simply be ignored.  What
happens if you leave it out entirely?

Ian

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVeY%2BJ9jGucZq%3DAmgnjo96gOdNNOv%2B8J_b6h4EQPQvZAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-07 Thread Nitish Saboo
Hi Ian,

I have tried the following three scenarios and one of them compiles
successfully that is with -L option.
Let me know If am I missing something here .

*1)When I use the this I get the following error:*

package lib

//#cgo CFLAGS: -I./syslog-ng-3.6.2/
//#cgo LDFLAGS: ${HOME}/Documents/goworkspace/src/PAS/syslog-node.so
 
//#cgo LDFLAGS: -L/usr/local/lib/ -lsyslog-ng
//#cgo LDFLAGS: -L/usr/local/lib/syslog-ng -ldbparser
//#cgo pkg-config: syslog-ng
//#cgo pkg-config: eventlog
//void callOnMeGo_cgo(char *key, char *value, size_t value_len);// Forward
Declaration.
//#include "syslog-node1.h"
import "C"

import (
"PAS/config"
"PAS/constants"
"fmt"
"unsafe"
)

Error:

gcc -L/usr/local/lib -lsyslog-ng -o syslog-node.so
-L/usr/local/lib/syslog-ng -ldbparser -c `pkg-config --libs --cflags
glib-2.0` -I/usr/local/include/syslog-ng/ -I./lib/syslog-ng-3.6.2/ -I.
-I/usr/local/include/eventlog/ ./lib/syslog-node.c
go build -v -x main.go
WORK=/tmp/go-build146353797
aws/aws_utils.go:4:2:
/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslogparser.go: malformed
#cgo argument: ${HOME}/Documents/goworkspace/src/PAS/syslog-node.so
makefile:6: recipe for target 'main' failed
make: *** [main] Error 1


*2)When I use the following :*

package lib

//#cgo CFLAGS: -I./syslog-ng-3.6.2/
//#cgo LDFLAGS: /home/nsaboo/Documents/goworkspace/src/PAS/syslog-node.so
<<<
//#cgo LDFLAGS: -L/usr/local/lib/ -lsyslog-ng
//#cgo LDFLAGS: -L/usr/local/lib/syslog-ng -ldbparser
//#cgo pkg-config: syslog-ng
//#cgo pkg-config: eventlog
//void callOnMeGo_cgo(char *key, char *value, size_t value_len);// Forward
Declaration.
//#include "syslog-node1.h"
import "C"

import (
"PAS/config"
"PAS/constants"
"fmt"
"unsafe"
)

Error



go build -v -x main.go
WORK=/tmp/go-build218062063
PAS/lib
mkdir -p $WORK/b128/
cd /home/nsaboo/Documents/goworkspace/src/PAS/lib
pkg-config --cflags -- syslog-ng eventlog
pkg-config --libs -- syslog-ng eventlog
CGO_LDFLAGS='"-g" "-O2"
"/home/nsaboo/Documents/goworkspace/src/PAS/syslog-node.so"
"-L/usr/local/lib/" "-lsyslog-ng" "-L/usr/local/lib/syslog-ng" "-ldbparser"
"-L/usr/local/lib" "-Wl,--export-dynamic" "-lgmodule-2.0" "-pthread"
"-lgthread-2.0" "-pthread" "-lglib-2.0" "-lsyslog-ng" "-lglib-2.0"
"-levtlog"' /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/b128/
-importpath PAS/lib -- -I/usr/local/include/syslog-ng
-I/usr/local/include/syslog-ng/ivykis -I/usr/local/include/eventlog
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I
$WORK/b128/ -g -O2
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2
./cfuncs.go ./syslogparser.go
cd $WORK
gcc -fno-caret-diagnostics -c -x c - || true
gcc -Qunused-arguments -c -x c - || true
gcc -fdebug-prefix-map=a=b -c -x c - || true
gcc -gno-record-gcc-switches -c -x c - || true
cd $WORK/b128
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC
-m64 -pthread -fmessage-length=0
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis
-I/usr/local/include/eventlog -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o
./_x001.o -c _cgo_export.c
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC
-m64 -pthread -fmessage-length=0
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis
-I/usr/local/include/eventlog -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o
./_x002.o -c cfuncs.cgo2.c
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC
-m64 -pthread -fmessage-length=0
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis
-I/usr/local/include/eventlog -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o
./_x003.o -c syslogparser.cgo2.c
cd /home/nsaboo/Documents/goworkspace/src/PAS/lib
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis
-I/usr/local/include/eventlog -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I $WORK/b128/ -g -O2
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o
$WORK/b128/_x004.o -c syslog-node.c
cd $WORK/b128
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC
-m64 -pthread -fmessage-length=0
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis
-I/usr/local/include/eventlog 

Re: [go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-07 Thread Ian Lance Taylor
On Fri, Jun 7, 2019 at 9:53 AM Nitish Saboo  wrote:
>
> > //#cgo CFLAGS: -I./syslog-ng-3.6.2/
> > //#cgo LDFLAGS: -L$(SRCDIR)/syslog-node.so.  <
>
> Is this what you are saying?
> Btw..do I need to keep -L flag?

I'm suggesting that you try

//#cgo LDFLAGS: ${SRCDIR}/syslog-node.so

Not sure where the -L flag came from.  The -L flag takes a directory;
you are naming a file.

Ian

> On Fri, 7 Jun 2019, 19:07 Ian Lance Taylor,  wrote:
>>
>> On Fri, Jun 7, 2019 at 4:03 AM Nitish Saboo  wrote:
>> >
>> > //#cgo CFLAGS: -I./syslog-ng-3.6.2/
>> > //#cgo LDFLAGS: syslog-node.so.  <
>>
>> Try using ${SRCDIR}/syslog-node.so, since you are creating the shared
>> library in the source directory.
>>
>> Ian

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVmVbXt7w1tgdGGn0zy4YTyHkG8hyqNzJri7ESbbk_56w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-07 Thread Nitish Saboo
Hi Ian,

> //#cgo CFLAGS: -I./syslog-ng-3.6.2/
> //#cgo LDFLAGS: -L$(SRCDIR)/syslog-node.so.  <

Is this what you are saying?
Btw..do I need to keep -L flag?

Thanks,
Nitish

On Fri, 7 Jun 2019, 19:07 Ian Lance Taylor,  wrote:

> On Fri, Jun 7, 2019 at 4:03 AM Nitish Saboo 
> wrote:
> >
> > //#cgo CFLAGS: -I./syslog-ng-3.6.2/
> > //#cgo LDFLAGS: syslog-node.so.  <
>
> Try using ${SRCDIR}/syslog-node.so, since you are creating the shared
> library in the source directory.
>
> Ian
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CALjMrq5%2BWqzYt2ddzd8TqDWcZOFkZkad92Yo5zziafCqz0p66g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-07 Thread Ian Lance Taylor
On Fri, Jun 7, 2019 at 4:03 AM Nitish Saboo  wrote:
>
> //#cgo CFLAGS: -I./syslog-ng-3.6.2/
> //#cgo LDFLAGS: syslog-node.so.  <

Try using ${SRCDIR}/syslog-node.so, since you are creating the shared
library in the source directory.

Ian

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXvvvK5E7ZHEi-OV4S3sS-uo4WiKkoLgY-%2BoGB_CdYjmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Need Assistance: makefile failing at 'go build' step

2019-06-07 Thread Nitish Saboo
Hi,

syslogparse.go
---

***

package lib

//#cgo CFLAGS: -I./syslog-ng-3.6.2/
//#cgo LDFLAGS: syslog-node.so.  <
//#cgo LDFLAGS: -L/usr/local/lib/ -lsyslog-ng
//#cgo LDFLAGS: -L/usr/local/lib/syslog-ng -ldbparser
//#cgo pkg-config: syslog-ng
//#cgo pkg-config: eventlog
//void callOnMeGo_cgo(char *key, char *value, size_t value_len);// Forward 
Declaration.
//#include "../syslog-node1.h"
import "C"

import (
"PAS/config"
"PAS/constants"
"fmt"
"unsafe"
)
***
makefile

**

.PHONY: all clean

all: main

main: syslog-node.so main.go syslog-node1.h
go build -v -x main.go

syslog-node.so: syslog-node.c syslog-node1.h
gcc -L/usr/local/lib -lsyslog-ng -o syslog-node.so 
-L/usr/local/lib/syslog-ng -ldbparser -c `pkg-config --libs --cflags 
glib-2.0` -I/usr/local/include/syslog-ng/ -I./syslog-ng-3.6.2/ -I. 
-I/usr/local/include/eventlog/ syslog-node.c

clean:
rm aws_utils
rm syslog-node.so



syslogparse.go is present in the lib directory (that is different from 
current directory).
My main.go is present in the current directory.My syslog-node.so gets 
created in the current directory.Makefile is present in the current 
directory
While running the make command I get then following error in the step 'go 
build -v -x main.go':

go build -v -x main.go
WORK=/tmp/go-build133367384
PAS/lib
mkdir -p $WORK/b128/
cd /home/nsaboo/Documents/goworkspace/src/PAS/lib
pkg-config --cflags -- syslog-ng eventlog
pkg-config --libs -- syslog-ng eventlog
CGO_LDFLAGS='"-g" "-O2" "syslog-node.so" "-L/usr/local/lib/" "-lsyslog-ng" 
"-L/usr/local/lib/syslog-ng" "-ldbparser" "-L/usr/local/lib" 
"-Wl,--export-dynamic" "-lgmodule-2.0" "-pthread" "-lgthread-2.0" 
"-pthread" "-lglib-2.0" "-lsyslog-ng" "-lglib-2.0" "-levtlog"' 
/usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/b128/ -importpath 
PAS/lib -- -I/usr/local/include/syslog-ng 
-I/usr/local/include/syslog-ng/ivykis -I/usr/local/include/eventlog 
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I 
$WORK/b128/ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 
./cfuncs.go ./syslogparser.go
cd $WORK
gcc -fno-caret-diagnostics -c -x c - || true
gcc -Qunused-arguments -c -x c - || true
gcc -fdebug-prefix-map=a=b -c -x c - || true
gcc -gno-record-gcc-switches -c -x c - || true
cd $WORK/b128
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC 
-m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches 
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis 
-I/usr/local/include/eventlog -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o 
./_x001.o -c _cgo_export.c
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC 
-m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches 
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis 
-I/usr/local/include/eventlog -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o 
./_x002.o -c cfuncs.cgo2.c
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC 
-m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches 
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis 
-I/usr/local/include/eventlog -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o 
./_x003.o -c syslogparser.cgo2.c
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC 
-m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches 
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis 
-I/usr/local/include/eventlog -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o 
./_cgo_main.o -c _cgo_main.c
cd /home/nsaboo/Documents/goworkspace/src/PAS/lib
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches -o 
$WORK/b128/_cgo_.o $WORK/b128/_cgo_main.o $WORK/b128/_x001.o 
$WORK/b128/_x002.o $WORK/b128/_x003.o -g -O2 syslog-node.so 
-L/usr/local/lib/ -lsyslog-ng -L/usr/local/lib/syslog-ng -ldbparser 
-L/usr/local/lib -Wl,--export-dynamic -lgmodule-2.0 -pthread -lgthread-2.0 
-pthread -lglib-2.0 -lsyslog-ng -lglib-2.0 -levtlog
# PAS/lib
gcc: error: syslog-node.so: No such file or directory
makefile:6: recipe for target 'main' failed
make: *** [main] Error 2


I feel