From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter J. Holzer <hjp-pgsql@hjp.at>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Building Extension on Linux fails with relocation error
Date: Fri, 22 Dec 2023 12:29:56 -0500
Message-ID: <1067412.1703266196@sss.pgh.pa.us> (raw)
In-Reply-To: <20231222165211.btdrstuwkileiyzh@hjp.at>
References: <CAAi87c1LHt54DaOGpuAMW2cXygU63v6W2-kEq6OYGjfYnKLzkQ@mail.gmail.com>
<1054188.1703259074@sss.pgh.pa.us>
<20231222165211.btdrstuwkileiyzh@hjp.at>
"Peter J. Holzer" <hjp-pgsql@hjp.at> writes:
> On 2023-12-22 10:31:14 -0500, Tom Lane wrote:
>> Binaek Sarkar <binaek@turbot.com> writes:
>>> Interestingly, the *build completes successfully when the .a file is
>>> smaller* (around 100 MB).
>> Pure luck I suspect.
> I seem to remember a 256MB limit for position independent code on x86.
> The current man-page for GCC doesn't mention such a limit, though, so I
> may be mistaken.
At least on x86, there is/was a shlib size boundary beyond which you
needed to generate different instructions with wider offset fields
in order to have position-independent code. Thus the difference
between -fpic and -fPIC. It's at least possible that the OP's Go
toolchain automatically uses -fpic, but I'm suspicious of that theory.
Usually you don't use either switch when building .a libraries.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, hjp-pgsql@hjp.at
Subject: Re: Building Extension on Linux fails with relocation error
In-Reply-To: <1067412.1703266196@sss.pgh.pa.us>
References: <CAAi87c1LHt54DaOGpuAMW2cXygU63v6W2-kEq6OYGjfYnKLzkQ@mail.gmail.com> <1054188.1703259074@sss.pgh.pa.us> <20231222165211.btdrstuwkileiyzh@hjp.at> <1067412.1703266196@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox