linux module problem with new kernel

YONETANI Tomokazu qhwt+dragonfly-bugs at
Sat Feb 21 17:12:45 PST 2004

On Sat, Feb 21, 2004 at 04:30:52PM -0800, Rob Schulhof wrote:
>   As far as I can tell, the  problem with the linux module is in the
> makefile's use of the -fno-common option when compiling
> src/sys/emulation/linux/i386/linux_genassym.c.  This causes the symbols to
> be included  in the BSS section of the object file and causes the
> src/sys/kern/ to write an empty linux_assym.h file because the
> symbols are no longer in 'common' blocks.  I'm still sorting through the
> cvs changes to find the cause...

dillon      2004/02/16 11:57:40 PST

DragonFly src repository

  Modified files:
    sys/conf             Makefile.amd64 Makefile.i386
  Compile the kernel with -fno-common to guarentee that we do not accidently
  put non-extern'd variable declarations in header files.  Our module loader
  no longer deals with commons so duplicate declarations can cause kldloaded
  modules to fail, and its sloppy programming anyway.

  Revision  Changes    Path
  1.2       +1 -1      src/sys/conf/Makefile.amd64
  1.12      +1 -1      src/sys/conf/Makefile.i386
  1.4       +5 -0      src/sys/conf/
  1.14      +2 -2      src/sys/conf/files.i386

svr4 is already fixed this way, but with different commit log.

Index: sys/emulation/linux/Makefile
RCS file: /home/source/dragonfly/cvs/src/sys/emulation/linux/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- sys/emulation/linux/Makefile	31 Jan 2004 06:56:43 -0000	1.4
+++ sys/emulation/linux/Makefile	22 Feb 2004 00:58:43 -0000
@@ -30,7 +30,7 @@
 	    ${.IMPSRC} -o ${.TARGET}
 linux_genassym.o: linux_genassym.c linux.h @ machine
-	${CC} -c ${CFLAGS} ${.IMPSRC}
+	${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
 	echo "#define COMPAT_43 1" > opt_compat.h

More information about the Bugs mailing list