v1-0001-Add-NO_LLVM_BITCODE-option-to-pgxs.patch
text/x-patch
Filename: v1-0001-Add-NO_LLVM_BITCODE-option-to-pgxs.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v1-0001
Subject: Add NO_LLVM_BITCODE option to pgxs.
| File | + | − |
|---|---|---|
| doc/src/sgml/extend.sgml | 9 | 0 |
| src/makefiles/pgxs.mk | 6 | 0 |
From e19a724fad4949bef9bc4d0f8e58719607d979be Mon Sep 17 00:00:00 2001
From: Xing Guo <higuoxing@gmail.com>
Date: Wed, 13 Mar 2024 07:56:46 +0800
Subject: [PATCH v1] Add NO_LLVM_BITCODE option to pgxs.
This patch adds a new option NO_LLVM_BITCODE to pgxs to allow user to
disable LLVM bitcode generation completely even if the PostgreSQL
installation is configured with --with-llvm.
---
doc/src/sgml/extend.sgml | 9 +++++++++
src/makefiles/pgxs.mk | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml
index 218940ee5c..6fe69746c2 100644
--- a/doc/src/sgml/extend.sgml
+++ b/doc/src/sgml/extend.sgml
@@ -1719,6 +1719,15 @@ include $(PGXS)
</listitem>
</varlistentry>
+ <varlistentry id="extend-pgxs-no-llvm-bitcode">
+ <term><varname>NO_LLVM_BITCODE</varname></term>
+ <listitem>
+ <para>
+ don't generate LLVM bitcode even if the current PostgreSQL installation is configured with <term><option>--with-llvm</option></term>
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="extend-pgxs-extra-clean">
<term><varname>EXTRA_CLEAN</varname></term>
<listitem>
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 0de3737e78..ec6a3c1f09 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -53,6 +53,8 @@
# that don't need their build products to be installed
# NO_INSTALLCHECK -- don't define an installcheck target, useful e.g. if
# tests require special configuration, or don't use pg_regress
+# NO_LLVM_BITCODE -- don't generate LLVM bitcode even if the current
+# PostgreSQL installation is configured with --with-llvm
# EXTRA_CLEAN -- extra files to remove in 'make clean'
# PG_CPPFLAGS -- will be prepended to CPPFLAGS
# PG_CFLAGS -- will be appended to CFLAGS
@@ -218,6 +220,10 @@ endef
all: $(PROGRAM) $(DATA_built) $(HEADER_allbuilt) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .control, $(EXTENSION))
+ifdef NO_LLVM_BITCODE
+with_llvm := no
+endif # NO_LLVM_BITCODE
+
ifeq ($(with_llvm), yes)
all: $(addsuffix .bc, $(MODULES)) $(patsubst %.o,%.bc, $(OBJS))
endif
--
2.44.0