Well I have been using bleeding edge clang for a couple of years now, this 
is the first stable release version to break.
llvm-mingw is even the compiler the builders use so it's the opposite 
actually, it would be surprising for clang to not work.
See linked issue for reasons why the move to clang:
https://github.com/golang/go/issues/35006#issuecomment-1122405895

On Monday, 1 September 2025 at 2:25:51 am UTC+8 Jason E. Aten wrote:

> ah, I see you said "using clang20 works as expected", so I guess clang is 
> working fine
> on that version...
>
> On Sunday, August 31, 2025 at 7:23:47 PM UTC+1 Jason E. Aten wrote:
>
>> Hi Alex,
>>
>> I haven't worked with Go on Windows in a year, so my knowledge
>> might be out of date... That said, I found CGO very sensitive to
>> the exact C compiler used, and even within GCC, the exact version.
>> Here is the version that I had working at one point in the last couple of 
>> years:
>>
>> mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0 (somewhere on sourceforge I 
>> think).
>>
>> Mind you, I'm not saying you cannot get Clang to work. I'm just suggesting
>> that if you start with a positive control (that does let you build), then 
>> you
>> can confidently try other compilers knowing that everything else is held 
>> the same.
>>
>> Or you might have gotten what you need with the mingw-w64 gcc, and that's
>> good enough.  
>>
>> Let me know if you are able to make Clang work--it would be an 
>> interesting data point.
>>
>> Best,
>> Jason
>>
>> On Sunday, August 31, 2025 at 12:56:13 PM UTC+1 Alex wrote:
>>
>>> I am using the go compiler, this is about using cgo together with the go 
>>> compiler.
>>> And this was with the 1.24 and 1.25 toolchains 
>>>
>>> On Sunday, 31 August 2025 at 7:51:08 pm UTC+8 Michael Oguidan wrote:
>>>
>>>> Hi Alex, which version of Go are you using, and why don't use the 
>>>> actual Go compiler which is written in Go.
>>>>
>>>> On Sunday, August 31, 2025 at 8:15:39 AM UTC Alex wrote:
>>>>
>>>>> Been trying to use go with clang21 on windows but compiling any cgo 
>>>>> app results in "cannot parse *.o as ELF, Mach-O, PE or XCOFF"
>>>>>
>>>>> Tried with go1.24.* and 1.25, using clang20 works as expected.
>>>>
>>>>

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/8ddecf7d-985a-4491-8000-05511ed4c762n%40googlegroups.com.

Reply via email to