On Tue, Aug 4, 2020 at 11:48 AM Mahdi Hosseini <m.hosein...@gmail.com> wrote:
>
> I have a problem when trying to run the test for runtime when CGO is enabled. 
> The test I want to run is CGO_ENABLED=1 go test -run=TestCgoSignalDeadlock 
> inside src/runtime of the goroot. This test on my machine never compile the c 
> files and hence led to link problem while my other CGO program build and run 
> perfectly.
> I try to run the test using -x -work command to see the details and I found 
> out that for some reason the test never compile the c file inside 
> src/runtime/cgo. As I checked the CGO_ENBALED=1 pass to the build command.
> I am using Clang instead of gcc and all of my CGO project compiled without 
> problem except this test.
> I want to know how go create the list of file needed to be compiled and 
> linked and why src/runtime/cgo directory was excluded while I have both build 
> tag for CGO and import "C".

The test TestCgoSignalDeadlock runs the go command itself to build
another program, then runs that program.  When you use -x you are
seeing the way that the runtime test itself is built; that test is not
expected to use cgo or build runtime/cgo.  That isn't showing you
anything about the commands that the test uses to build the program it
is going to run.  The easiest way to see those commands will probably
be to edit buildTestProg in runtime/crash_test.go.

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/CAOyqgcW-BWObg4UBmpDk6AkQrD%3D5HvH-2Toyh1NpODL81S17Gw%40mail.gmail.com.

Reply via email to