Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get to build .so file #1

Closed
dqft opened this issue Nov 20, 2016 · 7 comments
Closed

Can't get to build .so file #1

dqft opened this issue Nov 20, 2016 · 7 comments

Comments

@dqft
Copy link

dqft commented Nov 20, 2016

Hi there,

I'm quite new to Go...

I can't figure out how to get my .so file to build.

First problem is that Go won't let me have my go file (main package) alongside the pl.go file (plgo package).
I tried to turn my package into plgo's.

Second problem is that I get an error:

# command-line-arguments
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -shared may not be used together
collect2: error: ld returned 1 exit status

Any help would be really appreciated,
Regards!

@microo8
Copy link
Owner

microo8 commented Nov 21, 2016

the last commit is set to creating an command line tool that edits and compiles your source code.
it isn't completed and I don't know when it will be :P
try to change the pl.go package to main and then compile it.

@dqft
Copy link
Author

dqft commented Nov 21, 2016

Thanks for your answer!
Unfortunately, it doesn't work yet...

What I tried so far:

  1. I've copied pl.go in my directory and reset the package from plgo to main
  2. I've even tried to declare my functions at the bottom of the pl.go file, here's an example:
//export Hello
func Hello (fcInfo *FuncInfo) Datum {
	var t string
	fcinfo.Scan(&t)

	return ToDatum(t)
}
  1. I've added its declaration in funcdec.h
  2. I tried to build it: go build -buildmode=c-shared -o test.so pl.go

And here's the output now:

$ go build -v -buildmode=c-shared -o test3.so pl.go 
runtime/internal/sys
runtime/internal/atomic
runtime
internal/race
errors
sync/atomic
math
unicode/utf8
sync
syscall
io
strconv
reflect
time
os
fmt
runtime/cgo
command-line-arguments
# command-line-arguments
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `Pg_magic_func':
./pl.go:24: multiple definition of `Pg_magic_func'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:24: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `varsize':
./pl.go:28: multiple definition of `varsize'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:28: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `elog_notice':
./pl.go:31: multiple definition of `elog_notice'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:31: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `elog_error':
./pl.go:35: multiple definition of `elog_error'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:35: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `get_arg':
./pl.go:40: multiple definition of `get_arg'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:40: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `get_heap_tuple':
./pl.go:44: multiple definition of `get_heap_tuple'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:44: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `get_col_as_datum':
./pl.go:47: multiple definition of `get_col_as_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:47: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `called_as_trigger':
./pl.go:55: multiple definition of `called_as_trigger'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:55: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `get_heap_getattr':
./pl.go:58: multiple definition of `get_heap_getattr'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:58: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `void_datum':
./pl.go:69: multiple definition of `void_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:69: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `cstring_to_datum':
./pl.go:72: multiple definition of `cstring_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:72: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `int16_to_datum':
./pl.go:76: multiple definition of `int16_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:76: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `uint16_to_datum':
./pl.go:80: multiple definition of `uint16_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:80: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `int32_to_datum':
./pl.go:84: multiple definition of `int32_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:84: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `uint32_to_datum':
./pl.go:88: multiple definition of `uint32_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:88: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `int64_to_datum':
./pl.go:91: multiple definition of `int64_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:91: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `date_to_datum':
./pl.go:96: multiple definition of `date_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:96: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `time_to_datum':
./pl.go:99: multiple definition of `time_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:99: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `timetz_to_datum':
./pl.go:103: multiple definition of `timetz_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:103: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `bool_to_datum':
./pl.go:108: multiple definition of `bool_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:108: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `float4_to_datum':
./pl.go:112: multiple definition of `float4_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:112: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `float8_to_datum':
./pl.go:116: multiple definition of `float8_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:116: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `heap_tuple_to_datum':
./pl.go:119: multiple definition of `heap_tuple_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:119: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `array_to_datum':
./pl.go:123: multiple definition of `array_to_datum'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:123: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_cstring':
./pl.go:145: multiple definition of `datum_to_cstring'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:145: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_int16':
./pl.go:150: multiple definition of `datum_to_int16'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:150: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_uint16':
./pl.go:154: multiple definition of `datum_to_uint16'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:154: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_int32':
./pl.go:158: multiple definition of `datum_to_int32'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:158: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_uint32':
./pl.go:162: multiple definition of `datum_to_uint32'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:162: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_int64':
./pl.go:164: multiple definition of `datum_to_int64'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:164: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_date':
./pl.go:170: multiple definition of `datum_to_date'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:170: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_time':
./pl.go:172: multiple definition of `datum_to_time'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:172: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_timetz':
./pl.go:176: multiple definition of `datum_to_timetz'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:176: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_bool':
./pl.go:181: multiple definition of `datum_to_bool'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:181: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_float4':
./pl.go:185: multiple definition of `datum_to_float4'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:185: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_float8':
./pl.go:189: multiple definition of `datum_to_float8'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:189: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_heap_tuple':
./pl.go:192: multiple definition of `datum_to_heap_tuple'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:192: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `datum_to_array':
./pl.go:196: multiple definition of `datum_to_array'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:196: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `unknown_to_char':
./pl.go:213: multiple definition of `unknown_to_char'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:213: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `trigger_fired_before':
./pl.go:219: multiple definition of `trigger_fired_before'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:219: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `trigger_fired_after':
./pl.go:223: multiple definition of `trigger_fired_after'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:223: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `trigger_fired_instead':
./pl.go:227: multiple definition of `trigger_fired_instead'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:227: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `trigger_fired_for_row':
./pl.go:231: multiple definition of `trigger_fired_for_row'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:231: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `trigger_fired_for_statement':
./pl.go:235: multiple definition of `trigger_fired_for_statement'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:235: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `trigger_fired_by_insert':
./pl.go:239: multiple definition of `trigger_fired_by_insert'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:239: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `trigger_fired_by_update':
./pl.go:243: multiple definition of `trigger_fired_by_update'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:243: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `trigger_fired_by_delete':
./pl.go:247: multiple definition of `trigger_fired_by_delete'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:247: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `trigger_fired_by_truncate':
./pl.go:251: multiple definition of `trigger_fired_by_truncate'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/pl.go:251: first defined here
/tmp/go-build120029736/command-line-arguments/_obj/pl.cgo2.o: In function `pg_finfo_Hello':
./funcdec.h:1: multiple definition of `pg_finfo_Hello'
/tmp/go-build120029736/command-line-arguments/_obj/_cgo_export.o:/home/mmaldonado/work/sandbox/src/plgosql/test3/funcdec.h:1: first defined here
collect2: error: ld returned 1 exit status

If I remove the declarations in the top comment of the pl.go file, then it fails with:

could not determine kind of name for C.array_to_datum
could not determine kind of name for C.bool_to_datum
could not determine kind of name for C.called_as_trigger
could not determine kind of name for C.cstring_to_datum
could not determine kind of name for C.datum_to_array
could not determine kind of name for C.datum_to_bool
could not determine kind of name for C.datum_to_cstring
could not determine kind of name for C.datum_to_date
could not determine kind of name for C.datum_to_float4
could not determine kind of name for C.datum_to_float8
could not determine kind of name for C.datum_to_int16
could not determine kind of name for C.datum_to_int32
could not determine kind of name for C.datum_to_int64
could not determine kind of name for C.datum_to_time
could not determine kind of name for C.datum_to_timetz
could not determine kind of name for C.datum_to_uint16
could not determine kind of name for C.datum_to_uint32
could not determine kind of name for C.elog_error
could not determine kind of name for C.elog_notice
could not determine kind of name for C.float4_to_datum
could not determine kind of name for C.float8_to_datum
could not determine kind of name for C.get_arg
could not determine kind of name for C.get_col_as_datum
could not determine kind of name for C.get_heap_getattr
could not determine kind of name for C.get_heap_tuple
could not determine kind of name for C.heap_tuple_to_datum
could not determine kind of name for C.int16_to_datum
could not determine kind of name for C.int32_to_datum
could not determine kind of name for C.int64_to_datum
could not determine kind of name for C.timetz_to_datum
could not determine kind of name for C.trigger_fired_after
could not determine kind of name for C.trigger_fired_before
could not determine kind of name for C.trigger_fired_by_delete
could not determine kind of name for C.trigger_fired_by_insert
could not determine kind of name for C.trigger_fired_by_truncate
could not determine kind of name for C.trigger_fired_by_update
could not determine kind of name for C.trigger_fired_for_row
could not determine kind of name for C.trigger_fired_for_statement
could not determine kind of name for C.trigger_fired_instead
could not determine kind of name for C.uint16_to_datum
could not determine kind of name for C.uint32_to_datum
could not determine kind of name for C.unknown_to_char
could not determine kind of name for C.void_datum

Any idea of what to do?

Just in case, I'm using Go 1.7.1 and PostgreSQL 9.5.4

@microo8
Copy link
Owner

microo8 commented Nov 21, 2016

No no, you must have an separate file with your functions. but also package main. Don't touch the pl.go, just change the package to main

then build it with go build -v -buildmode=c-shared -o my_procedures.so my_procedures.go pl.go

@dqft
Copy link
Author

dqft commented Nov 21, 2016

I already tried it, which fails as mentionned in my initial post:

# command-line-arguments
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -shared may not be used together
collect2: error: ld returned 1 exit status

I've been googling before posting here and found a post on reddit in which you told to find and remove any occurence of "-r" in your code, but there's already no occurence of it.

Here's the full log:

$ go build -v -x -o plgosql.so -buildmode=c-shared main.go pl.go 
WORK=/tmp/go-build819420960
runtime/internal/sys
mkdir -p $WORK/runtime/internal/sys/_obj/
mkdir -p $WORK/runtime/internal/
cd /usr/lib/go/src/runtime/internal/sys
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/runtime/internal/sys.a -trimpath $WORK -shared -p runtime/internal/sys -+ -complete -installsuffix shared -buildid 7dc544448749db34890a1f03ccec13aac79cd89e -D _/usr/lib/go/src/runtime/internal/sys -I $WORK -pack ./arch.go ./arch_amd64.go ./intrinsics.go ./stubs.go ./sys.go ./zgoarch_amd64.go ./zgoos_linux.go ./zversion.go
runtime/internal/atomic
mkdir -p $WORK/runtime/internal/atomic/_obj/
cd /usr/lib/go/src/runtime/internal/atomic
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/runtime/internal/atomic.a -trimpath $WORK -shared -p runtime/internal/atomic -+ -installsuffix shared -buildid 48a9fdb51940486e660b64031eac54bdc8d8595e -D _/usr/lib/go/src/runtime/internal/atomic -I $WORK -pack -asmhdr $WORK/runtime/internal/atomic/_obj/go_asm.h ./atomic_amd64x.go ./stubs.go
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/internal/atomic/_obj/asm.o -trimpath $WORK -I $WORK/runtime/internal/atomic/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asm.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/internal/atomic/_obj/asm_amd64.o -trimpath $WORK -I $WORK/runtime/internal/atomic/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asm_amd64.s
pack r $WORK/runtime/internal/atomic.a $WORK/runtime/internal/atomic/_obj/asm.o $WORK/runtime/internal/atomic/_obj/asm_amd64.o # internal
runtime
mkdir -p $WORK/runtime/_obj/
mkdir -p $WORK/
cd /usr/lib/go/src/runtime
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/runtime.a -trimpath $WORK -shared -p runtime -+ -installsuffix shared -buildid 9573d5e483f3678b6a85d0d6980c5cfbf7821f6f -D _/usr/lib/go/src/runtime -I $WORK -pack -asmhdr $WORK/runtime/_obj/go_asm.h ./alg.go ./atomic_pointer.go ./cgo.go ./cgo_mmap.go ./cgocall.go ./cgocallback.go ./cgocheck.go ./chan.go ./compiler.go ./complex.go ./cpuprof.go ./cputicks.go ./debug.go ./defs_linux_amd64.go ./env_posix.go ./error.go ./extern.go ./fastlog2.go ./fastlog2table.go ./hash64.go ./hashmap.go ./hashmap_fast.go ./heapdump.go ./iface.go ./lfstack.go ./lfstack_64bit.go ./lock_futex.go ./malloc.go ./mbarrier.go ./mbitmap.go ./mcache.go ./mcentral.go ./mem_linux.go ./mfinal.go ./mfixalloc.go ./mgc.go ./mgcmark.go ./mgcsweep.go ./mgcwork.go ./mheap.go ./mprof.go ./msan0.go ./msize.go ./mstats.go ./mstkbar.go ./netpoll.go ./netpoll_epoll.go ./os_linux.go ./os_linux_generic.go ./panic.go ./print.go ./proc.go ./race0.go ./rdebug.go ./rune.go ./runtime.go ./runtime1.go ./runtime2.go ./select.go ./sema.go ./signal1_unix.go ./signal2_unix.go ./signal_amd64x.go ./signal_linux_amd64.go ./signal_sigtramp.go ./signal_unix.go ./sigpanic_unix.go ./sigqueue.go ./sigtab_linux_generic.go ./slice.go ./softfloat64.go ./sqrt.go ./stack.go ./string.go ./stubs.go ./stubs2.go ./symtab.go ./sys_nonppc64x.go ./sys_x86.go ./time.go ./trace.go ./traceback.go ./type.go ./typekind.go ./unaligned1.go ./vdso_linux_amd64.go ./write_err.go
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/_obj/asm.o -trimpath $WORK -I $WORK/runtime/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asm.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/_obj/asm_amd64.o -trimpath $WORK -I $WORK/runtime/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asm_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/_obj/duff_amd64.o -trimpath $WORK -I $WORK/runtime/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./duff_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/_obj/memclr_amd64.o -trimpath $WORK -I $WORK/runtime/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./memclr_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/_obj/memmove_amd64.o -trimpath $WORK -I $WORK/runtime/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./memmove_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/_obj/rt0_linux_amd64.o -trimpath $WORK -I $WORK/runtime/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./rt0_linux_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/_obj/sys_linux_amd64.o -trimpath $WORK -I $WORK/runtime/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./sys_linux_amd64.s
pack r $WORK/runtime.a $WORK/runtime/_obj/asm.o $WORK/runtime/_obj/asm_amd64.o $WORK/runtime/_obj/duff_amd64.o $WORK/runtime/_obj/memclr_amd64.o $WORK/runtime/_obj/memmove_amd64.o $WORK/runtime/_obj/rt0_linux_amd64.o $WORK/runtime/_obj/sys_linux_amd64.o # internal
errors
mkdir -p $WORK/errors/_obj/
internal/race
cd /usr/lib/go/src/errors
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/errors.a -trimpath $WORK -shared -p errors -complete -installsuffix shared -buildid 083471cdaa68951df89aaf90f4c8e2fc02ef7192 -D _/usr/lib/go/src/errors -I $WORK -pack ./errors.go
sync/atomic
mkdir -p $WORK/sync/atomic/_obj/
mkdir -p $WORK/sync/
cd /usr/lib/go/src/sync/atomic
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/sync/atomic.a -trimpath $WORK -shared -p sync/atomic -installsuffix shared -buildid 8d20d23c37268af2e80a5abb0a872e1824cbf5ce -D _/usr/lib/go/src/sync/atomic -I $WORK -pack -asmhdr $WORK/sync/atomic/_obj/go_asm.h ./doc.go ./value.go
math
mkdir -p $WORK/math/_obj/
cd /usr/lib/go/src/math
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/math.a -trimpath $WORK -shared -p math -installsuffix shared -buildid e6fb447f37884f9ab05be3c9bdfa4849f0da3e5a -D _/usr/lib/go/src/math -I $WORK -pack -asmhdr $WORK/math/_obj/go_asm.h ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./floor_asm.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
unicode/utf8
mkdir -p $WORK/internal/race/_obj/
mkdir -p $WORK/internal/
cd /usr/lib/go/src/internal/race
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/internal/race.a -trimpath $WORK -shared -p internal/race -complete -installsuffix shared -buildid c5c9f47c3cc7ba99257addf59cdeedbe5216da45 -D _/usr/lib/go/src/internal/race -I $WORK -pack ./doc.go ./norace.go
mkdir -p $WORK/unicode/utf8/_obj/
mkdir -p $WORK/unicode/
cd /usr/lib/go/src/unicode/utf8
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/unicode/utf8.a -trimpath $WORK -shared -p unicode/utf8 -complete -installsuffix shared -buildid 7e4a957e3356e238df8479f712aa5dfd1f9610eb -D _/usr/lib/go/src/unicode/utf8 -I $WORK -pack ./utf8.go
cd /usr/lib/go/src/sync/atomic
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/sync/atomic/_obj/asm_amd64.o -trimpath $WORK -I $WORK/sync/atomic/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asm_amd64.s
pack r $WORK/sync/atomic.a $WORK/sync/atomic/_obj/asm_amd64.o # internal
sync
mkdir -p $WORK/sync/_obj/
cd /usr/lib/go/src/sync
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/sync.a -trimpath $WORK -shared -p sync -installsuffix shared -buildid 9a1499064b87b238169fc56580580c6756fa97bc -D _/usr/lib/go/src/sync -I $WORK -pack ./cond.go ./mutex.go ./once.go ./pool.go ./runtime.go ./rwmutex.go ./waitgroup.go
io
mkdir -p $WORK/io/_obj/
syscall
mkdir -p $WORK/syscall/_obj/
cd /usr/lib/go/src/io
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/io.a -trimpath $WORK -shared -p io -complete -installsuffix shared -buildid 02aa535194c41e1117ea5ac5f5432c8584dc3fd9 -D _/usr/lib/go/src/io -I $WORK -pack ./io.go ./multi.go ./pipe.go
cd /usr/lib/go/src/syscall
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/syscall.a -trimpath $WORK -shared -p syscall -installsuffix shared -buildid 5b545f03c7acff95611181a7f9481d91a8cd8b9e -D _/usr/lib/go/src/syscall -I $WORK -pack -asmhdr $WORK/syscall/_obj/go_asm.h ./env_unix.go ./exec_linux.go ./exec_unix.go ./flock.go ./lsf_linux.go ./msan0.go ./netlink_linux.go ./sockcmsg_linux.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_linux.go ./syscall_linux_amd64.go ./syscall_unix.go ./zerrors_linux_amd64.go ./zsyscall_linux_amd64.go ./zsysnum_linux_amd64.go ./ztypes_linux_amd64.go
cd /usr/lib/go/src/math
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/asin_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asin_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/atan2_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./atan2_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/atan_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./atan_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/dim_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./dim_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/exp2_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./exp2_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/exp_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./exp_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/expm1_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./expm1_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/floor_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./floor_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/frexp_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./frexp_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/hypot_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./hypot_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/ldexp_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./ldexp_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/log10_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./log10_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/log1p_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./log1p_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/log_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./log_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/mod_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./mod_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/modf_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./modf_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/remainder_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./remainder_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/sin_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./sin_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/sincos_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./sincos_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/sqrt_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./sqrt_amd64.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/math/_obj/tan_amd64.o -trimpath $WORK -I $WORK/math/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./tan_amd64.s
pack r $WORK/math.a $WORK/math/_obj/asin_amd64.o $WORK/math/_obj/atan2_amd64.o $WORK/math/_obj/atan_amd64.o $WORK/math/_obj/dim_amd64.o $WORK/math/_obj/exp2_amd64.o $WORK/math/_obj/exp_amd64.o $WORK/math/_obj/expm1_amd64.o $WORK/math/_obj/floor_amd64.o $WORK/math/_obj/frexp_amd64.o $WORK/math/_obj/hypot_amd64.o $WORK/math/_obj/ldexp_amd64.o $WORK/math/_obj/log10_amd64.o $WORK/math/_obj/log1p_amd64.o $WORK/math/_obj/log_amd64.o $WORK/math/_obj/mod_amd64.o $WORK/math/_obj/modf_amd64.o $WORK/math/_obj/remainder_amd64.o $WORK/math/_obj/sin_amd64.o $WORK/math/_obj/sincos_amd64.o $WORK/math/_obj/sqrt_amd64.o $WORK/math/_obj/tan_amd64.o # internal
strconv
mkdir -p $WORK/strconv/_obj/
cd /usr/lib/go/src/strconv
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/strconv.a -trimpath $WORK -shared -p strconv -complete -installsuffix shared -buildid 852efb4a0a3ff4f7a369219d29d79927ef1889ae -D _/usr/lib/go/src/strconv -I $WORK -pack ./atob.go ./atof.go ./atoi.go ./decimal.go ./doc.go ./extfloat.go ./ftoa.go ./isprint.go ./itoa.go ./quote.go
reflect
mkdir -p $WORK/reflect/_obj/
cd /usr/lib/go/src/reflect
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/reflect.a -trimpath $WORK -shared -p reflect -installsuffix shared -buildid 66b0f18c26a40fb0895157aaa4e323d1fa367045 -D _/usr/lib/go/src/reflect -I $WORK -pack -asmhdr $WORK/reflect/_obj/go_asm.h ./deepequal.go ./makefunc.go ./type.go ./value.go
cd /usr/lib/go/src/syscall
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/syscall/_obj/asm.o -trimpath $WORK -I $WORK/syscall/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asm.s
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/syscall/_obj/asm_linux_amd64.o -trimpath $WORK -I $WORK/syscall/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asm_linux_amd64.s
pack r $WORK/syscall.a $WORK/syscall/_obj/asm.o $WORK/syscall/_obj/asm_linux_amd64.o # internal
time
mkdir -p $WORK/time/_obj/
cd /usr/lib/go/src/time
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/time.a -trimpath $WORK -shared -p time -installsuffix shared -buildid 7b45872a75ccfbe6570c1d7164e6b33b63fdf3d2 -D _/usr/lib/go/src/time -I $WORK -pack ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_read.go ./zoneinfo_unix.go
os
mkdir -p $WORK/os/_obj/
cd /usr/lib/go/src/os
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/os.a -trimpath $WORK -shared -p os -installsuffix shared -buildid 4b7978e60a52b7bbb3acaed019a30ab32fd62e8d -D _/usr/lib/go/src/os -I $WORK -pack ./dir_unix.go ./doc.go ./env.go ./error.go ./error_unix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./pipe_linux.go ./proc.go ./stat_linux.go ./sticky_notbsd.go ./str.go ./sys_linux.go ./sys_unix.go ./types.go ./types_unix.go ./wait_waitid.go
cd /usr/lib/go/src/reflect
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/reflect/_obj/asm_amd64.o -trimpath $WORK -I $WORK/reflect/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asm_amd64.s
pack r $WORK/reflect.a $WORK/reflect/_obj/asm_amd64.o # internal
fmt
mkdir -p $WORK/fmt/_obj/
cd /usr/lib/go/src/fmt
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/fmt.a -trimpath $WORK -shared -p fmt -complete -installsuffix shared -buildid 8e5adcca02b4964ac07e6c5dfe3592f46681742e -D _/usr/lib/go/src/fmt -I $WORK -pack ./doc.go ./format.go ./print.go ./scan.go
runtime/cgo
mkdir -p $WORK/runtime/cgo/_obj/
mkdir -p $WORK/runtime/
cd /usr/lib/go/src/runtime/cgo
CGO_LDFLAGS="-g" "-O2" "-lpthread" /usr/lib/go/pkg/tool/linux_amd64/cgo -objdir $WORK/runtime/cgo/_obj/ -importpath runtime/cgo -import_runtime_cgo=false -import_syscall=false -exportheader=$WORK/runtime/cgo/_obj/_cgo_install.h -- -I $WORK/runtime/cgo/_obj/ -Wall -Werror cgo.go
cd $WORK
x86_64-pc-linux-gnu-gcc -fdebug-prefix-map=a=b -c trivial.c
x86_64-pc-linux-gnu-gcc -gno-record-gcc-switches -c trivial.c
cd /usr/lib/go/src/runtime/cgo
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/_cgo_main.o -c $WORK/runtime/cgo/_obj/_cgo_main.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/_cgo_export.o -c $WORK/runtime/cgo/_obj/_cgo_export.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/cgo.cgo2.o -c $WORK/runtime/cgo/_obj/cgo.cgo2.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/gcc_context.o -c ./gcc_context.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/gcc_fatalf.o -c ./gcc_fatalf.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/gcc_libinit.o -c ./gcc_libinit.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/gcc_linux_amd64.o -c ./gcc_linux_amd64.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/gcc_mmap.o -c ./gcc_mmap.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/gcc_setenv.o -c ./gcc_setenv.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/gcc_traceback.o -c ./gcc_traceback.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/gcc_util.o -c ./gcc_util.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/runtime/cgo/_obj/ -g -O2 -Wall -Werror -o $WORK/runtime/cgo/_obj/gcc_amd64.o -c ./gcc_amd64.S
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/runtime/cgo/_obj/_cgo_.o $WORK/runtime/cgo/_obj/_cgo_main.o $WORK/runtime/cgo/_obj/_cgo_export.o $WORK/runtime/cgo/_obj/cgo.cgo2.o $WORK/runtime/cgo/_obj/gcc_context.o $WORK/runtime/cgo/_obj/gcc_fatalf.o $WORK/runtime/cgo/_obj/gcc_libinit.o $WORK/runtime/cgo/_obj/gcc_linux_amd64.o $WORK/runtime/cgo/_obj/gcc_mmap.o $WORK/runtime/cgo/_obj/gcc_setenv.o $WORK/runtime/cgo/_obj/gcc_traceback.o $WORK/runtime/cgo/_obj/gcc_util.o $WORK/runtime/cgo/_obj/gcc_amd64.o -g -O2 -lpthread
/usr/lib/go/pkg/tool/linux_amd64/cgo -objdir $WORK/runtime/cgo/_obj/ -dynpackage cgo -dynimport $WORK/runtime/cgo/_obj/_cgo_.o -dynout $WORK/runtime/cgo/_obj/_cgo_import.go -dynlinker
cd $WORK
x86_64-pc-linux-gnu-gcc -no-pie -c trivial.c
cd /usr/lib/go/src/runtime/cgo
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/runtime/cgo/_obj/_all.o $WORK/runtime/cgo/_obj/_cgo_export.o $WORK/runtime/cgo/_obj/cgo.cgo2.o $WORK/runtime/cgo/_obj/gcc_context.o $WORK/runtime/cgo/_obj/gcc_fatalf.o $WORK/runtime/cgo/_obj/gcc_libinit.o $WORK/runtime/cgo/_obj/gcc_linux_amd64.o $WORK/runtime/cgo/_obj/gcc_mmap.o $WORK/runtime/cgo/_obj/gcc_setenv.o $WORK/runtime/cgo/_obj/gcc_traceback.o $WORK/runtime/cgo/_obj/gcc_util.o $WORK/runtime/cgo/_obj/gcc_amd64.o -g -O2 -Wl,-r -nostdlib -Wl,--build-id=none
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/runtime/cgo.a -trimpath $WORK -shared -p runtime/cgo -installsuffix shared -buildid 25723caab5bfedaaf4b45808c33c7dac8034b502 -D _/usr/lib/go/src/runtime/cgo -I $WORK -pack -asmhdr $WORK/runtime/cgo/_obj/go_asm.h ./callbacks.go ./callbacks_traceback.go ./iscgo.go ./mmap.go ./setenv.go $WORK/runtime/cgo/_obj/_cgo_gotypes.go $WORK/runtime/cgo/_obj/cgo.cgo1.go $WORK/runtime/cgo/_obj/_cgo_import.go
/usr/lib/go/pkg/tool/linux_amd64/asm -o $WORK/runtime/cgo/_obj/asm_amd64.o -trimpath $WORK -I $WORK/runtime/cgo/_obj/ -I /usr/lib/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -shared ./asm_amd64.s
pack r $WORK/runtime/cgo.a $WORK/runtime/cgo/_obj/asm_amd64.o $WORK/runtime/cgo/_obj/_all.o # internal
command-line-arguments
mkdir -p $WORK/command-line-arguments/_obj/
mkdir -p $WORK/command-line-arguments/_obj/exe/
cd /home/mmaldonado/work/sandbox/src/plgosql/test3
CGO_LDFLAGS="-g" "-O2" "-shared" /usr/lib/go/pkg/tool/linux_amd64/cgo -objdir $WORK/command-line-arguments/_obj/ -importpath command-line-arguments -exportheader=$WORK/command-line-arguments/_obj/_cgo_install.h -- -I $WORK/command-line-arguments/_obj/ -I/usr/include/postgresql/server pl.go
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/command-line-arguments/_obj/ -g -O2 -I/usr/include/postgresql/server -o $WORK/command-line-arguments/_obj/_cgo_main.o -c $WORK/command-line-arguments/_obj/_cgo_main.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/command-line-arguments/_obj/ -g -O2 -I/usr/include/postgresql/server -o $WORK/command-line-arguments/_obj/_cgo_export.o -c $WORK/command-line-arguments/_obj/_cgo_export.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/command-line-arguments/_obj/ -g -O2 -I/usr/include/postgresql/server -o $WORK/command-line-arguments/_obj/pl.cgo2.o -c $WORK/command-line-arguments/_obj/pl.cgo2.c
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/command-line-arguments/_obj/_cgo_.o $WORK/command-line-arguments/_obj/_cgo_main.o $WORK/command-line-arguments/_obj/_cgo_export.o $WORK/command-line-arguments/_obj/pl.cgo2.o -g -O2 -shared
/usr/lib/go/pkg/tool/linux_amd64/cgo -objdir $WORK/command-line-arguments/_obj/ -dynpackage main -dynimport $WORK/command-line-arguments/_obj/_cgo_.o -dynout $WORK/command-line-arguments/_obj/_cgo_import.go
x86_64-pc-linux-gnu-gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/command-line-arguments/_obj/_all.o $WORK/command-line-arguments/_obj/_cgo_export.o $WORK/command-line-arguments/_obj/pl.cgo2.o -g -O2 -shared -Wl,-r -nostdlib -Wl,--build-id=none
# command-line-arguments
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -shared may not be used together
collect2: error: ld returned 1 exit status

@microo8
Copy link
Owner

microo8 commented Nov 22, 2016

can you upload somewhere your main.go, funcdec.h and pl.go files?

@dqft
Copy link
Author

dqft commented Nov 22, 2016

Sure thing, here they are:

Thank you for your time and help!

@microo8
Copy link
Owner

microo8 commented Nov 23, 2016

OK so after some "research" I've found that I can compile it and your last gcc command

gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/command-line-arguments/_obj/_all.o $WORK/command-line-arguments/_obj/_cgo_export.o $WORK/command-line-arguments/_obj/pl.cgo2.o -g -O2 -shared -Wl,-r -nostdlib -Wl,--build-id=none

and my last gcc command

gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/command-line-arguments/_obj/_all.o $WORK/command-line-arguments/_obj/_cgo_export.o $WORK/command-line-arguments/_obj/pl.cgo2.o -g -O2 -shared -Wl,-r -nostdlib -no-pie -Wl,--build-id=none

differ only with the -no-pie argument at the end

try to add to the pl.go file at the end of line with CFLAGS also -Wl,-r -nostdlib -no-pie
(or try it in LDFLAGS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants