On Fri, Sep 14, 2018 at 2:16 PM, <amand...@cohesity.com> wrote: > 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.
Hmmm, not sure what is happening. Especially not sure why it would fail on Solaris 10 but work on Solaris 11, as you suggested earlier. I have a feeling this is going to be some configuration error somewhere. I guess the next step in debugging would be to run this command, copied from your earlier message, and then look at x.o to see how __cgo__0 is defined in the debug info. If you have the readelf program from the GNU binutils you could run readelf --debug=all x.o. Ian gcc -w -Wno-error -o x.o -gdwarf-2 -c -xc -I /b001/ -g -O2 - <<EOF #line 1 "cgo-builtin-prolog" #include <stddef.h> /* for ptrdiff_t and size_t below */ /* Define intgo when compiling with GCC. */ typedef ptrdiff_t intgo; typedef struct { const char *p; intgo n; } _GoString_; typedef struct { char *p; intgo n; intgo c; } _GoBytes_; _GoString_ GoString(char *p); _GoString_ GoStringN(char *p, int l); _GoBytes_ GoBytes(void *p, int n); char *CString(_GoString_); void *CBytes(_GoBytes_); void *_CMalloc(size_t); __attribute__ ((unused)) static size_t _GoStringLen(_GoString_ s) { return s.n; } __attribute__ ((unused)) static const char *_GoStringPtr(_GoString_ s) { return s.p; } #line 3 "/export/home/amandeep/sol10.go" #include <stdio.h> void testc() { printf("Hello cgo"); } #line 1 "cgo-generated-wrapper" #line 1 "cgo-dwarf-inference" __typeof__(testc) *__cgo__0; long long __cgodebug_ints[] = { 0, 1 }; double __cgodebug_floats[] = { 0, 1 }; EOF -- 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.