pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/50800: Postfix-pgsql module missing pkgsrc rpath



>Number:         50800
>Category:       pkg
>Synopsis:       Postfix-pgsql module missing pkgsrc rpath
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 13 12:10:00 +0000 2016
>Originator:     Timshel Knoll-Miller
>Release:        NetBSD 6.1.5
>Organization:
	Fluent Development
>Environment:
System: NetBSD hopkins.fluentdevelopment.com.au 6.1.5 NetBSD 6.1.5 (GENERIC) amd64
Architecture: x86_64
Machine: amd64
>Description:

postfix-pgsql builds the lib/postfix/postfix-pgsql.so without linking including the /usr/pkg/lib rpath.
This means that the postgresql libpq.so.X library cannot be found at run time, causing the following error
to appear repeatedly in /var/log/maillog:

Feb 13 22:04:04 hopkins postfix/trivial-rewrite[22681]: fatal: load_library_symbols: dlopen failure loading /usr/pkg/lib/postfix/postfix-pgsql.so: Shared object "libpq.so.5" not found
Feb 13 22:04:05 hopkins postfix/master[16485]: warning: process /usr/pkg/libexec/postfix/trivial-rewrite pid 22681 exit status 1
Feb 13 22:04:05 hopkins postfix/master[16485]: warning: /usr/pkg/libexec/postfix/trivial-rewrite: bad command startup -- throttling

The linker can't find the postfix-pgsql module:
[timshel@hopkins pts/0 postfix-pgsql](0)$ ldd /usr/pkg/lib/postfix/postfix-pgsql.so 
/usr/pkg/lib/postfix/postfix-pgsql.so:
        -lpq.5 => not found
        -lc.12 => /usr/lib/libc.so.12
[timshel@hopkins pts/0 postfix-pgsql](0)$ 

The issue is caused as the postfix-pgsql Makefile refers incorrectly to the postgresql buildlink prefix variable
as "${BUILDLINK_PREFIX.pgsql}", which is empty (and so a -Wl,-rpath /lib gets passed to the gcc link command,
rather than the correct -Wl,-rpath /usr/pkg/lib).

Changing the variable reference to "${BUILDLINK_PREFIX.${PGSQL_TYPE}}" fixed the issue on my system.
A patch to that effect is included below.

>How-To-Repeat:
Build mail/postfix and mail/postfix-pgsql and start the server with /etc/rc.d/postfix start.
>Fix:
$NetBSD$

--- Makefile.orig	2016-02-13 10:56:58.000000000 +0000
+++ Makefile
@@ -13,7 +13,7 @@ POSTFIX_LIB_MKMAP=	no
 
 CCARGS+=		-I${PGSQL_PREFIX}/include
 AUXLIBS_MODULE=		-L${PGSQL_PREFIX}/lib -lpq				\
-			${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.pgsql}/lib
+			${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.${PGSQL_TYPE}}/lib
 
 .include "../../mk/pgsql.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"


Home | Main Index | Thread Index | Old Index