Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQLdf-0000Hu-Mh for pgsql-general@arkaria.postgresql.org; Wed, 15 Sep 2021 03:31:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mQLde-0000Hg-DN for pgsql-general@arkaria.postgresql.org; Wed, 15 Sep 2021 03:31:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQLde-0000HC-1y for pgsql-general@lists.postgresql.org; Wed, 15 Sep 2021 03:31:10 +0000 Received: from bumble.birch.relay.mailchannels.net ([23.83.209.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQLdW-0002WJ-0Q for pgsql-general@postgresql.org; Wed, 15 Sep 2021 03:31:09 +0000 X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 69289402A95; Wed, 15 Sep 2021 03:30:58 +0000 (UTC) Received: from a2ss24.a2hosting.com (100-96-99-44.trex-nlb.outbound.svc.cluster.local [100.96.99.44]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id A5A79402B67; Wed, 15 Sep 2021 03:30:57 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from a2ss24.a2hosting.com (a2ss24.a2hosting.com [75.98.175.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.99.44 (trex/6.4.3); Wed, 15 Sep 2021 03:30:58 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|bench@silentmedia.com X-MailChannels-Auth-Id: a2hosting X-Glossy-Bubble: 688a19686de6bc4e_1631676658268_3523233071 X-MC-Loop-Signature: 1631676658268:1183401734 X-MC-Ingress-Time: 1631676658268 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=silentmedia.com; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=s0oG4mfIGxTYa7jqmnPlNMUWQtjP6k7NDd53tChXNCk=; b=bPoY1+dBB9RIaAgyEVN+w+zA3l x2btkMEjTSVRZtaxdsULtCq9ahIQx0LwIBJ4PkhRa7cpzq8esZuezMkvKdbCy+QozTYHfWmoUgJic NQ6awAd00yy8TH6szCdT/9tmtpf86/uiWD7h88b2wNILfPqBr3yoesO8dcZb/P7Cf9slmcJ5FlwaZ GvPC4QgYlF1gwFPD38uEE32/knrtGqj5cMw7Cr7HBiUkFY2NpphwiUtDY1nRKrt1V/D9taFoWC6Wz nkO8TvsZxJy2wB4yLuiL/wxGLbMsmVKPdak8Cs/b/RfSeOzxo36A8Im2J1qwF0Nkn3mgMasXfVYoA 5LIRp6oQ==; Received: from 97-113-135-130.tukw.qwest.net ([97.113.135.130]:64318 helo=Rolo.local) by a2ss24.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mQLdQ-005lws-G4; Tue, 14 Sep 2021 23:30:56 -0400 Subject: Re: To JIT (or not!) in Ubuntu packages To: Thomas Munro Cc: pgsql-general , Christoph Berg References: <99811580-5219-c64b-fafd-808ae7aaf394@silentmedia.com> From: Ben Chobot Message-ID: Date: Tue, 14 Sep 2021 20:30:53 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:52.0) Gecko/20100101 PostboxApp/7.0.49 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------859A2CE74CFCC3B2F76D9E56" Content-Language: en-US X-AuthUser: bench@silentmedia.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------859A2CE74CFCC3B2F76D9E56 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Thomas Munro wrote on 9/14/21 5:50 PM: > On Tue, Sep 14, 2021 at 10:11 AM Ben Chobot wrote: >> We've noticed that the Ubuntu postgresql-12 package has --with-llvm >> enabled on x86_64, but not on aarch64. Does anybody know if this was >> intentional, or just an oversight? >> >> For what it's worth, it seems the beta postgresql-14 package for Ubuntu >> still doesn't have --with-llvm. >> >> I'm not sure if this explains why our aarch64 DBs are missing a >> jit_provider GUC variable, but I expect it does explain why >> pg_jit_available() tells me no. > Hmm. No Ubuntu here and I don't know the answer (CC Christoph). Can > you show exactly where the package is coming from, what pg_config > outputs. For what it's worth, it does look like it's enabled in the > Ubuntu aarch64 packages from apt.postgresql.org, according to a quick > look using caveman techniques: > > $ curl -sO http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/postgresql-14_14~beta3-1.pgdg+1_arm64.deb > $ ar x postgresql-14_14~beta3-1.pgdg+1_arm64.deb > $ tar xf data.tar.xz > $ strings usr/lib/postgresql/14/bin/postgres | grep 'with-llvm' > '--build=aarch64-linux-gnu' '--prefix=/usr' > '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' > '--infodir=${prefix}/share/info' '--sysconfdir=/etc' > '--localstatedir=/var' '--disable-option-checking' > '--disable-silent-rules' '--libdir=${prefix}/lib/aarch64-linux-gnu' > '--runstatedir=/run' '--disable-maintainer-mode' > '--disable-dependency-tracking' '--with-icu' '--with-tcl' > '--with-perl' '--with-python' '--with-pam' '--with-openssl' > '--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3' > '--mandir=/usr/share/postgresql/14/man' > '--docdir=/usr/share/doc/postgresql-doc-14' > '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' > '--datadir=/usr/share/postgresql/14' > '--bindir=/usr/lib/postgresql/14/bin' > '--libdir=/usr/lib/aarch64-linux-gnu/' > '--libexecdir=/usr/lib/postgresql/' > '--includedir=/usr/include/postgresql/' '--with-extra-version= (Debian > 14~beta3-1.pgdg+1)' '--enable-nls' '--enable-thread-safety' > '--enable-tap-tests' '--enable-debug' '--enable-dtrace' > '--enable-cassert' '--disable-rpath' '--with-uuid=e2fs' > '--with-gnu-ld' '--with-lz4' '--with-pgport=5432' > '--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm' > 'LLVM_CONFIG=/usr/bin/llvm-config-11' 'CLANG=/usr/bin/clang-11' > '--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' > 'PROVE=/usr/bin/prove' 'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet' > 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat > -Werror=format-security' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' > '--with-gssapi' '--with-ldap' 'build_alias=aarch64-linux-gnu' > 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 > -fstack-protector-strong -Wformat -Werror=format-security' > $ find . -name '*jit*.so' > ./usr/lib/postgresql/14/lib/llvmjit.so Ohh, interesting, I don't have that .so file. So I've installed http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/postgresql-14_14~beta3-1.pgdg18.04+1_arm64.deb, after which I see: $ /usr/lib/postgresql/14/bin/pg_config BINDIR = /usr/lib/postgresql/14/bin DOCDIR = /usr/share/doc/postgresql-doc-14 HTMLDIR = /usr/share/doc/postgresql-doc-14 INCLUDEDIR = /usr/include/postgresql PKGINCLUDEDIR = /usr/include/postgresql INCLUDEDIR-SERVER = /usr/include/postgresql/14/server LIBDIR = /usr/lib/aarch64-linux-gnu PKGLIBDIR = /usr/lib/postgresql/14/lib LOCALEDIR = /usr/share/locale MANDIR = /usr/share/postgresql/14/man SHAREDIR = /usr/share/postgresql/14 SYSCONFDIR = /etc/postgresql-common PGXS = /usr/lib/postgresql/14/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE =  '--build=aarch64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/aarch64-linux-gnu' '--libexecdir=${prefix}/lib/aarch64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--with-icu' '--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3' '--mandir=/usr/share/postgresql/14/man' '--docdir=/usr/share/doc/postgresql-doc-14' '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' '--datadir=/usr/share/postgresql/14' '--bindir=/usr/lib/postgresql/14/bin' '--libdir=/usr/lib/aarch64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' '--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu 14~beta2-1.pgdg18.04+1)' '--enable-nls' '--enable-thread-safety' '--enable-tap-tests' '--enable-debug' '--enable-dtrace' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' '--with-lz4' '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' 'PROVE=/usr/bin/prove' 'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' '--with-gssapi' '--with-ldap' 'build_alias=aarch64-linux-gnu' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security' CC = gcc CPPFLAGS = -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security CFLAGS_SL = -fPIC LDFLAGS = -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lselinux -llz4 -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lpthread -lrt -ldl -lm VERSION = PostgreSQL 14beta2 (Ubuntu 14~beta2-1.pgdg18.04+1) It's very similar output for PG12 from the same source. --------------859A2CE74CFCC3B2F76D9E56 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Thomas Munro wrote on 9/14/21 5:50 PM:
On Tue, Sep 14, 2021 at 10:11 AM Ben Chobot <bench@silentmedia.com> wrote:
We've noticed that the Ubuntu postgresql-12 package has --with-llvm
enabled on x86_64, but not on aarch64. Does anybody know if this was
intentional, or just an oversight?

For what it's worth, it seems the beta postgresql-14 package for Ubuntu
still doesn't have --with-llvm.

I'm not sure if this explains why our aarch64 DBs are missing a
jit_provider GUC variable, but I expect it does explain why
pg_jit_available() tells me no.
Hmm.  No Ubuntu here and I don't know the answer (CC Christoph).  Can
you show exactly where the package is coming from, what pg_config
outputs.  For what it's worth, it does look like it's enabled in the
Ubuntu aarch64 packages from apt.postgresql.org, according to a quick
look using caveman techniques:

$ curl -sO http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/postgresql-14_14~beta3-1.pgdg+1_arm64.deb
$ ar x postgresql-14_14~beta3-1.pgdg+1_arm64.deb
$ tar xf data.tar.xz
$ strings usr/lib/postgresql/14/bin/postgres | grep 'with-llvm'
 '--build=aarch64-linux-gnu' '--prefix=/usr'
'--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
'--infodir=${prefix}/share/info' '--sysconfdir=/etc'
'--localstatedir=/var' '--disable-option-checking'
'--disable-silent-rules' '--libdir=${prefix}/lib/aarch64-linux-gnu'
'--runstatedir=/run' '--disable-maintainer-mode'
'--disable-dependency-tracking' '--with-icu' '--with-tcl'
'--with-perl' '--with-python' '--with-pam' '--with-openssl'
'--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3'
'--mandir=/usr/share/postgresql/14/man'
'--docdir=/usr/share/doc/postgresql-doc-14'
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/'
'--datadir=/usr/share/postgresql/14'
'--bindir=/usr/lib/postgresql/14/bin'
'--libdir=/usr/lib/aarch64-linux-gnu/'
'--libexecdir=/usr/lib/postgresql/'
'--includedir=/usr/include/postgresql/' '--with-extra-version= (Debian
14~beta3-1.pgdg+1)' '--enable-nls' '--enable-thread-safety'
'--enable-tap-tests' '--enable-debug' '--enable-dtrace'
'--enable-cassert' '--disable-rpath' '--with-uuid=e2fs'
'--with-gnu-ld' '--with-lz4' '--with-pgport=5432'
'--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm'
'LLVM_CONFIG=/usr/bin/llvm-config-11' 'CLANG=/usr/bin/clang-11'
'--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p'
'PROVE=/usr/bin/prove' 'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet'
'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
-Werror=format-security' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now'
'--with-gssapi' '--with-ldap' 'build_alias=aarch64-linux-gnu'
'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2
-fstack-protector-strong -Wformat -Werror=format-security'
$ find . -name '*jit*.so'
./usr/lib/postgresql/14/lib/llvmjit.so
Ohh, interesting, I don't have that .so file.

So I've installed http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/postgresql-14_14~beta3-1.pgdg18.04+1_arm64.deb, after which I see:

$ /usr/lib/postgresql/14/bin/pg_config
BINDIR = /usr/lib/postgresql/14/bin
DOCDIR = /usr/share/doc/postgresql-doc-14
HTMLDIR = /usr/share/doc/postgresql-doc-14
INCLUDEDIR = /usr/include/postgresql
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/14/server
LIBDIR = /usr/lib/aarch64-linux-gnu
PKGLIBDIR = /usr/lib/postgresql/14/lib
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/postgresql/14/man
SHAREDIR = /usr/share/postgresql/14
SYSCONFDIR = /etc/postgresql-common
PGXS = /usr/lib/postgresql/14/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--build=aarch64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/aarch64-linux-gnu' '--libexecdir=${prefix}/lib/aarch64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--with-icu' '--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3' '--mandir=/usr/share/postgresql/14/man' '--docdir=/usr/share/doc/postgresql-doc-14' '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' '--datadir=/usr/share/postgresql/14' '--bindir=/usr/lib/postgresql/14/bin' '--libdir=/usr/lib/aarch64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' '--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu 14~beta2-1.pgdg18.04+1)' '--enable-nls' '--enable-thread-safety' '--enable-tap-tests' '--enable-debug' '--enable-dtrace' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' '--with-lz4' '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' 'PROVE=/usr/bin/prove' 'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' '--with-gssapi' '--with-ldap' 'build_alias=aarch64-linux-gnu' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
CC = gcc
CPPFLAGS = -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lselinux -llz4 -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lpthread -lrt -ldl -lm
VERSION = PostgreSQL 14beta2 (Ubuntu 14~beta2-1.pgdg18.04+1)

It's very similar output for PG12 from the same source.
--------------859A2CE74CFCC3B2F76D9E56--