Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBuTm-00000003RzF-0RW0 for pgsql-bugs@arkaria.postgresql.org; Wed, 30 Sep 2026 13:36:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xBuTk-00000002aTw-3P1z for pgsql-bugs@arkaria.postgresql.org; Wed, 30 Sep 2026 13:36:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBuTk-00000002aTo-2Jw7 for pgsql-bugs@lists.postgresql.org; Wed, 30 Sep 2026 13:36:12 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBuTi-000000022m7-29aJ for pgsql-bugs@lists.postgresql.org; Wed, 30 Sep 2026 13:36:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68UDa7p4769388; Wed, 30 Sep 2026 09:36:07 -0400 From: Tom Lane To: Ross Burton cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19727: pg-combinebackup fails to link In-reply-to: References: <19727-32d67d9dea410f38@postgresql.org> <599939.1790693300@sss.pgh.pa.us> <682272.1790695839@sss.pgh.pa.us> Comments: In-reply-to Ross Burton message dated "Wed, 30 Sep 2026 12:10:15 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <769386.1790775367.1@sss.pgh.pa.us> Date: Wed, 30 Sep 2026 09:36:07 -0400 Message-ID: <769387.1790775367@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ross Burton writes: > I now have a build tree that works and a build tree that breaks, from > the same machine and environment, simply by re-running the build with > make --shuffle. > The working jsonapi.o has functions like appendStringInfoChar, > resetStringInfo, etc. The one that fails to link has > appendPQExpBufferChar, resetPQExpBuffer, etc. > This is a makefile dependency bug exposed in parallel builds, and can > be reproduced on demand with a minimal reproducer. From a clean but > configured tree, in src/common: > $ make jsonapi.o > $ readelf -sW jsonapi.o | grep reset > 64: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND resetStringInfo > This builds a jsonapi.o using the direct target, and > JSONAPI_USE_PQEXPBUFFER is not defined. > $ make clean > $ make jsonapi_shlib.o > $ readelf -sW jsonapi.o | grep reset > 65: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND resetPQExpBuffer > This builds jsonapi_shlib.o, which adds JSONAPI_USE_PQEXPBUFFER to > CPPFLAGS. However jsonapi.o hasn't been built yet so that is also > built, but with the PQEXPBUFFER define set this time. Very interesting! So the problem is that the scope of the effects of this: jsonapi_shlib.o: override CPPFLAGS += -DJSONAPI_USE_PQEXPBUFFER isn't terribly well-defined. Looking at the rest of that Makefile, I'm also suspicious about $(OBJS_FRONTEND): CPPFLAGS += -DUSE_PRIVATE_ENCODING_FUNCS Can you break that part? If not, maybe the problem is the gratuitous-looking "override"? regards, tom lane