NetBSD/tests/rump/modautoload/Makefile
pooka 5c21ec6fa6 Add a test which checks autoloading modules from the host's
/stand/arch/vers/kmods works in rump (and that the result is usable ;).

On i386 this "just works".  For amd64, due to -mcmodel=kernel,
things are a little more complicated.  We must have the entire rump
kernel loaded in the lower 2GB.  Currently, this can be done either
by using the non-PIC version for the rump kernel compiled with
-mcmodel=small, or, as njoly pointed out, using netbsd32, which
causes vm_default_addr() to give something in the lower 2GB and
therefore shared libs "magically" getting loaded there.  I guess
it would be possible to put a suggested vaddr into the rump kernel
libs and make ld.elf_so map memory from the suggested address if
present ... but that's another show.

Also thanks to tron for access to an amd64 so that I could verify
the test works.
2010-06-09 12:35:45 +00:00

25 lines
610 B
Makefile

# $NetBSD: Makefile,v 1.1 2010/06/09 12:35:45 pooka Exp $
#
TESTSDIR= ${TESTSBASE}/rump/modautoload
TESTS_C= t_modautoload
.include <bsd.own.mk>
.ifdef RUMPKMOD
CPPFLAGS+= -DHAVE_HOST_MODULES
.endif
# Note: we link the rump kernel into the application to make this work
# on amd64. This is the reason we keep this test in its own
# subdirectory -- otherwise the LDADD lines would get a little hairy.
LDFLAGS+= -Wl,-E
LDADD+= -Wl,--whole-archive ${DESTDIR}/usr/lib/librumpvfs.a \
${DESTDIR}/usr/lib/librump.a \
-Wl,--no-whole-archive
LDADD+= -lrumpuser -lpthread
WARNS= 4
.include <bsd.test.mk>