NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-amd64/43438: x86 module map size is limited

The following reply was made to PR port-amd64/43438; it has been noted by GNATS.

From: Nicolas Joly <>
Subject: Re: port-amd64/43438: x86 module map size is limited
Date: Wed, 9 Jun 2010 14:14:23 +0200

 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 On Wed, Jun 09, 2010 at 02:55:00AM +0000, wrote:
 > >Number:         43438
 > >Category:       port-amd64
 > >Synopsis:       x86 module map size is limited
 >      trying to load the "solaris" and "zfs" kmodules into an amd64
 >      GENERIC kernel results in ENOMEM being returned by the zfs load
 >      attempt.  i tracked this down to the x86 module_map being 
 >      sized at 20MB - size of kernel + rodata.  in my case, the module
 >      map was only left about 3MB or space, and it could not satisfy
 >      the modload attempts.
 I hit the same problem quite some time ago while playing with
 compat_linux modules ... At least for me, the problem is that modules
 for a MKDEBUG=yes,COPTS=-g build are gigantic. The attached patch,
 which remove debugging symbols from modules to be installed (but keeps
 a .gdb copy handy just in case ...) solved the problem.
 njoly@lanfeust [dest/amd64]> du -sh stand/amd64/5.99.30 
 42M     stand/amd64/5.99.30
 njoly@lanfeust [dest/amd64]> du -sh stand/amd64/5.99.30
 6.5M    stand/amd64/5.99.30
 Nicolas Joly
 Biological Software and Databanks.
 Institut Pasteur, Paris.
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="netbsd-stripkmod.diff"
 Index: share/mk/
 RCS file: /cvsroot/src/share/mk/,v
 retrieving revision 1.24
 diff -u -p -r1.24
 --- share/mk/    18 Jan 2010 23:39:07 -0000      1.24
 +++ share/mk/    9 Jun 2010 11:54:48 -0000
 @@ -48,6 +48,14 @@ KMODSCRIPT= ${DESTDIR}/usr/libdata/ldscr
  OBJS+=                ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
  PROG?=                ${KMOD}.kmod
 +.if ${MKDEBUG} != "no"
 +KMODDEBUG=    mv ${PROG} ${PROG}.gdb && \
 +              ${STRIP} --strip-debug -o ${PROG} ${PROG}.gdb
 +KMODDEBUG=    true
  ##### Build rules
  realall:      ${PROG}
 @@ -57,6 +65,7 @@ ${PROG}: ${OBJS} ${DPADD}
        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-T,${KMODSCRIPT},-d \
                -o ${.TARGET} ${OBJS}
 +      ${KMODDEBUG}
  ##### Install rules
  .if !target(kmodinstall)
 @@ -88,7 +97,7 @@ ${_PROG}:    .MADE                                   # no 
build at instal
 -              ${.ALLSRC} ${.TARGET}
 +              ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
  kmodinstall:: ${_PROG}
  .PHONY:               kmodinstall

Home | Main Index | Thread Index | Old Index