From owner-svn-src-all@FreeBSD.ORG Tue Dec 30 11:12:33 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1B091065673; Tue, 30 Dec 2008 11:12:33 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2D01A8FC16; Tue, 30 Dec 2008 11:12:32 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id D1BF86D449; Tue, 30 Dec 2008 11:12:31 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id BB07C84460; Tue, 30 Dec 2008 12:12:31 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "M. Warner Losh" References: <200812271507.mBRF7pkv074681@svn.freebsd.org> <20081227150827.D97918@maildrop.int.zabbadoz.net> <26259E4E-6E26-4DAE-8046-80C7C46B7CD5@gmail.com> <20081227.193308.255407637.imp@bsdimp.com> Date: Tue, 30 Dec 2008 12:12:31 +0100 In-Reply-To: <20081227.193308.255407637.imp@bsdimp.com> (M. Warner Losh's message of "Sat, 27 Dec 2008 19:33:08 -0700 (MST)") Message-ID: <86r63p5334.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, yanefbsd@gmail.com, svn-src-all@FreeBSD.org, bz@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r186519 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2008 11:12:34 -0000 "M. Warner Losh" writes: > Still working on a solution that's correct and mutually acceptable to > DES. i think the ball is in my court. No, it's a build system issue. If it's in anyone's court, it would be ru@'s. The problem is that we need to use different CFLAGS for .o and .So. The quick and dirty fix is to override the .c.o rule for PAM modules: Index: /home/des/freebsd/base/head/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 --- /home/des/freebsd/base/head/lib/libpam/modules/Makefile.inc (revision 1= 86063) +++ /home/des/freebsd/base/head/lib/libpam/modules/Makefile.inc (working co= py) @@ -19,4 +19,7 @@ LDADD+=3D -lpam .endif =20 +.c.o: + ${CC} ${CFLAGS} -DOPENPAM_STATIC_MODULES -c ${.IMPSRC} + .include "../Makefile.inc" A cleaner but more intrusive fix would be to add STATIC_CFLAGS and SHARED_CFLAGS variables: 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 186599) +++ lib/libpam/modules/Makefile.inc (working copy) @@ -6,6 +6,7 @@ NO_PROFILE=3D =20 CFLAGS+=3D -I${PAMDIR}/include -I${.CURDIR}/../../libpam +STATIC_CFLAGS+=3D -DOPENPAM_STATIC_MODULES WARNS?=3D 4 =20 # This is nasty. Index: share/mk/bsd.lib.mk =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 --- share/mk/bsd.lib.mk (revision 186063) +++ share/mk/bsd.lib.mk (working copy) @@ -54,9 +54,9 @@ =20 .if !defined(PICFLAG) .if ${MACHINE_ARCH} =3D=3D "sparc64" -PICFLAG=3D-fPIC +PICFLAG=3D-fPIC -DPIC .else -PICFLAG=3D-fpic +PICFLAG=3D-fpic -DPIC .endif .endif =20 @@ -73,7 +73,7 @@ .endif =20 .c.So: - ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PICFLAG} ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif @@ -82,7 +82,7 @@ ${CXX} ${PO_FLAG} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} =20 .cc.So .C.So .cpp.So .cxx.So: - ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PICFLAG} ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARG= ET} =20 .f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} @@ -121,7 +121,7 @@ .endif =20 .asm.So: - ${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS} \ + ${CC} -x assembler-with-cpp ${PICFLAG} ${SHARED_CFLAGS} ${CFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} @@ -134,7 +134,7 @@ .endif =20 .S.So: - ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PICFLAG} ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif Index: share/mk/sys.mk =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 --- share/mk/sys.mk (revision 186063) +++ share/mk/sys.mk (working copy) @@ -159,7 +159,7 @@ # DOUBLE SUFFIX RULES =20 .c.o: - ${CC} ${CFLAGS} -c ${.IMPSRC} + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif @@ -172,7 +172,7 @@ =20 .y.o: ${YACC} ${YFLAGS} ${.IMPSRC} - ${CC} ${CFLAGS} -c y.tab.c + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c y.tab.c rm -f y.tab.c mv y.tab.o ${.TARGET} .if defined(CTFCONVERT) @@ -181,7 +181,7 @@ =20 .l.o: ${LEX} ${LFLAGS} ${.IMPSRC} - ${CC} ${CFLAGS} -c lex.yy.c + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c lex.yy.c rm -f lex.yy.c mv lex.yy.o ${.TARGET} .if defined(CTFCONVERT) @@ -197,7 +197,7 @@ mv lex.yy.c ${.TARGET} =20 .c.a: - ${CC} ${CFLAGS} -c ${.IMPSRC} + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o rm -f ${.PREFIX}.o =20 @@ -229,16 +229,16 @@ .endif =20 .c.o: - ${CC} ${CFLAGS} -c ${.IMPSRC} + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif =20 .cc .cpp .cxx .C: - ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} + ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o = ${.TARGET} =20 .cc.o .cpp.o .cxx.o .C.o: - ${CXX} ${CXXFLAGS} -c ${.IMPSRC} + ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} =20 .m.o: ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} @@ -260,13 +260,13 @@ ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} =20 .S.o: - ${CC} ${CFLAGS} -c ${.IMPSRC} + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif =20 .asm.o: - ${CC} -x assembler-with-cpp ${CFLAGS} -c ${.IMPSRC} + ${CC} -x assembler-with-cpp ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif @@ -280,7 +280,7 @@ # XXX not -j safe .y.o: ${YACC} ${YFLAGS} ${.IMPSRC} - ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET} + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c y.tab.c -o ${.TARGET} rm -f y.tab.c .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} @@ -303,7 +303,7 @@ ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET} =20 .s.out .c.out .o.out: - ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} + ${CC} ${STATIC_CFLAGS} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TA= RGET} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif @@ -319,7 +319,7 @@ # XXX not -j safe .y.out: ${YACC} ${YFLAGS} ${.IMPSRC} - ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET} + ${CC} ${STATIC_CFLAGS} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.T= ARGET} rm -f y.tab.c .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} @@ -327,7 +327,7 @@ =20 .l.out: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c - ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET} + ${CC} ${STATIC_CFLAGS} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -l= l -o ${.TARGET} rm -f ${.PREFIX}.tmp.c .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no