Menu

#570 Support mingw/clang

3.0 Series
open
nobody
None
5
2024-05-30
2023-03-24
No

We would like to use Clang instead of GCC.
It seems to work (if you link gcc and g++ to clang and clang++, respectively), except for the assembly files.
Clang has a -fno-integrated-as option, but I still did not manage to use as from binutils, so I had to resort on GCC.

Discussion

  • Anders

    Anders - 2023-03-31

    Only the System plug-in requires it so if you tell scons to skip that then at least you can build...

     
  • Milos Komarcevic

     

    Last edit: Milos Komarcevic 2024-05-30
  • Pier Angelo Vendrame

    Hi, eventually I managed to solve my assembler problems by adding GNU binutils to $PATH.
    Plus there are a couple of changes to do before being able to build with Clang:

    sed -i 's/-Wl,--exclude-libs,msvcrt.a/-Wl,-Xlink=-fixed/' SCons/Config/gnu
    sed -i '2i extern "C"' SCons/Config/{memcpy,memset}.c
    

    these lines come from Firefox's source code, check build-mingw32-nsis.sh there.
    Currently, for Tor Browser, Mullvad Browser and Ricochet Refresh (they share part of the build system) we use Clang to build NSIS.

    For aarch64 you will have to disable the system plugin, though, or reimplement the assembly module for aarch64.

     
  • Milos Komarcevic

    The MSYS2 team took a slightly different approach that builds on x86_64 only so far: https://github.com/msys2/MINGW-packages/pull/21003

     

Log in to post a comment.

MongoDB Logo MongoDB