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 1l07bh-0004J6-4v for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Jan 2021 18:44:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l07bf-0000hr-WA for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Jan 2021 18:44:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l07bf-0000hk-QU for pgsql-bugs@lists.postgresql.org; Thu, 14 Jan 2021 18:44:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l07bd-0000gZ-Sk for pgsql-bugs@postgresql.org; Thu, 14 Jan 2021 18:44:27 +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 10EIiJaT1419736; Thu, 14 Jan 2021 13:44:19 -0500 From: Tom Lane To: Heikki Linnakangas cc: Tim Kelly , pgsql-bugs@postgresql.org Subject: Re: questions about porting postgresql to older operating system In-reply-to: References: <600073D8.8010604@dialectronics.com> <1418718.1610648323@sss.pgh.pa.us> Comments: In-reply-to Heikki Linnakangas message dated "Thu, 14 Jan 2021 20:34:51 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1419734.1610649859.1@sss.pgh.pa.us> Date: Thu, 14 Jan 2021 13:44:19 -0500 Message-ID: <1419735.1610649859@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Heikki Linnakangas writes: > As it happens, I tried to build a completely static postgres binary > yesterday. I was debugging the failure on sparc64, and I found out about > user-space qemu, which can run binaries in binaries in a foreign > architecture directly without a virtual machine. However, it requires > that the binary is compiled statically. Cross-compiling a static > postgres binary was surprisingly easy on Debian, but when I tried to run > it, initdb failed because some library functions like getpweid() and > gethostaddr() didn't work when linked statically. That seems like an OS-level issue, not our fault. > The cross-compiler > warned about those, which was nice. I stubbed out a few of those library > functions, but eventually it failed on a call to dlopen(). That's where > I gave up. Yeah, initdb is going to try to open the shared libraries for plpgsql and all of the encoding-conversion modules (and maybe other stuff, but that's all I can think of offhand). For an initial porting attempt, it might be enough to cut out the parts of the bootstrap script that create the default conversions and the plpgsql extension. It's hard to believe you won't want plpgsql before long though. regards, tom lane