Re: [go-nuts] sudo ./main command throwing error

2019-06-24 Thread Kurtis Rader
That means your "sudo" configuration doesn't allow the use of the `-E` flag; at least in that specific use case. Alternatively, your system doesn't preserve the value of `LD_LIBRARY_PATH` when the shell is invoked via `sudo -E` because the shell's startup scripts clobber that var. I hope you recog

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread nicolas_boiteux via golang-nuts
it tried to also allow those flags by setting the env variablee ldflag allow but it seems to have no effect. Le lundi 24 juin 2019 21:15:34 UTC+2, nobody nobodye a écrit : > > it seems that flags --no-undefined --enable-runtime-pseudo-reloc are > invalid flags :( > > /* > #cgo LDFLAGS: --no-unde

Re: [go-nuts] Go serial port package

2019-06-24 Thread maranatha
I have been trying to use both Tarmigan's and Jacob's packages on Windows and Linux. For basic serial reading they both seem to work just fine. However, they both seem to break with higher baud rate and continues streaming of data. In my case I was streaming sensor data at baud rate 921600, th

Re: [go-nuts] sudo ./main command throwing error

2019-06-24 Thread Nitish Saboo
HI Michael, Looks like it is still not preserving the env variable: nsaboo@ubuntu:~/Documents/goworkspace/src/poc$ export LD_LIBRARY_PATH=/usr/local/lib/syslog-ng nsaboo@ubuntu:~/Documents/goworkspace/src/poc$ sudo -E bash -c 'echo $LD_LIBRARY_PATH' nsaboo@ubuntu:~/Documents/goworkspace/src/poc$

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread nicolas_boiteux via golang-nuts
it seems that flags --no-undefined --enable-runtime-pseudo-reloc are invalid flags :( /* #cgo LDFLAGS: --no-undefined --enable-runtime-pseudo-reloc #include #include #include */ import "C" Le lundi 24 juin 2019 18:58:22 UTC+2, Alexander Kapshuk a écrit : > > The part of interest is the func

Re: [go-nuts] sudo ./main command throwing error

2019-06-24 Thread Michael Anderson
You could try: sudo -E bash -c 'echo $LD_LIBRARY_PATH' The -E is --preserve-env On 6/24/19 12:32 PM, Marcin Romaszewicz wrote: sudo echo $LD_LIBRARY_PATH -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and sto

Re: [go-nuts] sudo ./main command throwing error

2019-06-24 Thread 'Michael Stiller' via golang-nuts
Hi, i think sudo kills the LD_LIBRARY_PATH variable. But this is configurable, try something like: Defaultsenv_keep += “LD_LIBRARY_PATH" in /etc/sudoers and / or consult the sudo man page. Best regards, Michael > On 24. Jun 2019, at 18:48, Nitish Saboo wrote: > > Hi , > > I am u

Re: [go-nuts] sudo ./main command throwing error

2019-06-24 Thread Marcin Romaszewicz
sudo does not preserve environment variables for security reasons, run: sudo echo $LD_LIBRARY_PATH You'll likely see that it's empty, unless you have a global system one set. On Mon, Jun 24, 2019 at 9:48 AM Nitish Saboo wrote: > Hi , > > I am using cgo in this project where I need the followi

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread Alexander Kapshuk
The part of interest is the functions you want exported from the Go program: 10 000813C0 RVExtension 21 00081360 RVExtensionArgs 32 00081310 RVExtensionVersion This article, http://www.mingw.org/wiki/sampledll, in section 'Building and using a DLL without the dllexport/dllimport attib

[go-nuts] sudo ./main command throwing error

2019-06-24 Thread Nitish Saboo
Hi , I am using cgo in this project where I need the following given .so files. After building the go code, I get the binary 'main'. ubuntu@hexint09-ingest-0693b91d:/opt/tap-parsing/bin$ ls -lrt total 17000 -rwxr-xr-x 1 parsing parsing 17405424 Jun 24 11:14 main '.*/main' works fine whereas 'sud

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread nicolas_boiteux via golang-nuts
i don't know why it so much verbose perhaps i don't use the good compilation flag . Here another dump of a 32 bit dll extension with the same entry point but coded with c# (for comparaison purpose) Microsoft (R) COFF/PE Dumper Version 14.21.27702.2 Copyright (C) Microsoft Corporation. All righ

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread nicolas_boiteux via golang-nuts
Hello Alexander you can find the dump at this place: https://pastebin.com/cg33nktu Le lundi 24 juin 2019 13:00:49 UTC+2, Alexander Kapshuk a écrit : > > Or was this it? > > #ifdef __cplusplus > extern "C" { > #endif > extern void _RVExtensionVersion(char* p0, size_t p1); > extern void _RVExt

Re: [go-nuts] Re: Concurrent Routines in WASM

2019-06-24 Thread Samuel Warfield
Thanks! On Sun, Jun 23, 2019 at 8:49 AM Agniva De Sarker < agniva.quicksil...@gmail.com> wrote: > The spec is at phase 2. Please feel free to subscribe to > https://github.com/golang/go/issues/28631 for updates. > > On Saturday, 22 June 2019 06:46:56 UTC+5:30, Keith Randall wrote: >> >> No, it do

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread Alexander Kapshuk
Ok. Thanks. What's the output of dumpbin.exe /EXPORTS /path/to/slib.dll showing the listing of your exported functions? On Mon, Jun 24, 2019 at 2:37 PM wrote: > > /* Code generated by cmd/cgo; DO NOT EDIT. */ > > /* package _/F_/Git/returnHWID-Arma */ > > > #line 1 "cgo-builtin-export-prolog" > >

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread onopa96
/* Code generated by cmd/cgo; DO NOT EDIT. */ /* package _/F_/Git/returnHWID-Arma */ #line 1 "cgo-builtin-export-prolog" #include /* for ptrdiff_t below */ #ifndef GO_CGO_EXPORT_PROLOGUE_H #define GO_CGO_EXPORT_PROLOGUE_H #ifndef GO_CGO_GOSTRING_TYPEDEF typedef struct { const char *p; ptrdif

Re: [go-nuts] Re: Concerning the level required to contribute to Go

2019-06-24 Thread Michel Levieux
Hi everyone, Thank you all for all your precious pieces of advice. I think I'm slowly going to have a look at the different possibilities to contribute to the Go language. As some of you noticed, I'm kind of more motivated when I think about helping in the go codebase than other sorts of tasks (th

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread Alexander Kapshuk
Or was this it? #ifdef __cplusplus extern "C" { #endif extern void _RVExtensionVersion(char* p0, size_t p1); extern void _RVExtensionArgs(char* p0, size_t p1, char* p2, char** p3, int p4); extern void _RVExtension(char* p0, size_t p1, char* p2); #ifdef __cplusplus } #endif The 32-bit exports list

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread nicolas_boiteux via golang-nuts
Hello Alexander, from my understanding, we need to build a GO 32 bits DLL for a C software. To load this DLL, the C software loads an entry point function called _RVExtension@12 wich is a decorated/mangle C name/ It seems that cgo doesn't accept to export functions with '@' in name composition

Re: [go-nuts] [ANN] VictoriaMetrics - fast open source time series database written in Go

2019-06-24 Thread Aliaksandr Valialkin
On Sun, Jun 23, 2019 at 9:17 PM David Anderson wrote: > Looks very nice, I look forward to checking it out. > > I'm curious: why do you maintain separate trees for the single node vs. > cluster version? Naively I would have assumed that single node == cluster > codebase with a few features turned

Re: [go-nuts] [cgo ] Export go function to C - illegal character

2019-06-24 Thread Alexander Kapshuk
If I understand it correctly, cgo should have generated a _cgo_export.h header with a declaration for your exported function. Can you please post the generated declaration? On Mon, Jun 24, 2019 at 12:47 AM wrote: > > We are trying to make the x32 version of the extension, as shown in the link >