From owner-freebsd-mips@FreeBSD.ORG Thu Dec 11 20:04:09 2008 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F4581065693 for ; Thu, 11 Dec 2008 20:04:09 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout011.mac.com (asmtpout011.mac.com [17.148.16.86]) by mx1.freebsd.org (Postfix) with ESMTP id 7B32B8FC13 for ; Thu, 11 Dec 2008 20:04:09 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Received: from vupadhyaya-t43.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KBQ00G0J7M9DT40@asmtp011.mac.com> for freebsd-mips@freebsd.org; Thu, 11 Dec 2008 11:03:46 -0800 (PST) Message-id: From: Marcel Moolenaar To: "M. Warner Losh" In-reply-to: <20081211.105808.-1186640207.imp@bsdimp.com> Content-transfer-encoding: quoted-printable Date: Thu, 11 Dec 2008 11:03:45 -0800 References: <200812110822.mBB8MKLd059320@svn.freebsd.org> <86oczjklk8.fsf@ds4.des.no> <20081211.100636.631212415.imp@bsdimp.com> <20081211.105808.-1186640207.imp@bsdimp.com> X-Mailer: Apple Mail (2.929.2) Cc: des@des.no, freebsd-mips@freebsd.org Subject: Re: svn commit: r185925 - in head/contrib/binutils: bfd gas/config ld/emulparams X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 20:04:09 -0000 On Dec 11, 2008, at 9:58 AM, M. Warner Losh wrote: > In message: <20081211.100636.631212415.imp@bsdimp.com> > "M. Warner Losh" writes: > : In message: <86oczjklk8.fsf@ds4.des.no> > : Dag-Erling_Sm=F8rgrav writes: > : : Warner Losh writes: > : : > Author: imp > : : > Date: Thu Dec 11 08:22:20 2008 > : : > New Revision: 185925 > : : > URL: http://svn.freebsd.org/changeset/base/185925 > : : > > : : > Log: > : : > Push mips support into the tree. > : : > : : Just to pick a random mips commit - > : : > : : There is something wrong with the mips toolchain. The build =20 > breaks in > : : libpam, while building the static version, which includes all =20 > modules: > : > : Something is wrong either with the toolchain or with PAM's > : assumptions. I've not tracked it down further than that yet, but I > : think the latter. Let me explain. > : > : : ../modules/pam_deny/libpam_deny.a(pam_deny.o)(.text+0x3c): In =20 > function `pam_sm_open_session': > : : /src/lib/libpam/modules/pam_deny/pam_deny.c:80: multiple =20 > definition of `pam_sm_open_session' > : : ../modules/pam_chroot/libpam_chroot.a(pam_chroot.o)(.text+0x14):/=20= > src/lib/libpam/modules/pam_chroot/pam_chroot.c:54: first defined here > : : [lather, rinse, repeat for every service function in every module] > : : > : : The service functions should be static. The logic PAM uses to =20 > determine > : : whether it is building static or shared modules is as follows: > : : > : : #if defined(__GNUC__) && !defined(__PIC__) && !=20 > defined(NO_STATIC_MODULES) > : > : I think the problem here is a confusion between 'static vs =20 > dynamic' and > : 'pic vs nonpic'. > : > : #ifdef __PIC__ > : int x; > : #else > : int y; > : #endif > : > : produces a .o with the symbol 'x' always. That was as far as I had > : got on looking into the problem. > > Ooops, looks like I neglected to add the following: > > The reason that it always produces 'x' has to do with the MIPS calling > conventions. Everything is always compiled PIC. There's a way to > disable this for the kernel, -mnoabicalls, but in userland that's what > all the tool chains expect. There may be other issues. I have a > fuzzy memory of some, but I can't recall any and explain them in a way > that makes sense, so I'll leave it at that. So if you are compiling > for a static library or a dynamic library doesn't matter: __PIC__ is > effectively always defined. > > Any suggestions on how to handle this problem? What about using OPENPAM_STATIC_MODULES for it? It's now defined in openpam.h as a consequence of the faulty logic. We might as well make it the pivotal flag... --=20 Marcel Moolenaar xcllnt@mac.com