#19 Enable jit using llvm
Closed 2 years ago by fjanus. Opened 4 years ago by hhorak.
rpms/ hhorak/postgresql enable-jit  into  rawhide

file modified
+42 -1
@@ -46,6 +46,7 @@ 

  %{!?xml:%global xml 1}

  %{!?pam:%global pam 1}

  %{!?sdt:%global sdt 1}

+ %{!?llvm:%global llvm 1}

  %{!?selinux:%global selinux 1}

  %{!?runselftest:%global runselftest 1}

  
@@ -60,7 +61,7 @@ 

  Name: postgresql

  %global majorversion 11

  Version: 11.6

- Release: 2%{?dist}

+ Release: 3%{?dist}

  

  # The PostgreSQL license is very similar to other MIT licenses, but the OSI

  # recognizes it as an independent license, so we do as well.
@@ -174,6 +175,11 @@ 

  BuildRequires:	libicu-devel

  %endif

  

+ %if %llvm

+ BuildRequires: clang-devel

+ BuildRequires: llvm-devel

+ %endif

+ 

  # https://bugzilla.redhat.com/1464368

  %global __provides_exclude_from %{_libdir}/pgsql

  
@@ -286,6 +292,20 @@ 

  %endif

  

  

+ %if %llvm

+ %package llvmjit

+ Summary: Just-in-time compilation support for PostgreSQL

+ Requires: %{name}-server%{?_isa} = %precise_version

+ Requires: llvm

+ 

+ %description llvmjit

+ The postgresql-llvmjit package contains support for just-in-time compiling

+ parts of PostgreSQL queries. Using LLVM it compiles e.g. expressions and

+ tuple deforming into native code, with the goal of accelerating analytics

+ queries.

+ %endif

+ 

+ 

  %if %plperl

  %package plperl

  Summary: The Perl procedural language for PostgreSQL
@@ -471,6 +491,9 @@ 

  %if %icu

  	--with-icu

  %endif

+ %if %llvm

+ 	--with-llvm

+ %endif

  '

  

  %if %plpython3
@@ -1107,6 +1130,12 @@ 

  %{_libdir}/pgsql/pg_prewarm.so

  %{_libdir}/pgsql/pgoutput.so

  %{_libdir}/pgsql/plpgsql.so

+ %if %llvm

+ # Install bitcode directory along with the main package,

+ # so that extensions can use this dir.

+ # Inspired by upstream packaging.

+ %dir %{_libdir}/pgsql/bitcode

+ %endif

  %dir %{_libexecdir}/initscripts/legacy-actions/postgresql

  %{_libexecdir}/initscripts/legacy-actions/postgresql/*

  %{_libexecdir}/postgresql-check-db-dir
@@ -1179,6 +1208,14 @@ 

  %endif

  

  

+ %if %llvm

+ %files llvmjit

+ %{_libdir}/pgsql/bitcode/*

+ %{_libdir}/pgsql/llvmjit.so

+ %{_libdir}/pgsql/llvmjit_types.bc

+ %endif

+ 

+ 

  %if %plperl

  %files plperl -f plperl.lst

  %{_datadir}/pgsql/extension/plperl*
@@ -1215,6 +1252,10 @@ 

  

  

  %changelog

+ * Thu Feb 06 2020 Honza Horak <hhorak@redhat.com> - 11.6-3

+ - Enable jit using llvm

+   Resolves: #1758435

+ 

  * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 11.6-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

This is slightly inspired by upstream SRPM, so should result in pretty compatible sub-package postgresql-llvmjit.

+1 if CI passes, thank you

Thanks for the PR. I've already done some work on this for the postgresql:12 module package[1].

At a first glance, this looks good. I will review this PR in more detail shortly.

[1] https://src.fedoraproject.org/rpms/postgresql/c/f728a732bd77c8402af34ed0e16d3816bd218113?branch=stream-postgresql-12

LLVM is already present in the package.

Pull-Request has been closed by fjanus

2 years ago