Author Topic: LLVM Compiler Configuration  (Read 1571 times)

Offline Frank_CB

  • Almost regular
  • **
  • Posts: 127
LLVM Compiler Configuration
« on: March 13, 2022, 10:00:04 pm »
Has anyone been able to successfully configure a compiler in Codeblocks to use LLVM rather than c/c++ executables. I'm currently using NB 12748 and LLVM Release 13.0.1 on a Windows 10 (64-bit) system.  LLVM (Compiler Infrastructure Project) supposedly has made drop-in replacements for cl.exe, rc.exe and link.exe.

Any suggestions would be greatly appreciated!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7334
    • My Best Post
Re: LLVM Compiler Configuration
« Reply #1 on: March 13, 2022, 10:45:25 pm »
I used the Code::Blocks "LLVM Clang Compiler" toolchain settings with C::B version 20.03 SVN 11983.

Using MSys2 "mingw-w64-clang-x86_64-clang 13.0.1-3"

clang version 13.0.1
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/msys64/clang64/bin

-------------- Build: Debug in testclangc++ (compiler: LLVM Clang Compiler)---------------

clang++.exe -Weverything -fexceptions -g  -c H:\test_cbp\testclangc++\main.cpp -o obj\Debug\main.o
clang++.exe  -o bin\Debug\testclangc++.exe obj\Debug\main.o   
Output file is bin\Debug\testclangc++.exe with size 156.50 KB
Process terminated with status 0 (0 minute(s), 1 second(s))
0 error(s), 0 warning(s) (0 minute(s), 1 second(s))

It built and ran a simple hello world program okay; not done anything other than that.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
When in doubt, read the CB WiKi FAQ.

Offline Frank_CB

  • Almost regular
  • **
  • Posts: 127
Re: LLVM Compiler Configuration
« Reply #2 on: March 13, 2022, 11:14:12 pm »
Thanks @stahta01. This provides a place to start.  It's given me a couple of ideas.