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 for Windows on compilers smaller than go1.10 #61

Closed
TimurIskandarov opened this issue Apr 13, 2022 · 1 comment
Closed

Build for Windows on compilers smaller than go1.10 #61

TimurIskandarov opened this issue Apr 13, 2022 · 1 comment

Comments

@TimurIskandarov
Copy link

TimurIskandarov commented Apr 13, 2022

Solution shared by one of our devs

https://developpaper.com/using-endless-in-windows-undefined-syscall-sigusr1/

Inside: C:\Program Files\Go\src\syscall\types_windows.go

var signals = [...]string{
    //Omit line n here....
    /**Compatible with Windows start*/
    16: "SIGUSR1",
    17: "SIGUSR2",
    18: "SIGTSTP",
    /**Compatible with windows end*/
}
/**Compatible with Windows start*/
func Kill(...interface{}) {
    return;
}
const (
    SIGUSR1 = Signal(0x10)
    SIGUSR2 = Signal(0x11)
    SIGTSTP = Signal(0x12)
)
/**Compatible with windows end*/

Originally posted by @kevincobain2000 in #35 (comment)

For example on go1.5.1, the C:\Go\src\syscall\types_windows.go file is missing, but
After you edit the C:\Go\src\syscall\ztypes_windows.go file you receive 10 warnings:
dll_windows.go 1 warning in func (p *Proc) Call(...) (...) {...},
exec_windows.go 1 warning in func joinExeDirAndFName(...) (...) {...},
zsyscall_windows.go 8 warnings possible misuse of unsafe.Pointer.
If it is enough to comment out the return keyword in the first two files, then it is not clear how to fix the last one.
Ideas?

https://cs.opensource.google/go/go/+/refs/tags/go1.5.1:src/syscall/
https://cs.opensource.google/go/go/+/refs/tags/go1.10:src/syscall/
изображение

@TimurIskandarov
Copy link
Author

fix: rename ztypes_windows.go to types_windows.go
If the fix did not help, then add a new fix file C:\Go\src\crypto\x509\root_windows.go
fix: in function checkChainSSLServerPolicy() , replace the string

	para := &syscall.CertChainPolicyPara{
		// ExtraPolicyPara: uintptr(unsafe.Pointer(sslPara)),
		ExtraPolicyPara: syscall.Pointer((unsafe.Pointer(sslPara))),
	}

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

No branches or pull requests

1 participant