"=?utf-8?B?6ZmI5Lqa5p2w?=" <1441147871@qq.com> writes:
> Hello, I have a question about cross-compiling. I get an error when doing initdb for postgresql for arm64
architecturedevices.
> 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:
symbolnot 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