-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/link: support LLVM/Clang for MSVC #54811
Conversation
Detect which toolchain we are using. if using Clang for MSVC, don't pass those arguments that are not supported by MSVC to the linker.
This PR (HEAD: 364c579) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/427515 to see it. Tip: You can toggle comments from me using the |
I find the second problem today that is the program using Clang for MSVC can't be debugged in Go. Mingw/GCC has defferent C++ ABI from MSVC,so we can't use C++ library of MSVC in Mingw/GCC, We can build at least now....hm.... |
please use Gerrit for discussing the change, we don't use GitHub pull requests for this |
Message from 林志豪: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/427515. |
how use msvc complie cgo? |
@gatspy Please see https://go.dev/wiki/Questions. |
@gatspy you need:
now, your code in CGO can be compiled by compiler of MSVC. |
I find that cgo can compatible with LLVM/Clang for MSVC well actually.
The only problem I have found is that some arguments for linker of Mingw/GCC can't be used in linker of MSVC, so I write a judgement.
If go detect that the toolchain is LLVM/Clang for MSVC, do not pass those arguments that are not supported by linker of MSVC.