Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Dec 2008 00:41:50 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Marcel Moolenaar <xcllnt@mac.com>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: svn commit: r185925 - in head/contrib/binutils: bfd gas/config ld/emulparams
Message-ID:  <86myezve0x.fsf@ds4.des.no>
In-Reply-To: <B6C8C00F-51D8-4FB1-85C8-51AEBB1B8B06@mac.com> (Marcel Moolenaar's message of "Thu, 11 Dec 2008 12:23:57 -0800")
References:  <20081211.100636.631212415.imp@bsdimp.com> <20081211.105808.-1186640207.imp@bsdimp.com> <A3EBA690-6598-4007-8E65-24F50FA2ECE3@mac.com> <20081211.130830.1365011002.imp@bsdimp.com> <B6C8C00F-51D8-4FB1-85C8-51AEBB1B8B06@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Marcel Moolenaar <xcllnt@mac.com> writes:
> It should be fairly easy for us to add it only when needed, given that
> we have different rules for building static vs shared libraries...

Not quite.  We have different rules, but they use the same CFLAGS.  The
"least intervention" to achieve what we want is to redefine the .c.o
rule in lib/libpam/modules/Makefile.inc; see attached patch.  A cleaner
solution would be to modify share/mk/sys.mk and share/mk/bsd.lib.mk to
add STATIC_CFLAGS and SHARED_CFLAGS variables, so we could simply set
STATIC_CFLAGS=3D-DOPENPAM_STATIC_MODULES in Makefile.inc.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment; filename=openpam_static_modules.diff
Content-Transfer-Encoding: quoted-printable


Property changes on: contrib/openpam
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /vendor/openpam/dist:r186064-186066

Index: contrib/openpam/include/security/openpam.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- contrib/openpam/include/security/openpam.h	(revision 186063)
+++ contrib/openpam/include/security/openpam.h	(working copy)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
- * Copyright (c) 2004-2007 Dag-Erling Sm=C3=B8rgrav
+ * Copyright (c) 2004-2008 Dag-Erling Sm=C3=B8rgrav
  * All rights reserved.
  *
  * This software was developed for the FreeBSD Project by ThinkSec AS and
@@ -32,7 +32,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: openpam.h 408 2007-12-21 11:36:24Z des $
+ * $Id: openpam.h 418 2008-12-13 22:39:24Z des $
  */
=20
 #ifndef SECURITY_OPENPAM_H_INCLUDED
@@ -309,18 +309,17 @@
  * Infrastructure for static modules using GCC linker sets.
  * You are not expected to understand this.
  */
-#if defined(__FreeBSD__)
+#if !defined(PAM_SOEXT)
 # define PAM_SOEXT ".so"
-#else
-# undef NO_STATIC_MODULES
-# define NO_STATIC_MODULES
 #endif
=20
-#if defined(__GNUC__) && !defined(__PIC__) && !defined(NO_STATIC_MODULES)
+#if defined(OPENPAM_STATIC_MODULES)
+# if !defined(__GNUC__)
+#  error "Don't know how to build static modules on non-GNU compilers"
+# endif
 /* gcc, static linking */
 # include <sys/cdefs.h>
 # include <linker_set.h>
-# define OPENPAM_STATIC_MODULES
 # define PAM_EXTERN static
 # define PAM_MODULE_ENTRY(name)						\
 	static char _pam_name[] =3D name PAM_SOEXT;			\
Index: lib/libpam/modules/Makefile.inc
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lib/libpam/modules/Makefile.inc	(revision 186063)
+++ lib/libpam/modules/Makefile.inc	(working copy)
@@ -19,4 +19,7 @@
 LDADD+=3D		-lpam
 .endif
=20
+.c.o:
+	${CC} ${CFLAGS} -DOPENPAM_STATIC_MODULES -c ${.IMPSRC}
+
 .include "../Makefile.inc"

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86myezve0x.fsf>