I made a wrong conclusion and run a executable not representing the build 
because it failed so it didn't replaced the old executable. Unrelated with 
the title I am a bit confused why it didn't build in the first place? 
Thanks.

go build -a -tags 'netgo noplugin' -ldflags '-d -extldflags "-static"' -gcflags 
"all=-N -l" -o main

/usr/local/go/pkg/tool/darwin_amd64/link: $WORK/b072/_pkg_.a(_go_.o): cannot 
use dynamic imports with -d flag
/usr/local/go/pkg/tool/darwin_amd64/link: $WORK/b085/_pkg_.a(_go_.o): cannot 
use dynamic imports with -d flag
/usr/local/go/pkg/tool/darwin_amd64/link: $WORK/b086/_pkg_.a(_go_.o): cannot 
use dynamic imports with -d flag
crypto/x509(__TEXT/__text): relocation target SecTrustCopyAnchorCertificates 
not defined
crypto/x509(__TEXT/__text): relocation target kCFAllocatorDefault not defined
crypto/x509(__TEXT/__text): relocation target CFDataCreateMutable not defined
crypto/x509(__TEXT/__text): relocation target CFArrayGetCount not defined
crypto/x509(__TEXT/__text): relocation target CFArrayGetValueAtIndex not defined
crypto/x509(__TEXT/__text): relocation target SecKeychainItemExport not defined
crypto/x509(__TEXT/__text): relocation target CFDataGetBytePtr not defined
crypto/x509(__TEXT/__text): relocation target CFDataGetLength not defined
crypto/x509(__TEXT/__text): relocation target CFDataAppendBytes not defined
crypto/x509(__TEXT/__text): relocation target CFRelease not defined
crypto/x509(__TEXT/__text): relocation target CFRelease not defined
crypto/x509(__TEXT/__text): relocation target __stack_chk_guard not defined
crypto/x509(__TEXT/__text): relocation target sysctlbyname not defined
crypto/x509(__TEXT/__text): relocation target __stack_chk_guard not defined
crypto/x509(__TEXT/__text): relocation target __stack_chk_fail not defined
crypto/x509(__TEXT/__text): relocation target __stack_chk_guard not defined
crypto/x509(__TEXT/__text): relocation target sysctlbyname not defined
crypto/x509(__TEXT/__text): relocation target CFStringCreateWithCString not 
defined
/usr/local/go/pkg/tool/darwin_amd64/link: too many errors


On Wednesday, August 15, 2018 at 2:10:23 AM UTC+2, Jake Montgomery wrote:
I am unable to reproduce using a small test app on either Windows or 
Ubuntu, using go 1.10.3. In all cases the init() function in main is run 
when the test binary is run. Perhaps you could provide a minimal 
reproducible example?

On Monday, August 13, 2018 at 8:21:30 PM UTC-4, Gert wrote:
Hi, `go test` runs the main init but the binary created by 


go test -c -a -tags 'netgo noplugin' -gcflags "all=-N -l"


doesn't. Is this a bug? Also it's seems you can't compile static test 
binaries only non test binaries can be compiled static?
I made a wrong conclusion and run a executable not representing the build 
because it failed so it didn't replaced the old executable. Unrelated with 
the title am a bit confused why I can't build the following? sasa 

go build -a -tags 'netgo noplugin' -ldflags '-d -extldflags "-static"' -gcflags 
"all=-N -l" -o main

/usr/local/go/pkg/tool/darwin_amd64/link: $WORK/b072/_pkg_.a(_go_.o): cannot 
use dynamic imports with -d flag
/usr/local/go/pkg/tool/darwin_amd64/link: $WORK/b085/_pkg_.a(_go_.o): cannot 
use dynamic imports with -d flag
/usr/local/go/pkg/tool/darwin_amd64/link: $WORK/b086/_pkg_.a(_go_.o): cannot 
use dynamic imports with -d flag
crypto/x509(__TEXT/__text): relocation target SecTrustCopyAnchorCertificates 
not defined
crypto/x509(__TEXT/__text): relocation target kCFAllocatorDefault not defined
crypto/x509(__TEXT/__text): relocation target CFDataCreateMutable not defined
crypto/x509(__TEXT/__text): relocation target CFArrayGetCount not defined
crypto/x509(__TEXT/__text): relocation target CFArrayGetValueAtIndex not defined
crypto/x509(__TEXT/__text): relocation target SecKeychainItemExport not defined
crypto/x509(__TEXT/__text): relocation target CFDataGetBytePtr not defined
crypto/x509(__TEXT/__text): relocation target CFDataGetLength not defined
crypto/x509(__TEXT/__text): relocation target CFDataAppendBytes not defined
crypto/x509(__TEXT/__text): relocation target CFRelease not defined
crypto/x509(__TEXT/__text): relocation target CFRelease not defined
crypto/x509(__TEXT/__text): relocation target __stack_chk_guard not defined
crypto/x509(__TEXT/__text): relocation target sysctlbyname not defined
crypto/x509(__TEXT/__text): relocation target __stack_chk_guard not defined
crypto/x509(__TEXT/__text): relocation target __stack_chk_fail not defined
crypto/x509(__TEXT/__text): relocation target __stack_chk_guard not defined
crypto/x509(__TEXT/__text): relocation target sysctlbyname not defined
crypto/x509(__TEXT/__text): relocation target CFStringCreateWithCString not 
defined
/usr/local/go/pkg/tool/darwin_amd64/link: too many errors


On Wednesday, August 15, 2018 at 2:10:23 AM UTC+2, Jake Montgomery wrote:
>
> I am unable to reproduce using a small test app on either Windows or 
> Ubuntu, using go 1.10.3. In all cases the init() function in main is run 
> when the test binary is run. Perhaps you could provide a minimal 
> reproducible example?
>
> On Monday, August 13, 2018 at 8:21:30 PM UTC-4, Gert wrote:
>>
>> Hi, `go test` runs the main init but the binary created by 
>>
>> go test -c -a -tags 'netgo noplugin' -gcflags "all=-N -l"
>>
>> doesn't. Is this a bug? Also it's seems you can't compile static test 
>> binaries only non test binaries can be compiled static?
>>
>

-- 
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.

Reply via email to