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

build: hardcoded gcc command lines do not allow using TDM64 gcc on 32-bit Windows #11909

Open
0x6a67 opened this issue Jul 28, 2015 · 1 comment
Milestone

Comments

@0x6a67
Copy link

0x6a67 commented Jul 28, 2015

TDM64 is bi-arch gcc distribution with unusual configuration : 32-bit compiler produces 64-bit object files / executables by default, -m32 is required for 32-bit compilation.
See http://tdm-gcc.tdragon.net/quirks for details.

There are few places in Go source tree where C compiler name and required switches ( in particular -m32/-m64 ) are not obtained from environment variables or by running go env :

  • on tip in src/runtime/syscall_windows_test.go
    • initialization of cbDLLs variable
    • C compiler run in function TestReturnAfterStackGrowInCallback
    • test for C compiler availability in TestStdcallAndCDeclCallbacks and TestReturnAfterStackGrowInCallback
  • on 1.4.2
    • in src/make.bat
    • in src/runtime/syscall_windows_test.go : initialization of cbDLLs variable
    • in misc/cgo/testso/test.bat

As a result you simply can't build 1.4.2 using TDM64 on 32-bit Windows : compiled dist.exe is 64-bit.

On tip runtime test fails because of 64-bit test.dll :

--- FAIL: TestStdcallAndCDeclCallbacks (1.18s)
panic: Failed to load D:\opt\usr\src\go\tmp\TestCDeclCallback075906618\test.dll: %1 is not a valid Win32 application. [recovered]
    panic: Failed to load D:\opt\usr\src\go\tmp\TestCDeclCallback075906618\test.dll: %1 is not a valid Win32 application.

goroutine 103859 [running]:
testing.tRunner.func1(0x10d774a0)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:449 +0x131
syscall.MustLoadDLL(0x111c9100, 0x39, 0x1120c8d0)
    D:/opt/usr/src/go/jtip/src/syscall/dll_windows.go:62 +0x64
runtime_test.(*cbTest).run(0x10dbbf04, 0x10d774a0, 0x111c9100, 0x39)
    D:/opt/usr/src/go/jtip/src/runtime/syscall_windows_test.go:399 +0x2d
runtime_test.TestStdcallAndCDeclCallbacks(0x10d774a0)
    D:/opt/usr/src/go/jtip/src/runtime/syscall_windows_test.go:451 +0x406
testing.tRunner(0x10d774a0, 0x711084)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:455 +0x8f
created by testing.RunTests
    D:/opt/usr/src/go/jtip/src/testing/testing.go:560 +0x6e9

goroutine 1 [chan receive]:
testing.RunTests(0x657f3c, 0x7108e0, 0xaa, 0xaa, 0x59a401)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:561 +0x71b
testing.(*M).Run(0x10db9f7c, 0x10d27fa0)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:493 +0x68
main.main()
    runtime/_test/_testmain.go:880 +0x100

goroutine 102820 [chan receive]:
testing.(*T).Parallel(0x10d77b00)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:421 +0x65
runtime_test.TestStackGrowth(0x10d77b00)
    D:/opt/usr/src/go/jtip/src/runtime/stack_test.go:74 +0x25
testing.tRunner(0x10d77b00, 0x710f04)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:455 +0x8f
created by testing.RunTests
    D:/opt/usr/src/go/jtip/src/testing/testing.go:560 +0x6e9

goroutine 102821 [chan receive]:
testing.RunTests.func1(0x10d28380, 0x10d77b00)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:564 +0x3e
created by testing.RunTests
    D:/opt/usr/src/go/jtip/src/testing/testing.go:565 +0x765

goroutine 102823 [chan receive]:
testing.RunTests.func1(0x10d28380, 0x10d77b60)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:564 +0x3e
created by testing.RunTests
    D:/opt/usr/src/go/jtip/src/testing/testing.go:565 +0x765

goroutine 102822 [chan receive]:
testing.(*T).Parallel(0x10d77b60)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:421 +0x65
runtime_test.TestStackGrowthCallback(0x10d77b60)
    D:/opt/usr/src/go/jtip/src/runtime/stack_test.go:157 +0x25
testing.tRunner(0x10d77b60, 0x710f10)
    D:/opt/usr/src/go/jtip/src/testing/testing.go:455 +0x8f
created by testing.RunTests
    D:/opt/usr/src/go/jtip/src/testing/testing.go:560 +0x6e9
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Jul 28, 2015
@alexbrainman
Copy link
Member

@0x6a67 we don't use TDM64 on 32-bit OS. If you know how to fix this and feel like fixing it, http://golang.org/doc/contribute.html describes how to contribute. Thank you.

Alex

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

4 participants