-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/build: add a Windows builder with clang #38755
Comments
Change https://golang.org/cl/291630 mentions this issue: |
Change https://golang.org/cl/291630 mentions this issue: |
Change https://golang.org/cl/291632 mentions this issue: |
Change https://golang.org/cl/291633 mentions this issue: |
Change https://golang.org/cl/291633 mentions this issue: |
… .bss section GCC and Clang both set the SizeOfRawData field rather than the VirtualSize field for communicating the size of the .bss section. As a consequence, LLD does not look at VirtualSize and collapses the .bss section into whatever is around it, resulting in runtime crashes. This commit changes the logic so that if the requested "file size" is 0, then the SizeOfRawData field is set rather than the VirtualSize field as the sole length marker. Fixes #44250. Fixes #39326. Updates #38755. Updates #36439. Updates #43800. Change-Id: Ied89ddaa0a717fed840238244c6e4848845aeeb6 Reviewed-on: https://go-review.googlesource.com/c/go/+/291630 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
This is only a valid option on ELF. Binutils accepts it, but LLVM rejects it, so for Windows, it's best to just omit it. Updates #44250. Updates #39326. Updates #38755. Updates #36439. Updates #43800. Change-Id: Iffd2345d757f23dd737e63bd464cd412527077c4 Reviewed-on: https://go-review.googlesource.com/c/go/+/291632 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Without setting these flags, LLVM's LLD ignores the .ctors section when merging objects. Updates #44250. Updates #39326. Updates #38755. Updates #36439. Updates #43800. Change-Id: I8766104508f7acd832088a590ee7d68afa0d6065 Reviewed-on: https://go-review.googlesource.com/c/go/+/291633 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
@jayconrod git master now has patches to make this work. Here's a toolchain you can use: https://github.com/mstorsjo/llvm-mingw/releases/download/20201020/llvm-mingw-20201020-msvcrt-x86_64.zip I've had good luck with this, and at some point we might consider encouraging the llvm toolchains, since only those support arm. |
Minor issue: when rebuilding my application using the llvm-lld linker, I have to delete my applications executable first or I get this message: go build json: build output "json.exe" already exists and is not an object file |
Can you let me know if f1562c7 fixes the issue for you? |
Give me half an hour. I also noticed that when I start a binary created with llvm-lld, it doesn't create a command line prompt. It is as if I had used the the -H WINDOWSGUI flag, even though I didn't. |
Yeah, seems to work. Thanks. |
In theory, we should be able to use either GCC or Clang on all platforms where cgo is supported. Currently, none of the Windows builders use Clang. It would be good to verify cgo works in that configuration.
The text was updated successfully, but these errors were encountered: