NetBSD Problem Report #40093

From asau@inbox.ru  Wed Dec  3 07:07:33 2008
Return-Path: <asau@inbox.ru>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id E4C0E63BD2D
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  3 Dec 2008 07:07:32 +0000 (UTC)
Message-Id: <87hc5mv4o6.fsf@inbox.ru>
Date: Tue, 02 Dec 2008 20:59:53 +0300
From: Aleksej Saushev <asau@inbox.ru>
Reply-To:
To: gnats-bugs@gnats.NetBSD.org
Subject: bsd.lib.mk creates circular symlink when SHLIB_MINOR undefined

>Number:         40093
>Category:       pkg
>Synopsis:       bsd.lib.mk creates circular symlink when SHLIB_MINOR undefined
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 03 07:10:00 +0000 2008
>Closed-Date:    Thu Jun 18 05:32:10 +0000 2015
>Last-Modified:  Thu Jun 18 05:32:10 +0000 2015
>Originator:     Aleksej Saushev <asau@inbox.ru>
>Release:        NetBSD 5.99.01
>Organization:
>Environment:
System: NetBSD asau.local 5.99.01 NetBSD 5.99.01 (KERN) #0: Wed Nov 5 20:10:09 MSK 2008 asau@asau.local:/usr/obj/sys/arch/i386/compile/KERN i386
Architecture: i386
Machine: i386
>Description:
	When using bsd.lib.mk, one has to define both SHLIB_MAJOR and SHLIB_MINOR,
        with missing SHLIB_MINOR circular symlink is created at installation.
        bsd.README should've mentioned, that both variables are required for
        correct operation.

        NetBSD bsd.lib.mk's behaviour differs from the above: it just doesn't
        create symlinks, when SHLIB_MAJOR/SHLIB_MINOR variables are undefined.

        When comparing /usr/pkgsrc/pkgtools/bootstrap-mk-files/files/bsd.lib.mk
        and /usr/share/mk/bsd.lib.mk diff produces the following fragment:

 .if ${OBJECT_FMT} == "ELF"
-	ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
+#  We don't use INSTALL_SYMLINK here because this is just
+#  happening inside the build directory/objdir. XXX Why does
+#  this spend so much effort on libraries that aren't live??? XXX
+.if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
+    "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
+	${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
 	mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
-	ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
+.endif
+	${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
 	mv -f lib${LIB}.so.tmp lib${LIB}.so
 .endif

        Most probably, pkgsrc mk files are too old compared to NetBSD.
>How-To-Repeat:
	Build test library with SHLIB_MAJOR set and SHLIB_MAJOR unset,
        e.g. on FreeBSD 6.3 i386.
>Fix:
	Update bootstrap-mk-files?
        Fix documentation?

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 18 Jun 2015 05:32:10 +0000
State-Changed-Why:
duplicate of 40035


>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.