Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2yJ9-0007dI-QQ for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Jul 2021 15:57:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2yJ8-0005N0-PU for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Jul 2021 15:57:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2yJ8-0005Mp-Ip for pgsql-bugs@lists.postgresql.org; Mon, 12 Jul 2021 15:57:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2yJ6-0000oZ-GS for pgsql-bugs@lists.postgresql.org; Mon, 12 Jul 2021 15:57:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 16CFvIcw2971364; Mon, 12 Jul 2021 11:57:18 -0400 From: Tom Lane To: anilbommareddy09@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17100: undefined reference to `pg_qsort and pq_xxx In-reply-to: <17100-8838037599130224@postgresql.org> References: <17100-8838037599130224@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 12 Jul 2021 08:00:16 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2971362.1626105438.1@sss.pgh.pa.us> Date: Mon, 12 Jul 2021 11:57:18 -0400 Message-ID: <2971363.1626105438@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Build command: > ../configure --prefix=/path/to/pgsql-gcc CFLAGS='-O3 -flto' CXXFLAGS='-O3 > -flto' When I try that on that platform (well, actually RHEL 8.4, but should be close enough) I get a lot of complaints like ar: pgstrsignal.o: plugin needed to handle lto object ar: pqsignal.o: plugin needed to handle lto object ar: qsort.o: plugin needed to handle lto object ar: qsort_arg.o: plugin needed to handle lto object ar: quotes.o: plugin needed to handle lto object ar: snprintf.o: plugin needed to handle lto object so that the later complaints like /tmp/ccWzhmx0.ltrans29.ltrans.o: In function `_bt_preprocess_array_keys': :(.text+0x2d264): undefined reference to `qsort_arg' /tmp/ccWzhmx0.ltrans29.ltrans.o: In function `tblspc_desc': :(.text+0xdee): undefined reference to `appendStringInfo' :(.text+0xe0a): undefined reference to `appendStringInfo' aren't terribly surprising. Those functions should come out of libpqcommon.a, but seemingly that hasn't been built correctly. I'd say the conclusion is "don't use -flto, it doesn't really work yet on this platform". Or possibly there's some not-installed-by- default infrastructure you need to use it. Either way, this does not look like a Postgres bug; it's a compiler toolchain problem. regards, tom lane