From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Mar 13 01:50:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BDC75914 for ; Wed, 13 Mar 2013 01:50:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8876D85A for ; Wed, 13 Mar 2013 01:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r2D1o0jX068778 for ; Wed, 13 Mar 2013 01:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r2D1o0Sw068777; Wed, 13 Mar 2013 01:50:00 GMT (envelope-from gnats) Resent-Date: Wed, 13 Mar 2013 01:50:00 GMT Resent-Message-Id: <201303130150.r2D1o0Sw068777@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Marakasov Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E039F607 for ; Wed, 13 Mar 2013 01:44:29 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.116.15]) by mx1.freebsd.org (Postfix) with ESMTP id 9CAE1820 for ; Wed, 13 Mar 2013 01:44:29 +0000 (UTC) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1UFaju-0000kR-4Z for FreeBSD-gnats-submit@freebsd.org; Wed, 13 Mar 2013 05:44:22 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 8F95CB84D for ; Wed, 13 Mar 2013 05:44:21 +0400 (MSK) Received: by hades.panopticon (Postfix, from userid 1000) id 728C2614; Wed, 13 Mar 2013 05:44:21 +0400 (MSK) Message-Id: <20130313014421.728C2614@hades.panopticon> Date: Wed, 13 Mar 2013 05:44:21 +0400 (MSK) From: Dmitry Marakasov To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/176901: [bsd.cmake.mk] disable rpath removal X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Dmitry Marakasov List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Mar 2013 01:50:00 -0000 >Number: 176901 >Category: ports >Synopsis: [bsd.cmake.mk] disable rpath removal >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 13 01:50:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Dmitry Marakasov >Release: FreeBSD 9.0-RELEASE-p3 amd64 >Organization: >Environment: System: FreeBSD hades.panopticon 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Wed Jun 13 17:39:20 MSK 2012 root@hades.panopticon:/usr/obj/usr/src/sys/HADES amd64 >Description: When cmake builds a binary or a library, it adds an RPATH to it pointing to the build directory. This is needed so when a binary is ran from the build directory, it's able to find all its libraries without using LD_LIBRARY_PATH. When cmake installs binaries, RPATHs are removed, as installed software will pick its libraries from the systemwide path known to dynamic linker. However, cmake removes _all_ RPATHs, including ones explicitly provided via e.g. LDFLAGS. The problem arises when the port is build with newer gcc (USE_GCC=4.6+). The resulting binaries may depend on C++ features (for example, C++11 bits) support for whuch is only present in newer gcc's libstdc++ (/usr/local/lib/gcc46/libstdc++.so), but not in the base system /usr/lib/libstdc++.so. The former rpath is added by bsd.gcc.mk, but it has no effect as cmake removes it. In result, a binary will use /usr/lib/libstdc++.so, and won't run with the following message: /usr/lib/libstdc++.so.6: version GLIBCXX_3.4.11 required by not found This may be fixed by adding LD_LIBRARY_PATH=/usr/local/lib/gcc46 to the environement. To fix that globally I propose the attached path. It disables adding build rpath to the binaries (we don't need it since ports are not intended to be ran from work/ anyway), which as well makes cmake _not_ remove RPATHs from installed binaries. With it, binaries use correct libstdc++ from the newer gcc and run without LD_LIBRARY_PATH hacks. I'm not sure which side effects it may have, so exp-run is advised. >How-To-Repeat: >Fix: --- bsd.cmake.mk.patch begins here --- Index: Mk/bsd.cmake.mk =================================================================== --- Mk/bsd.cmake.mk (revision 311274) +++ Mk/bsd.cmake.mk (working copy) @@ -61,7 +61,8 @@ -DCMAKE_SHARED_LINKER_FLAGS:STRING="${LDFLAGS}" \ -DCMAKE_INSTALL_PREFIX:PATH="${CMAKE_INSTALL_PREFIX}" \ -DCMAKE_BUILD_TYPE:STRING="${CMAKE_BUILD_TYPE}" \ - -DTHREADS_HAVE_PTHREAD_ARG:BOOL=YES + -DTHREADS_HAVE_PTHREAD_ARG:BOOL=YES \ + -DCMAKE_SKIP_BUILD_RPATH:BOOL=YES # # Default build type and sourcedir --- bsd.cmake.mk.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: