From c74eb6f26edfdf6cfccdd5e34a3b23c69f22cd52 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 25 Aug 2024 13:13:07 +0200 Subject: [PATCH] WIP use LLVM 19 --- README.markdown | 10 +++++----- llvm_config_linux_llvm18.go | 2 +- llvm_config_linux_llvm19.go | 10 ++++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 llvm_config_linux_llvm19.go diff --git a/README.markdown b/README.markdown index e8b4126..3971a0b 100644 --- a/README.markdown +++ b/README.markdown @@ -4,13 +4,13 @@ This library provides bindings to a system-installed LLVM. Currently supported: - * LLVM 17, 16, 15 and 14 from [apt.llvm.org](http://apt.llvm.org/) on Debian/Ubuntu. - * LLVM 17, 16, 15 and 14 from Homebrew on macOS. - * LLVM 15 with a manually built LLVM through the `byollvm` build tag. You + * LLVM 19, 18, 17, 16, 15 and 14 from [apt.llvm.org](http://apt.llvm.org/) on Debian/Ubuntu. + * LLVM 18, 17, 16, 15 and 14 from Homebrew on macOS. + * LLVM 19 with a manually built LLVM through the `byollvm` build tag. You need to set up `CFLAGS`/`LDFLAGS` etc yourself in this case. -You can select the LLVM version using a build tag, for example `-tags=llvm14` -to use LLVM 14. +You can select the LLVM version using a build tag, for example `-tags=llvm17` +to use LLVM 17. ## Usage diff --git a/llvm_config_linux_llvm18.go b/llvm_config_linux_llvm18.go index 8010f03..a4bbea0 100644 --- a/llvm_config_linux_llvm18.go +++ b/llvm_config_linux_llvm18.go @@ -1,4 +1,4 @@ -//go:build !byollvm && linux && !llvm14 && !llvm15 && !llvm16 && !llvm17 +//go:build !byollvm && linux && llvm18 package llvm diff --git a/llvm_config_linux_llvm19.go b/llvm_config_linux_llvm19.go new file mode 100644 index 0000000..91cfcaf --- /dev/null +++ b/llvm_config_linux_llvm19.go @@ -0,0 +1,10 @@ +//go:build !byollvm && linux && !llvm14 && !llvm15 && !llvm16 && !llvm17 && !llvm18 + +package llvm + +// #cgo CPPFLAGS: -I/usr/include/llvm-19 -I/usr/include/llvm-c-19 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS +// #cgo CXXFLAGS: -std=c++17 +// #cgo LDFLAGS: -L/usr/lib/llvm-19/lib -lLLVM-19 +import "C" + +type run_build_sh int