From owner-freebsd-ports@FreeBSD.ORG Mon Dec 8 22:15:48 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 314101065672 for ; Mon, 8 Dec 2008 22:15:48 +0000 (UTC) (envelope-from bengta@P142.sics.se) Received: from sink.sics.se (sink.sics.se [193.10.64.88]) by mx1.freebsd.org (Postfix) with ESMTP id B7E508FC0C for ; Mon, 8 Dec 2008 22:15:47 +0000 (UTC) (envelope-from bengta@P142.sics.se) Received: from P142.sics.se (h206n3-u-d1.ias.bredband.telia.com [90.228.197.206]) by sink.sics.se (8.14.2/8.14.2) with ESMTP id mB8M0PM5079028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 8 Dec 2008 23:00:25 +0100 (CET) (envelope-from bengta@P142.sics.se) Received: from P142.sics.se (localhost [127.0.0.1]) by P142.sics.se (8.14.2/8.14.2) with ESMTP id mB8M1jB9001211; Mon, 8 Dec 2008 23:01:45 +0100 (CET) (envelope-from bengta@P142.sics.se) Received: (from bengta@localhost) by P142.sics.se (8.14.2/8.14.2/Submit) id mB8M1jT3001210; Mon, 8 Dec 2008 23:01:45 +0100 (CET) (envelope-from bengta@P142.sics.se) To: freebsd-ports@freebsd.org From: Bengt Ahlgren User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) Date: Mon, 08 Dec 2008 23:01:45 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: print/acroread8: LD_LIBRARY_PATH breaks helper programs X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 22:15:48 -0000 Hi! When testing acroread8 (on 7.1-PRE) I got the following error when trying to print using KDE's kprinter on i386: The following error occurred while printing... '/libexec/ld-elf.so.1: /usr/local/Adobe/Reader8/ENU/Adobe/Reader8/Reader/intellinux/lib/libstdc++.so.6: unsupported file layout' and on amd64: The following error occurred while printing... '/libexec/ld-elf.so.1: Shared object "libm.so.6" not found, required by "libstdc++.so.6"' The reason is that the acroread launch script sets LD_LIBRARY_PATH to: LD_LIBRARY_PATH=/usr/local/Adobe/Reader8/ENU/Adobe/Reader8/Reader/intellinux/lib:/usr/local/Adobe/Reader8/ENU/Adobe/Reader8/Reader/intellinux/sidecars:/..//usr/local/lib/linux-nvu which makes (some) helper programs fail to link its shared libs if it happens to pick up a (Linux) library from the above. libstdc++.so.6 is one of them. The problem is easily worked around for the print program - you can do "env -u LD_LIBRARY_PATH kprinter" for instance directly in the print dialogue. But that does not work for the browser executable set in the "edit/preferences/internet" dialogue. So if you want to be able to launch a browser from acroread, you need a wrapper script. Question: is there a proper fix for these problems??? I see that the Linux dynamic linker (/usr/compat/linux/lib/ld-linux.so.2) has a flag: --library-path PATH use given PATH instead of content of the environment variable LD_LIBRARY_PATH so I tried to patch the acroread launch script in /usr/local/Adobe/Reader8/ENU/Adobe/Reader8/bin with: --- acroread.orig 2008-10-08 06:28:27.000000000 +0200 +++ acroread 2008-12-08 22:59:46.000000000 +0100 @@ -16,7 +16,9 @@ LaunchBinary() { if [ "`uname -s`" = "Linux" ] && [ ! -x /lib/ld-lsb.so.3 ]; then - exec /lib/ld-linux.so.2 ${1+"$@"} + TEMP_LIB_PATH="$LD_LIBRARY_PATH" + unset LD_LIBRARY_PATH + exec /lib/ld-linux.so.2 --library-path "$TEMP_LIB_PATH" ${1+"$@"} else exec ${1+"$@"} fi which indeed works! Bengt