Quantcast

MinGW 32-Bit Support?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

MinGW 32-Bit Support?

Brian Cain via cfe-dev
Hi!

I've trouble building/running llvm+clang 4.0 with/from mingw 32 bit for
different mingw versions (4.9.y/5.x.y) [1]. When building in release
mode, llvm-tblgen.exe crashes. I can overcome this by explicitly
building llvm-tblgen.exe (and only that one) in debug mode, but then I
get funny crashes with libclang during parse operations.

I get no crashes for libclang parse operations from binaries produced by
MSVC2015 (for both, 32 and 64 bit) and mingw 64 bit.

According to clang's default target, it seems that llvm/clang is build
with MSVC nowadays, starting with version 3.8.x:

   D:\>D:\usr\llvm-3.7.1-win32\bin\clang --version
   clang version 3.7.1 (tags/RELEASE_371/final)
   Target: i686-pc-windows-gnu
   Thread model: posix

   D:\>D:\usr\llvm-3.8.1-win32\bin\clang --version
   clang version 3.8.1 (branches/release_38)
   Target: i686-pc-windows-msvc
   Thread model: posix
   InstalledDir: D:\usr\llvm-3.8.1-win32\bin


Does anybody know why this has changed? I'm asking because last time I
compared, libclang binaries build with mingw were significantly faster
than the ones from MSVC. In addition to this, the profile guided
optimization support of mingw produced faster binaries than the one
optimized with MSVC.

Can somebody reproduce [1] with mingw 32 bit?
Any plans to make a build bot/job for mingw 32 bit available (again?) so
that such errors will be caught earlier?

Nikolai


[1] https://bugs.llvm.org/show_bug.cgi?id=32018
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MinGW 32-Bit Support?

Brian Cain via cfe-dev
On Fri, Mar 24, 2017 at 7:45 AM, Nikolai Kosjar via cfe-dev <[hidden email]> wrote:
Hi!

I've trouble building/running llvm+clang 4.0 with/from mingw 32 bit for different mingw versions (4.9.y/5.x.y) [1]. When building in release mode, llvm-tblgen.exe crashes. I can overcome this by explicitly building llvm-tblgen.exe (and only that one) in debug mode, but then I get funny crashes with libclang during parse operations.

Some versions of GCC miscompile llvm-tblgen when targeting Windows: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78936 You should be able to check if this is the same issue by looking at the assembly produced for SubtargetEmitter.cpp and checking if it has the same mismatch between the call and the epilogue described in the bug.
 
I get no crashes for libclang parse operations from binaries produced by MSVC2015 (for both, 32 and 64 bit) and mingw 64 bit.

According to clang's default target, it seems that llvm/clang is build with MSVC nowadays, starting with version 3.8.x:

  D:\>D:\usr\llvm-3.7.1-win32\bin\clang --version
  clang version 3.7.1 (tags/RELEASE_371/final)
  Target: i686-pc-windows-gnu
  Thread model: posix

  D:\>D:\usr\llvm-3.8.1-win32\bin\clang --version
  clang version 3.8.1 (branches/release_38)
  Target: i686-pc-windows-msvc
  Thread model: posix
  InstalledDir: D:\usr\llvm-3.8.1-win32\bin

I think the downloads from llvm.org have always been built with MSVC since we started providing Windows binaries in LLVM 3.4, since that's what's Hans has been using since he took over release management. Something changed in how we compute our default target triple, but I wasn't able to find the commit that did it. In any case, the intention is that Clang is configured to target whatever it was built with by default, and the user can change that at runtime with --target or by rebuilding clang from source and reconfiguring it with a different default (-DLLVM_DEFAULT_TARGET_TRIPLE=whatever).

Does anybody know why this has changed? I'm asking because last time I compared, libclang binaries build with mingw were significantly faster than the ones from MSVC. In addition to this, the profile guided optimization support of mingw produced faster binaries than the one optimized with MSVC.

I couldn't say anything about the relative strengths of GCC vs MSVC PGO. I will say that in our experience, 64-bit clang is faster than 32-bit clang, and Clang is pretty good at optimizing Clang. So if you just want a faster compiler, you can build clang twice for 64-bit. You can set the default triple back to 32-bit if that's what you need.

Can somebody reproduce [1] with mingw 32 bit?
Any plans to make a build bot/job for mingw 32 bit available (again?) so that such errors will be caught earlier?

Nikolai


[1] https://bugs.llvm.org/show_bug.cgi?id=32018
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MinGW 32-Bit Support?

Brian Cain via cfe-dev
In reply to this post by Brian Cain via cfe-dev

Hello,

Cannot reproduce crash with 32 bit or 64 bit llvm-tblgen used with `llvm-4.0.0.src/lib/Target/X86/X86.td` and build from MSYS2 (GCC 6.3.0, binutils 2.28, mingw-w64 from git).

Regards,

Mateusz



------ Original Message ------
Subject: [cfe-dev] MinGW 32-Bit Support?
Date: Fri, 24 Mar 2017 15:45:37 +0100
To: Cfe-dev
From: Nikolai Kosjar Via Cfe-dev
Hi!

I've trouble building/running llvm+clang 4.0 with/from mingw 32 bit for different mingw versions (4.9.y/5.x.y) [1]. When building in release mode, llvm-tblgen.exe crashes. I can overcome this by explicitly building llvm-tblgen.exe (and only that one) in debug mode, but then I get funny crashes with libclang during parse operations.

I get no crashes for libclang parse operations from binaries produced by MSVC2015 (for both, 32 and 64 bit) and mingw 64 bit.

According to clang's default target, it seems that llvm/clang is build with MSVC nowadays, starting with version 3.8.x:

  D:\>D:\usr\llvm-3.7.1-win32\bin\clang --version
  clang version 3.7.1 (tags/RELEASE_371/final)
  Target: i686-pc-windows-gnu
  Thread model: posix

  D:\>D:\usr\llvm-3.8.1-win32\bin\clang --version
  clang version 3.8.1 (branches/release_38)
  Target: i686-pc-windows-msvc
  Thread model: posix
  InstalledDir: D:\usr\llvm-3.8.1-win32\bin


Does anybody know why this has changed? I'm asking because last time I compared, libclang binaries build with mingw were significantly faster than the ones from MSVC. In addition to this, the profile guided optimization support of mingw produced faster binaries than the one optimized with MSVC.

Can somebody reproduce [1] with mingw 32 bit?
Any plans to make a build bot/job for mingw 32 bit available (again?) so that such errors will be caught earlier?

Nikolai


[1] https://bugs.llvm.org/show_bug.cgi?id=32018
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

signature.asc (836 bytes) Download Attachment
Loading...