BinaryBuilder.jl icon indicating copy to clipboard operation
BinaryBuilder.jl copied to clipboard

Single-member struct uses wrong ABI on win64

Open simonbyrne opened this issue 6 years ago • 13 comments

This is a gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64243

From https://github.com/JuliaLang/julia/issues/28325

cc: @barche

simonbyrne avatar Aug 01 '18 17:08 simonbyrne

I dream of using clang everywhere (if only flang was production ready)

vchuravy avatar Aug 01 '18 20:08 vchuravy

We can build clang for windows and ship it with our BinaryBuilder so that users can opt into it with CC=clang.

staticfloat avatar Aug 02 '18 00:08 staticfloat

Another possible workaround is building with MSVC, this is pretty easy using AppVeyor. But then there are other caveats due to not using the exact same compiler as the one used for Julia. Since this bug was reported with GCC in 2014 already, it doesn't seem to have a very high priority...

barche avatar Aug 02 '18 11:08 barche

We now ship a bevvy of compilers; you can opt-in to clang at any time, so I'm going to close this as fixed.

staticfloat avatar Dec 06 '19 00:12 staticfloat

With CxxWrap fully relying on BinaryBuilder binaries now, this came up again in the tests:

https://github.com/JuliaInterop/CxxWrap.jl/pull/274/checks?check_run_id=1622273928#step:5:54

I don't know if anyone reading this knows the GCC internals well enough to patch this? I could switch to clang for libcxxwrap-julia, but that would mean all the dependents need to make the switch too. Seems overkill for what appears to be a simple bug on the surface. Alternatively, I could attempt to pad the struct used for strictly typed numbers with an integer or something on Windows, but that seems like an ugly workaround, and it won't solve hard-to-catch errors if this manifests elsewhere.

barche avatar Dec 29 '20 23:12 barche

This is actually resolved upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64243

But GCC 9.1 is still affected, any chance we could upgrade the 9 series to 9.3 and maybe add GCC 10 too? Where and how are these compiler shards defined and built?

barche avatar Dec 30 '20 21:12 barche

and maybe add GCC 10 too?

https://github.com/JuliaPackaging/Yggdrasil/pull/2301

giordano avatar Dec 30 '20 22:12 giordano

Do we have the patch which fixed the issue? It might be worth backporting it as far as possible

giordano avatar Dec 30 '20 23:12 giordano

I have no idea when and in what commit this was fixed, unfortunately.

barche avatar Dec 31 '20 00:12 barche

@barche you can try GCC 10 ~here: https://github.com/JuliaPackaging/BinaryBuilderBase.jl/pull/96~ with BinaryBuilderBase#master

giordano avatar Jan 07 '21 02:01 giordano

What's the status of this?

fingolfin avatar Mar 21 '21 21:03 fingolfin

Should be fixed with GCC 10, the problem is that we can't really use GCC to build any C++ library at the moment

giordano avatar Mar 21 '21 22:03 giordano

I can confirm that setting preferred_gcc_version to version 10 fixes this.

barche avatar Apr 03 '21 23:04 barche