Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#4606 closed defect (fixed)

libproj gets linked from /usr/lib when /usr/local/lib install exists

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.0.1
Component: build/upgrade/install Version: master
Keywords: Cc:

Description

I've been chasing this today and found out the culprit being an LDFLAGS variable set by the Makefile.global file (as included by pgxs.mk) to contain a -L switch pointing to a system directory.

GCC scans directories in the expected order /usr/local/lib first, then /usr/lib unless an explicit -L is given to point to /usr/lib.

This is what is happening: PostgreSQL PGXS machinery is forcing the system lib first.

This misbehavior can affect any other library for which you have multiple installs with the same library filename.

Luckly it can be fixed by re-defining LDFLAGS, which in this case is *missing* in postgis/Makefile.in

Setting LDFLAGS ourselves fixes this issue.

Change History (3)

comment:2 Changed 6 months ago by Sandro Santilli <strk@…>

Resolution: fixed
Status: newclosed

In 3485484/git:

Expliclty set LDFLAGS rather than letting PGXS do it

Fixes #4606

comment:3 Changed 6 months ago by Sandro Santilli <strk@…>

In b7da9ca/git:

Expliclty set LDFLAGS rather than letting PGXS do it

Fixes #4606 in 3.0 branch

Note: See TracTickets for help on using tickets.