From owner-freebsd-ports@FreeBSD.ORG Mon Apr 21 07:11:51 2014 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91043643 for ; Mon, 21 Apr 2014 07:11:51 +0000 (UTC) Received: from mail-oa0-x22f.google.com (mail-oa0-x22f.google.com [IPv6:2607:f8b0:4003:c02::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5ADBE15EC for ; Mon, 21 Apr 2014 07:11:51 +0000 (UTC) Received: by mail-oa0-f47.google.com with SMTP id i11so3853975oag.6 for ; Mon, 21 Apr 2014 00:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=pyEHgCAze91g5sCpHMSndM4FXuFRlOAHhmo7tz1GnSg=; b=0WWvrOlGIbHjGPU0PSEDntHdOmbt6sV3xJj0fy/WYLv+ldqLjNBl2UcEkPHHXRGB4g lBmR/MDkgN8a2cUiHBacakSdDe7XF0RS6FMmUxkLtELymaHnkbdusNcRLjoxKRGvkT1X KlffmOAZC4exVopJEFVCEFY1NYm++V+hcBaVkQU9azJa2+rUh+G7p+H1StJ7BzkFJcgT GAM7+brpPl60VgKT7/JMExuQzUnHjeAnDTWJ0lW2BJygveXqkN0waV1zL02lHj1SSJoE P18Odi9jQaaKKf5mFbBJzuqbU9KlMYRqx01qGi+A8cr9iEeRE+hvWzheAyRO+g+JRruf RjFg== MIME-Version: 1.0 X-Received: by 10.60.15.38 with SMTP id u6mr30390882oec.26.1398064310695; Mon, 21 Apr 2014 00:11:50 -0700 (PDT) Sender: robbak@gmail.com Received: by 10.76.174.9 with HTTP; Mon, 21 Apr 2014 00:11:50 -0700 (PDT) Date: Mon, 21 Apr 2014 17:11:50 +1000 X-Google-Sender-Auth: uDLJDYicc4XPXk2ZZp3aJcyEJSI Message-ID: Subject: Problems with include and lib order From: Robert Backhaus To: ports@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 07:11:51 -0000 This is a problem which I think is happening at many places within the ports tree, but often isn't being recognised. Say a port uses liba and libz. Liba is a common, say graphics library port. It is a required port, and installs in /usr/local/include/liba.h and usr/local/lib/liba.so . Libz is also fairly common, and many of us have the port installed, again in /usr/local/{include|lib}, but this version is slightly incompatible with this port - It may build and run, but might trigger some hidden corner case. Because os this, the port builds it's own libz in $BUILDDIR/libs/libz. When the ports system/.configure/qmake/etc. system goes through all of this, it often ends up using g++ -I/usr/local/include -Ilibs/libz -osource.o source.cpp; and then linking with -L/usr/local/lib -Llibs/libz . This will DTWT. At the moment, this is dealt with on a piecemeal basis whenever it is recognized, wherever it causes build failures or gratuitous runtime problems. But this leaves cases where the failure only shows up as random crashes for a few people, or where the fault is in rare communications between peer clients I would like to see some ways to deal with this in a more generic way - changes within the qmake/autotools/ports system to always adjust include and lib path orders to move /usr/local/include to the very end. Or a 'real fix' - adjust all library ports to always install the include/lib files in /usr/local/{include|lib}/libname/... But that one would be too hard!