Opened 4 weeks ago

Last modified 14 hours ago

#5733 new defect

Mixed use of compilers to build sources

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.4.3
Component: build Version: 3.4.x
Keywords: Cc:

Description

As odd as it seems, running make ends up using a mix of gcc and clang-14 on my system. Even for the same file. For example, under raster/rt_pg, an extract of the build logs:

grep rtpg_pixel.c build.log # returns:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I../../liblwgeom -I../../liblwgeom -I/usr/local/include  -I/usr/include/x86_64-linux-gnu   -I/usr/include/libxml2  -I/usr/include/json-c   -DNDEBUG -std=gnu99 -O2 -g -Wall -Wsuggest-attribute=format -fno-math-errno -fno-signed-zeros -Wall -O2 -I/usr/local/include -I../../libpgcommon -I/usr/include/x86_64-linux-gnu -I./../rt_core -I. -I./.. -I../.. -I. -I./ -I/usr/include/postgresql/15/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o rtpg_pixel.o rtpg_pixel.c
/usr/bin/clang-14 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I../../liblwgeom -I../../liblwgeom -I/usr/local/include  -I/usr/include/x86_64-linux-gnu   -I/usr/include/libxml2  -I/usr/include/json-c   -DNDEBUG -std=gnu99 -O2 -g -Wall -Wsuggest-attribute=format -fno-math-errno -fno-signed-zeros -Wall -O2 -I/usr/local/include -I../../libpgcommon -I/usr/include/x86_64-linux-gnu -I./../rt_core -I. -I./.. -I../.. -I. -I./ -I/usr/include/postgresql/15/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o rtpg_pixel.bc rtpg_pixel.c

It does look like something about LLVM but I don't see where that line comes from. I guess it's from PGXS.

The problem with this mix of compilers is that the same CFLAGS are passed to both but some flags are only supported by one compiler and not the other.

Change History (5)

comment:2 by strk, 4 weeks ago

make with_llvm=no fixes the problem for me

comment:3 by strk, 4 weeks ago

override with_llvm=no before the include of PGXS fixes it too

comment:4 by robe, 14 hours ago

@strk we need to remove PGXS from our logic. We should do so before PostGIS 3.5. I thought I had this ticketed somewhere.

The plan of PostgreSQL group is to get rid of PGXS and autoconf in favor of Meson. They've already switched most of their buildfarms to test using meson. E.g there msys/mingw no longer tests with autoconf, uses meson strictly. Last I checked they are working out some kinks with VS Studio (the usual problem child).

That said I believe Meson is the official build tool for PG17 and up. Come PG18 or later, they plan to completely remove autoconf.

comment:5 by robe, 14 hours ago

ah yes have it ticketed at #5281.

I've set to do for 3.5.0 milestone

Note: See TracTickets for help on using tickets.