Re: 64bit initdb failure on macOS 10.11 and 10.12

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: rjhb(at)bb-c(dot)de (Rainer J(dot)H(dot) Brandt)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 64bit initdb failure on macOS 10.11 and 10.12
Date: 2017-07-04 19:23:07
Message-ID: 11968.1499196187@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

rjhb(at)bb-c(dot)de (Rainer J.H. Brandt) writes:
> I got this initdb error for a 64bit-build on macOS El Capitan and Sierra:

> creating conversions ... FATAL: could not load library "/opt/bb/170704/lib/postgresql/ascii_and_mic.so": dlopen(/opt/bb/170704/lib/postgresql/ascii_and_mic.so, 10): Symbol not found: _check_encoding_conversion_args
> Referenced from: /opt/bb/170704/lib/postgresql/ascii_and_mic.so
> Expected in: /opt/bb/170704/bin/postgres
> in /opt/bb/170704/lib/postgresql/ascii_and_mic.so

check_encoding_conversion_args() should certainly be there in any PG
version released since 2009 (see src/backend/utils/mb/wchar.c). But it's
unreferenced in the core Postgres executable, only in the loadable
conversion libraries. I wonder if you have somehow enabled a link-time
optimization to remove "unreferenced" symbols, or at least not export them
to libraries. Are you using Apple's stock toolchain, or something else?

> I configured with ./configure CC='gcc -m64' --prefix=/opt/bb/170704
> and also tried with CFLAGS=-m64 LDFLAGS=-m64.
> With the same procedures, but 32-bit-builds, I don't get this error,
> and everything works fine. Unfortunately, I need the 64-bit version.

This makes little sense to me. 64-bit builds have been the default on
macOS for some time.

It's possible that by overriding LDFLAGS you're removing linker switches
that need to be there ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rainer J.H. Brandt 2017-07-04 20:29:17 Re: 64bit initdb failure on macOS 10.11 and 10.12
Previous Message Tom Lane 2017-07-04 19:09:45 Re: Invalid field size