From owner-p4-projects@FreeBSD.ORG Thu Jun 22 21:09:17 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6EA4D16A49A; Thu, 22 Jun 2006 21:09:17 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3290A16A492 for ; Thu, 22 Jun 2006 21:09:17 +0000 (UTC) (envelope-from bushman@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 361C843D5F for ; Thu, 22 Jun 2006 21:09:13 +0000 (GMT) (envelope-from bushman@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5ML9DUR012807 for ; Thu, 22 Jun 2006 21:09:13 GMT (envelope-from bushman@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5ML9CvM012804 for perforce@freebsd.org; Thu, 22 Jun 2006 21:09:12 GMT (envelope-from bushman@freebsd.org) Date: Thu, 22 Jun 2006 21:09:12 GMT Message-Id: <200606222109.k5ML9CvM012804@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bushman@freebsd.org using -f From: Michael Bushkov To: Perforce Change Reviews Cc: Subject: PERFORCE change 99830 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jun 2006 21:09:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=99830 Change 99830 by bushman@bushman_nss_ldap_cached on 2006/06/22 21:08:12 __weak_references on module registration functions were not properly replaced during statically linked application build. So there are no more __weak references used for these functions. libc.a always links them in from the nss-modules and libc.so uses stubs, defined in net/nss_stubs.c. The only drawback of this solution is that libc's Makefile now depends slightly more on bsd.lib.mk - because it now uses SOBJS variable, which can be considered an internal bsd.lib.mk variable. Affected files ... .. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/Makefile#6 edit .. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/nss_backends.h#4 edit .. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/nss_stubs.c#1 add Differences ... ==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/Makefile#6 (text+ko) ==== @@ -121,17 +121,26 @@ .endif NSS_STATIC+= ${.OBJDIR}/../libnssutil/libnssutil.a +# NSS-modules should be linked into the libc.a nss_static_modules.o: ${LD} -o ${.TARGET} -r --whole-archive ${NSS_STATIC} + +# libc.so should have stubs instead of module-load +# functions +nss_stubs.So: + ${CC} ${PICFLAG} -DPIC ${CFLAGS}\ + -c ${.CURDIR}/net/nss_stubs.c -o ${.TARGET} + .if ${MK_PROFILE} != "no" nss_static_modules.po: ${LD} -o ${.TARGET} -r --whole-archive ${NSS_STATIC} .endif -DPSRC= nss_static_modules.c +DPSRC= nss_static_modules.c nss_stubs.c STATICOBJS+= nss_static_modules.o -CLEANFILES+= nss_static_modules.o +SOBJS+= nss_stubs.So +CLEANFILES+= nss_static_modules.o nss_stubs.So .include ==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/nss_backends.h#4 (text+ko) ==== @@ -42,5 +42,5 @@ NSS_BACKEND( nis, _nis_nss_module_register ) #endif NSS_BACKEND( compat, _compat_nss_module_register ) -NSS_BACKEND( icmp, _icmp_nss_module_register ) +/* NSS_BACKEND( icmp, _icmp_nss_module_register ) */ #endif