Re: Build issue with postgresql 17 undefined reference to `pg_encoding_to_char' and `pg_char_to_encoding'

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Mikael Sand <msand(at)seaber(dot)io>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Build issue with postgresql 17 undefined reference to `pg_encoding_to_char' and `pg_char_to_encoding'
Date: 2024-10-10 17:53:57
Message-ID: CAJ7c6TOGa9CJF0viHvLxcZ3R07ouLFZ1jyBYnnWb9veH8aw_vQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mikael,

On Thu, Oct 10, 2024 at 8:49 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Mikael Sand <msand(at)seaber(dot)io> writes:
> > RUN clang++ -fno-common -static -o main main.cpp \
> > -L/usr/local/lib -lpq -lpgcommon -lpgport \
> > -lldap -lsasl2 -lssl -lcrypto -llber \
> > -lgssapi_krb5 \
> > -lkrb5 -lk5crypto -lcom_err -lkrb5support \
> > -lgdbm
>
> The short answer here is that your link recipe is wrong, and has been
> wrong right along, though you accidentally got away with it before.
> The modules within libpq expect to be linked with libpgcommon_shlib
> and libpgport_shlib, not libpgcommon/libpgport.
>
> Having external code that needs to know explicitly about every one
> of a library's dependencies is one of many reasons why we discourage
> static linking.

May I ask what problem you are trying to solve with static linking in
the first place?

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikael Sand 2024-10-10 17:54:13 Re: Annoying build warnings from latest Apple toolchain
Previous Message Tom Lane 2024-10-10 17:49:02 Re: Build issue with postgresql 17 undefined reference to `pg_encoding_to_char' and `pg_char_to_encoding'