Jens Rehsack
2009-Feb-14 05:33 UTC
Error compiling FreeBSD-Stable with MFC'ed iconv locking
Hi John, after I updated my system (-STABLE) I received following compilation error while building the kernel (having ICONV built in): cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -march=nocona -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Werror /usr/src/sys/libkern/iconv.c /usr/src/sys/libkern/iconv.c: In function 'iconv_mod_unload': /usr/src/sys/libkern/iconv.c:92: error: 'curthread' undeclared (first use in this function) /usr/src/sys/libkern/iconv.c:92: error: (Each undeclared identifier is reported only once /usr/src/sys/libkern/iconv.c:92: error: for each function it appears in.) /usr/src/sys/libkern/iconv.c: In function 'iconv_sysctl_add': /usr/src/sys/libkern/iconv.c:401: error: 'curthread' undeclared (first use in this function) /usr/src/sys/libkern/iconv.c: In function 'iconv_converter_handler': /usr/src/sys/libkern/iconv.c:452: error: 'curthread' undeclared (first use in this function) I applied following patch - and it works: --- sys/sys/sx.h.orig 2009-02-14 12:56:11.000000000 +0000 +++ sys/sys/sx.h 2009-02-14 12:57:33.000000000 +0000 @@ -35,6 +35,7 @@ #include <sys/_lock.h> #include <sys/_sx.h> #include <sys/lock_profile.h> +#include <sys/proc.h> #ifdef _KERNEL #include <machine/atomic.h> Google didn't find anything so I thought I mail this quickly. Best regards, Jens -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 897 bytes Desc: OpenPGP digital signature Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20090214/e2295dd7/signature.pgp
Adam Hopstetter
2009-Feb-15 08:59 UTC
Error compiling FreeBSD-Stable with MFC'ed iconv locking
Hello, I also had the exact same issue compiling FreeBSD-7.1-stable on 2/14/2009. If you implement the described patch ... freebsd-7.1-stable will them fail to build world with an error in pf/ftp-proxy.c, complaining about a redefinition of 'session'. This is b/c sys/proc.h also defines 'session' ... so there treading on each other's namespace .... Below is an updated patch to compile kernel and world with kernel libiconv support. --- sys/sys/sx.h.orig 2009-02-14 15:49:28.000000000 -0500 +++ sys/sys/sx.h 2009-02-14 21:38:04.000000000 -0500 @@ -37,6 +37,7 @@ #include <sys/lock_profile.h> #ifdef _KERNEL +#include <sys/proc.h> #include <machine/atomic.h> #endif Sincerely, Adam Hopstetter
John Baldwin
2009-Feb-17 14:23 UTC
Error compiling FreeBSD-Stable with MFC'ed iconv locking
On Saturday 14 February 2009 8:04:45 am Jens Rehsack wrote:> Hi John, > > after I updated my system (-STABLE) I received following compilation error > while building the kernel (having ICONV built in): > > cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -march=nocona > -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/usr/src/sys > -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include > opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 > --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel > -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow > -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Werror > /usr/src/sys/libkern/iconv.c > /usr/src/sys/libkern/iconv.c: In function 'iconv_mod_unload': > /usr/src/sys/libkern/iconv.c:92: error: 'curthread' undeclared (first use in > this function) > /usr/src/sys/libkern/iconv.c:92: error: (Each undeclared identifier is > reported only once > /usr/src/sys/libkern/iconv.c:92: error: for each function it appears in.) > /usr/src/sys/libkern/iconv.c: In function 'iconv_sysctl_add': > /usr/src/sys/libkern/iconv.c:401: error: 'curthread' undeclared (first use > in this function) > /usr/src/sys/libkern/iconv.c: In function 'iconv_converter_handler': > /usr/src/sys/libkern/iconv.c:452: error: 'curthread' undeclared (first use > in this function) > > I applied following patch - and it works: > --- sys/sys/sx.h.orig 2009-02-14 12:56:11.000000000 +0000 > +++ sys/sys/sx.h 2009-02-14 12:57:33.000000000 +0000 > @@ -35,6 +35,7 @@ > #include <sys/_lock.h> > #include <sys/_sx.h> > #include <sys/lock_profile.h> > +#include <sys/proc.h> > > #ifdef _KERNEL > #include <machine/atomic.h> > > Google didn't find anything so I thought I mail this quickly.The most recent commit to <sys/sx.h> to include <sys/pcpu.h> in the _KERNEL section should fix this. -- John Baldwin