Date: Tue, 29 Dec 1998 11:34:54 +0800 From: Peter Wemm <peter@netplex.com.au> To: Greg Lehey <grog@lemis.com> Cc: Doug Rabson <dfr@nlsystems.com>, FreeBSD current users <FreeBSD-current@FreeBSD.ORG> Subject: Re: How do I build an a.out kld? Message-ID: <199812290334.LAA70186@spinner.netplex.com.au> In-Reply-To: Your message of "Tue, 29 Dec 1998 10:00:25 %2B1030." <19981229100025.K12346@freebie.lemis.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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}
[..]
Cheers,
-Peter
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812290334.LAA70186>
