Disable LLVM bitcode generation with pgxs.mk framework.

Started by Xing Guoover 2 years ago5 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t49306
psql -h localhost -U postgres

Built from patchset v3 (message #3), September 20, 2026 at 04:45 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t49306_3 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t49306_3 && git checkout t49306_3

Patchset v3 (message #3) is on t49306_3

Jump to latest
#1Xing Guo
higuoxing@gmail.com

Hi hackers,

When the PostgreSQL server is configured with --with-llvm, the pgxs.mk
framework will generate LLVM bitcode for extensions automatically.
Sometimes, I don't want to generate bitcode for some extensions. I can
turn off this feature by specifying with_llvm=0 in the make command.

```
make with_llvm=0
```

Would it be possible to add a new switch in the pgxs.mk framework to
allow users to disable this feature? E.g., the Makefile looks like:

```
WITH_LLVM=no
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
```

Best Regards,
Xing

#2Daniel Gustafsson
daniel@yesql.se
In reply to: Xing Guo (#1)
Re: Disable LLVM bitcode generation with pgxs.mk framework.

On 12 Mar 2024, at 14:38, Xing Guo <higuoxing@gmail.com> wrote:

Would it be possible to add a new switch in the pgxs.mk framework to
allow users to disable this feature?

Something like that doesn't seem unreasonable I think.

--
Daniel Gustafsson

#3Xing Guo
higuoxing@gmail.com
In reply to: Daniel Gustafsson (#2)
Re: Disable LLVM bitcode generation with pgxs.mk framework.

On Tue, Mar 12, 2024 at 10:40 PM Daniel Gustafsson <daniel@yesql.se> wrote:

On 12 Mar 2024, at 14:38, Xing Guo <higuoxing@gmail.com> wrote:

Would it be possible to add a new switch in the pgxs.mk framework to
allow users to disable this feature?

Something like that doesn't seem unreasonable I think.

Thanks.

I added a new option NO_LLVM_BITCODE to pgxs. I'm not sure if the name
is appropriate.

Show quoted text

--
Daniel Gustafsson

Attachments:

t49306_3
v1-0001-Add-NO_LLVM_BITCODE-option-to-pgxs.patchtext/x-patch; charset=US-ASCII; name=v1-0001-Add-NO_LLVM_BITCODE-option-to-pgxs.patchDownload+15-1
#4Peter Eisentraut
peter_e@gmx.net
In reply to: Xing Guo (#1)
Re: Disable LLVM bitcode generation with pgxs.mk framework.

On 12.03.24 14:38, Xing Guo wrote:

When the PostgreSQL server is configured with --with-llvm, the pgxs.mk
framework will generate LLVM bitcode for extensions automatically.
Sometimes, I don't want to generate bitcode for some extensions. I can
turn off this feature by specifying with_llvm=0 in the make command.

```
make with_llvm=0
```

Would it be possible to add a new switch in the pgxs.mk framework to
allow users to disable this feature? E.g., the Makefile looks like:

```
WITH_LLVM=no
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
```

Can't you just put the very same with_llvm=0 into the makefile?

#5Xing Guo
higuoxing@gmail.com
In reply to: Peter Eisentraut (#4)
Re: Disable LLVM bitcode generation with pgxs.mk framework.

On Wed, Mar 13, 2024 at 2:45 PM Peter Eisentraut <peter@eisentraut.org> wrote:

On 12.03.24 14:38, Xing Guo wrote:

When the PostgreSQL server is configured with --with-llvm, the pgxs.mk
framework will generate LLVM bitcode for extensions automatically.
Sometimes, I don't want to generate bitcode for some extensions. I can
turn off this feature by specifying with_llvm=0 in the make command.

```
make with_llvm=0
```

Would it be possible to add a new switch in the pgxs.mk framework to
allow users to disable this feature? E.g., the Makefile looks like:

```
WITH_LLVM=no
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
```

Can't you just put the very same with_llvm=0 into the makefile?

Ah, you're right. I can set it by overriding that variable.

```
override with_llvm=no
```