Re: Lower priority of the configure option --with-libraries causes wrong lib resolution
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Charles Samborski <demurgos@demurgos.net>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2025-06-15T20:26:01Z
Lists: pgsql-bugs
Charles Samborski <demurgos@demurgos.net> writes: > Swapping the two flags so the order is `-L/postgres-deps/lib -L/usr/lib` > fixes the build. I consider it very surprising that that libraries > passed with `--with-libraries` have lower priority, I would expect > explicitly requested libraries to have the highest priority. Ugh. > First, `/usr/lib` is added in the clang configuration [1]. It is > retrieved from `/usr/bin/llvm-config --ldflags`. I would pin the blame here. This code should not be messing with the global LDFLAGS. -L switches from llvm-config should probably go into LLVM_LIBS instead, so that they're only applied while linking llvmjit.so. (Compare the handling of -L switches from python or perl: those go into python_libspec or perl_embed_ldflags, they're not applied globally.) Can you check whether a change along that line fixes the problem in your environment? > My workaround is to update the configure script to instead prepend > `LIBDIRS` at the start of `LDFLAGS` using `LDFLAGS="$LIBDIRS $LDFLAGS"`. I don't think we'd accept that: it seems about as likely to break builds as fix them. Notably, users might've themselves modified LDFLAGS to contain -L switches. While that's not good practice IMO, we shouldn't make changes that are more sweeping than necessary. regards, tom lane
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Don't put library-supplied -L/-I switches before user-supplied ones.
- c5bd803e5816 13.22 landed
- bbc20c8a9ffd 16.10 landed
- a644f5fc66a3 17.6 landed
- 2dee95bd0cf1 14.19 landed
- 19857437b073 15.14 landed
- 8e5e3ff55641 18.0 landed
- 4300d8b6a79d 19 (unreleased) landed
-
psql: Change new \conninfo to use SSL instead of TLS
- 6d6480066c1a 18.0 cited