From owner-freebsd-current Mon Dec 28 19:47:12 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA09218 for freebsd-current-outgoing; Mon, 28 Dec 1998 19:47:12 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA09190 for ; Mon, 28 Dec 1998 19:47:07 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id OAA01768; Tue, 29 Dec 1998 14:16:15 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id OAA32890; Tue, 29 Dec 1998 14:16:17 +1030 (CST) Message-ID: <19981229141616.C32696@freebie.lemis.com> Date: Tue, 29 Dec 1998 14:16:16 +1030 From: Greg Lehey To: Peter Wemm Cc: Doug Rabson , FreeBSD current users Subject: Re: How do I build an a.out kld? References: <19981229100025.K12346@freebie.lemis.com> <199812290334.LAA70186@spinner.netplex.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199812290334.LAA70186@spinner.netplex.com.au>; from Peter Wemm on Tue, Dec 29, 1998 at 11:34:54AM +0800 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 X-Mutt-References: <199812290334.LAA70186@spinner.netplex.com.au> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tuesday, 29 December 1998 at 11:34:54 +0800, Peter Wemm wrote: > Greg Lehey wrote: >> On Monday, 28 December 1998 at 19:44:59 +0800, Peter Wemm wrote: >>> Doug Rabson wrote: >>>> On Mon, 28 Dec 1998, Greg Lehey wrote: >>> [..] >>>>> 2. I could build an a.out kld. Unfortunately, there's an >>>>> (undocumented) program called gensetdefs which runs against the >>>>> objects, and expects only ELF files. It doesn't understand an >>>>> -aout flag. Can I get past this problem? >>>> >>>> Are you using bsd.kmod.mk? If you look at it, gensetdefs is only used for >>>> elf. Linking an a.out module is even simpler: >>>> >>>> ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${OBJS} ${KMODDEPS} >>>> >>>> Try 'make OBJFORMAT=aout' and see what happens. >>> >>> Err, my recollection was that it needed to be in the environment, ie more >>> like: env OBJFORMAT=aout make >> >> Neither of these answer the original question: how to I get gensetdefs >> to work on a.out objects? > > You shouldn't.. It's elf-only by design - it's an emulation for linker > sets that the a.out ld did. > > bsd.kmod.mk should be handling all this for you already: > > .if defined(KLDMOD) > .if ${OBJFORMAT} == elf > gensetdefs ${OBJS} > ${CC} ${CFLAGS} -c setdef0.c > ${CC} ${CFLAGS} -c setdef1.c > ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} setdef0.o ${OBJS} setdef1.o > ${KMODDEPS} > .else > ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${OBJS} ${KMODDEPS} > .endif > .else > ${LD} -r ${LDFLAGS:N-static} -o tmp.o ${OBJS} > [..] Well, something didn't work, but it's not important, since I've now moved to ELF (and almost have things working). Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message