Re: about cross-compiling issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: 陈亚杰 <1441147871(at)qq(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: about cross-compiling issue
Date: 2024-05-23 15:10:49
Message-ID: 350134.1716477049@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"=?utf-8?B?6ZmI5Lqa5p2w?=" <1441147871(at)qq(dot)com> writes:
> Hello, I have a question about cross-compiling. I get an error when doing initdb for postgresql for arm64 architecture devices.
> The error information is Error relocating /data/postgresql/postgresql-16.3-arm64-v8a-build/tmp_install/usr/postgresql/arm64-v8a/lib/dict_snowball.so: palloc0: symbol not found.

We don't really support cross-compiling, because there are too many
things that the configure script can't check for if it can't run a
test program. In this particular case I think what is biting you
is that configure won't add -Wl,--export-dynamic to the backend
link switches.

You might think that that shouldn't require a test program to
verify, but c-compiler.m4 says differently:

# Given a string, check if the compiler supports the string as a
# command-line option. If it does, add to the given variable.
# For reasons you'd really rather not know about, this checks whether
# you can link to a particular function, not just whether you can link.
# In fact, we must actually check that the resulting program runs :-(

This check dates to 2008, and maybe it's no longer necessary on
any modern system, but I'm unexcited about trying to find out.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2024-05-23 15:13:07 Re: speed up a logical replica setup
Previous Message Alena Rybakina 2024-05-23 14:16:14 Re: Sort operation displays more tuples than it contains its subnode