NetBSD Problem Report #33665

From jewell@MIT.EDU  Wed Jun  7 20:50:17 2006
Return-Path: <jewell@MIT.EDU>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id B23BB63BA6E
	for <gnats-bugs@gnats.netbsd.org>; Wed,  7 Jun 2006 20:50:16 +0000 (UTC)
Message-Id: <qqk67siz22.fsf@mit.edu>
Date: 07 Jun 2006 14:46:29 -0400
From: "Darrin B.Jewell" <dbj@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: "Darrin B.Jewell" <dbj@netbsd.org>, gdt@netbsd.org
Subject: g-wrap Makefile needs to set LTDL_LIBRARY_PATH

>Number:         33665
>Category:       pkg
>Synopsis:       g-wrap Makefile needs to set LTDL_LIBRARY_PATH
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gdt
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 07 20:55:00 +0000 2006
>Closed-Date:    
>Last-Modified:  Thu Apr 10 04:14:06 +0000 2008
>Originator:     Darrin B. Jewell
>Release:        pkgsrc-2006Q1 branch updated via cvs ~20060605T1828Z
>Organization:
>Environment:

$ uname -a
Darwin Quiteria 8.6.0 Darwin Kernel Version 8.6.0: Tue Mar  7 16:58:48 PST 2006; root:xnu-792.6.70.obj~1/RELEASE_PPC Power Macintosh powerpc

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.4.6
BuildVersion:	8I127

$ powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5341)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cat /Developer/Applications/Xcode.app/Contents/version.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>BuildVersion</key>
        <string>10</string>
        <key>CFBundleShortVersionString</key>
        <string>2.3</string>
        <key>CFBundleVersion</key>
        <string>744</string>
        <key>ProjectName</key>
        <string>DevToolsIDE</string>
        <key>SourceVersion</key>
        <string>7440000</string>
</dict>
</plist>

>Description:

I build pkgsrc on Darwin using 
  env -i PATH=/bin:/usr/bin /usr/pkg/bin/bmake update
which highlights environment variable issues when building.

Building g-wrap on Darwin requires the LTDL_LIBRARY_PATH to be set
or else it dies with an error like the following:

[...]
  (use-modules (g-wrap)) \
                 (use-modules (g-wrap guile)) \
                         (use-modules (g-wrap guile ws standard)) \
                         (generate-wrapset 'guile 'standard \"standard\")"
  /usr/pkg/share/guile/1.6/srfi/srfi-13.scm:159:1: In procedure dynamic-link in expression (load-extension "libguile-srfi-srfi-13-14-v-1" "scm_init_srfi_13"):
  /usr/pkg/share/guile/1.6/srfi/srfi-13.scm:159:1: file: "libguile-srfi-srfi-13-14-v-1", message: "dlopen(libguile-srfi-srfi-13-14-v-1.so, 9): image not found"

  Some deprecated features have been used.  Set the environment
  variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
  program to get more information.  Set it to "no" to suppress
  this message.
  gnumake[4]: *** [standard.c] Error 2
  gnumake[3]: *** [all-recursive] Error 1
  gnumake[2]: *** [all-recursive] Error 1
  gnumake[1]: *** [all-recursive] Error 1
  gnumake: *** [all] Error 2
  *** Error code 2

  Stop.
  bmake: stopped in /u3/n/z/pkgsrc/devel/g-wrap
  ===> 
  ===> There was an error during the ``build'' phase.
  ===> Please investigate the following for more information:
  ===>      * log of the build
  ===>      * /u2/n/z/work/devel/g-wrap/work/.work.log
  ===> 
  *** Error code 1

  Stop.
  bmake: stopped in /u3/n/z/pkgsrc/devel/g-wrap
  *** Error code 1



>How-To-Repeat:

cd pkgsrc/devel/glib
env -i PATH=/bin:/usr/bin /usr/pkg/bin/bmake update

>Fix:

The following patch fixes the problem.  However, it may better
to set the environment variable in libltdl's buildlink3.mk
file or something.

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/g-wrap/Makefile,v
retrieving revision 1.42
diff -u -u -r1.42 Makefile
--- Makefile	5 Mar 2006 16:27:24 -0000	1.42
+++ Makefile	7 Jun 2006 18:45:17 -0000
@@ -18,6 +18,8 @@
 TEST_TARGET=		check
 INFO_FILES=		g-wrap.info

+MAKE_ENV+=		LTDL_LIBRARY_PATH=${LOCALBASE}/lib
+
 pre-install:
 	${INSTALL_DATA_DIR} ${PREFIX}/share/guile/site/g-wrap/guile/ws


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->gdt
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Sat, 10 Jun 2006 08:12:02 +0000
Responsible-Changed-Why:
Over to maintainer (contains patch).

patch applied, conditional on Darwin.  works now?


State-Changed-From-To: open->feedback
State-Changed-By: gdt@netbsd.org
State-Changed-When: Sat, 07 Oct 2006 20:34:52 +0000
State-Changed-Why:
patch applied


From: "Darrin B.Jewell" <dbj@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: gdt@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	gdt@netbsd.org
Subject: Re: pkg/33665 (g-wrap Makefile needs to set LTDL_LIBRARY_PATH)
Date: 07 Oct 2006 15:14:54 -0700

 I've actually investigated this quite a bit further, but haven't
 had the chance to write it up.  Instead of the original patch, I have
 been running more recently with the patch included below to the guile
 buildlink support, which adds this for all guile dependent packages,
 but it's basically the same idea.

 I've tracked this down much further and determed that on most
 platforms, the ltdl will eventually fall back to the system dlopen
 which will look in the rpath coded in the binary.  However, darwin
 doesn't have an rpath, and instead uses abolute paths on each of the
 libraries listed in a binary.  (There is a tools for editing them if
 they move, install_name_tool(1)).  Therefore darwin requires the
 environment var to be set for guile to find its modules, since
 loaded modules do not have an abolute path in the binary.

 Btw, guile doesn't need a buildlink or dependency on devel/libltdl,
 it ships with its own modified copy of ltdl which is the one it
 seems to be using.

 Thanks,
 Darrin

 Index: buildlink3.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/lang/guile/buildlink3.mk,v
 retrieving revision 1.11
 diff -u -r1.11 buildlink3.mk
 --- buildlink3.mk       8 Jul 2006 23:10:55 -0000       1.11
 +++ buildlink3.mk       7 Oct 2006 21:53:59 -0000
 @@ -17,7 +17,12 @@
  BUILDLINK_PKGSRCDIR.guile?=    ../../lang/guile
  .endif # GUILE_BUILDLINK3_MK

 +.include "../../mk/bsd.prefs.mk"
 +.if ${OPSYS} == "Darwin"
 +CONFIGURE_ENV+=                LTDL_LIBRARY_PATH=${LOCALBASE}/lib
 +MAKE_ENV+=             LTDL_LIBRARY_PATH=${LOCALBASE}/lib
 +.endif
 +
  .include "../../devel/libltdl/buildlink3.mk"
  .include "../../devel/ncurses/buildlink3.mk"
  .include "../../devel/readline/buildlink3.mk"
  .include "../../mk/pthread.buildlink3.mk"

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 10 Apr 2008 04:14:06 +0000
State-Changed-Why:
feedback received, in 2006 - another change requested


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.