View Bug Activity | Format For Printing
The C code that systemtap translator generates for the kernel does not compile on stock rawhide 2.6.21-1.3218.fc8 kernel. Below is the result for attempting to compile the simple add.stp test. -Will $ ../install/bin/stap testsuite/systemtap.base/add.stp -vv -k <... snip ...> Running make -C "/lib/modules/2.6.21-1.3218.fc8/build" M="/tmp/stapArvzcz" modules V=1 make: Entering directory `/usr/src/kernels/2.6.21-1.3218.fc8-x86_64' test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \ echo; \ echo " ERROR: Kernel configuration is invalid."; \ echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \ echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo; \ /bin/false) mkdir -p /tmp/stapArvzcz/.tmp_versions rm -f /tmp/stapArvzcz/.tmp_versions/* make -f scripts/Makefile.build obj=/tmp/stapArvzcz + gcc -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wpointer-arith -Os -mtune=generic -m64 -mno-red-zone -mcmodel=kernel -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -fstack-protector -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign '-DKBUILD_BASENAME="stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532"' -Werror -S -o /dev/null -xc /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/autoconf-hrtimer-rel.c cc1: warnings being treated as errors In file included from include/linux/list.h:8, from include/linux/lockdep.h:16, from include/linux/spinlock_types.h:12, from include/linux/spinlock.h:79, from include/linux/seqlock.h:29, from include/linux/time.h:7, from include/linux/ktime.h:24, from include/linux/hrtimer.h:19, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/autoconf-hrtimer-rel.c:1: include/linux/prefetch.h: In function 'prefetch_range': include/linux/prefetch.h:62: warning: pointer of type 'void *' used in arithmetic /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/autoconf-hrtimer-rel.c: At top level: /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/autoconf-hrtimer-rel.c:3: error: 'HRTIMER_REL' undeclared here (not in a function) + echo '' + gcc -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wpointer-arith -Os -mtune=generic -m64 -mno-red-zone -mcmodel=kernel -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -fstack-protector -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign '-DKBUILD_BASENAME="stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532"' -Werror -S -o /dev/null -xc /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/autoconf-inode-private.c cc1: warnings being treated as errors In file included from include/linux/list.h:8, from include/linux/wait.h:22, from include/linux/fs.h:272, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/autoconf-inode-private.c:1: include/linux/prefetch.h: In function 'prefetch_range': include/linux/prefetch.h:62: warning: pointer of type 'void *' used in arithmetic + echo '' gcc -Wp,-MD,/tmp/stapArvzcz/.stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wpointer-arith -Os -mtune=generic -m64 -mno-red-zone -mcmodel=kernel -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -fstack-protector -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -freorder-blocks -Wno-unused -Werror -I"/home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime" -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532)" -D"KBUILD_MODNAME=KBUILD_STR(stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532)" -c -o /tmp/stapArvzcz/.tmp_stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.o /tmp/stapArvzcz/stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.c cc1: warnings being treated as errors In file included from include/linux/list.h:8, from include/linux/lockdep.h:16, from include/linux/spinlock_types.h:12, from include/linux/spinlock.h:79, from include/linux/module.h:9, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/runtime.h:14, from /tmp/stapArvzcz/stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.c:42: include/linux/prefetch.h: In function 'prefetch_range': include/linux/prefetch.h:62: warning: pointer of type 'void *' used in arithmetic In file included from include/linux/ptrace.h:65, from include/asm/kprobes.h:27, from include/linux/kprobes.h:41, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/runtime.h:21, from /tmp/stapArvzcz/stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.c:42: include/linux/tracehook.h: In function 'utrace_regset_copyout': include/linux/tracehook.h:241: warning: pointer of type 'void *' used in arithmetic include/linux/tracehook.h:244: warning: pointer of type 'void *' used in arithmetic include/linux/tracehook.h:249: warning: pointer of type 'void *' used in arithmetic include/linux/tracehook.h: In function 'utrace_regset_copyin': include/linux/tracehook.h:267: warning: pointer of type 'void *' used in arithmetic include/linux/tracehook.h:270: warning: pointer of type 'void *' used in arithmetic include/linux/tracehook.h:275: warning: pointer of type 'void *' used in arithmetic include/linux/tracehook.h: In function 'utrace_regset_copyout_zero': include/linux/tracehook.h:299: warning: pointer of type 'void *' used in arithmetic include/linux/tracehook.h:304: warning: pointer of type 'void *' used in arithmetic include/linux/tracehook.h: In function 'utrace_regset_copyin_ignore': include/linux/tracehook.h:323: warning: pointer of type 'void *' used in arithmetic include/linux/tracehook.h:325: warning: pointer of type 'void *' used in arithmetic In file included from include/linux/compat.h:14, from include/linux/ptrace.h:197, from include/asm/kprobes.h:27, from include/linux/kprobes.h:41, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/runtime.h:21, from /tmp/stapArvzcz/stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.c:42: include/asm/compat.h: In function 'compat_alloc_user_space': include/asm/compat.h:202: warning: pointer of type 'void *' used in arithmetic In file included from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/transport/utt.c:29, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/transport/transport.c:26, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/print.c:17, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/runtime.h:85, from /tmp/stapArvzcz/stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.c:42: include/linux/relay.h: In function 'relay_write': include/linux/relay.h:207: warning: pointer of type 'void *' used in arithmetic include/linux/relay.h:207: warning: pointer of type 'void *' used in arithmetic include/linux/relay.h: In function '__relay_write': include/linux/relay.h:233: warning: pointer of type 'void *' used in arithmetic include/linux/relay.h:233: warning: pointer of type 'void *' used in arithmetic include/linux/relay.h: In function 'relay_reserve': include/linux/relay.h:259: warning: pointer of type 'void *' used in arithmetic In file included from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/transport/transport.c:26, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/print.c:17, from /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/runtime.h:85, from /tmp/stapArvzcz/stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.c:42: /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/transport/utt.c: In function 'utt_dropped_open': /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/transport/utt.c:96: error: 'struct inode' has no member named 'u' make[1]: *** [/tmp/stapArvzcz/stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.o] Error 1 make: *** [_module_/tmp/stapArvzcz] Error 2 make: Leaving directory `/usr/src/kernels/2.6.21-1.3218.fc8-x86_64' Pass 4: compiled C into "stap_9f4f81c2fc5eab2f50b637ed1cb7e0ac_532.ko" in 570usr/690sys/1290real ms. Pass 4: compilation failed. Try again with more '-v' (verbose) options. Keeping temporary directory "/tmp/stapArvzcz"
Looks like you can't build modules with that version of gcc and -Werror. The only error here in the runtime is this one: /home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/transport/utt.c:96: error: 'struct inode' has no member named 'u' And that is caused by the failure of the inode autoconf test previously: home/wcohen/stap_testing_200706130830/install/share/systemtap/runtime/autoconf-inode-private.c:1: include/linux/prefetch.h: In function 'prefetch_range': include/linux/prefetch.h:62: warning: pointer of type 'void *' used in arithmetic Which , like all the other warnings is caused by incorrect kernel headers and a picky gcc. In this case, static inline void prefetch_range(void *addr, size_t len) { #ifdef ARCH_HAS_PREFETCH char *cp; char *end = addr + len; ^ adding "len" to a void * - gcc says don't do it! Now wasn't the whole point of implementing void types to eliminate all the casting associated with using "char *"?
(In reply to comment #1) > Looks like you can't build modules with that version of gcc and -Werror. We could remove -Werror from the generated makefile in buildrun.cxx. > char *cp; > char *end = addr + len; > ^ adding "len" to a void * - gcc says don't do it! > > > Now wasn't the whole point of implementing void types to eliminate all the > casting associated with using "char *"? Sure, but arithmetic on void pointers is not defined. Remember, the address ptr+index depends on sizeof (*ptr).
(In reply to comment #2) > (In reply to comment #1) > > Looks like you can't build modules with that version of gcc and -Werror. > > We could remove -Werror from the generated makefile in buildrun.cxx. Yes, but it's normally a useful tool to help us keep our code clean. > > Now wasn't the whole point of implementing void types to eliminate all the > > casting associated with using "char *"? > > Sure, but arithmetic on void pointers is not defined. Remember, > the address ptr+index depends on sizeof (*ptr). And if you ask gcc to print sizeof(void), it printed 1. And pointer arithmetic worked with void *. So everything was consistent. But now gcc apparently works differently.