Opened 7 months ago

Last modified 6 days ago

#5733 new defect

Mixed use of compilers to build sources

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.6.0
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 (8)

comment:2 by strk, 7 months ago

make with_llvm=no fixes the problem for me

comment:3 by strk, 7 months ago

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

comment:4 by robe, 6 months 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, 6 months ago

ah yes have it ticketed at #5281.

I've set to do for 3.5.0 milestone

comment:6 by pramsey, 4 months ago

Milestone: PostGIS 3.4.3PostGIS 3.4.4

in reply to:  5 comment:7 by robe, 3 months ago

Replying to robe:

ah yes have it ticketed at #5281.

I've set to do for 3.5.0 milestone

The #5281 was just to make sure a meson built PostgreSQL can compile and regress our code, but we still have references to PGXS in our scripts - for that I have created a #5796

comment:8 by robe, 6 days ago

Milestone: PostGIS 3.4.4PostGIS 3.6.0
Note: See TracTickets for help on using tickets.