From 41eef58828a7a66173fa23615dcc204fcac3fde4 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 --- .github/workflows/test.yml | 4 ++-- README.markdown | 10 +++++----- llvm_config_linux_llvm18.go | 2 +- llvm_config_linux_llvm19.go | 10 ++++++++++ 4 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 llvm_config_linux_llvm19.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index acc0d92..90a4cd4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - llvm: [14, 15, 16, 17, 18] + llvm: [14, 15, 16, 17, 18, 19] steps: - name: Checkout uses: actions/checkout@v4 @@ -52,6 +52,6 @@ jobs: run: go test -v -tags=llvm${{ matrix.llvm }} - name: Test default LLVM - if: matrix.llvm == 18 + if: matrix.llvm == 19 run: go test -v 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