public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/28084] New: autoconf-x86-uniregs.c compile failled with -Werror cause STAPCONF_X86_UNIREGS missing
@ 2021-07-13 23:06 duzhe0211+sourceware at gmail dot com
  2021-07-13 23:17 ` [Bug runtime/28084] " fche at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: duzhe0211+sourceware at gmail dot com @ 2021-07-13 23:06 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=28084

            Bug ID: 28084
           Summary: autoconf-x86-uniregs.c compile failled with -Werror
                    cause STAPCONF_X86_UNIREGS missing
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: duzhe0211+sourceware at gmail dot com
  Target Milestone: ---

Created attachment 13558
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13558&action=edit
output of stap -vvvvv -e 'probe vfs.read {printf("read performed\n"); exit()}
2>&1

kernel version: linux-5.10.47-gentoo
systemtap version: tried 4.4 and 4.5
gcc version: 10.3.0

run 
```
stap -e 'probe vfs.read {printf("read performed\n"); exit()}'
```
and i got a lot of error like
```
/usr/share/systemtap/runtime/linux/../linux/regs.c: In function
‘_stp_print_regs’:
/usr/share/systemtap/runtime/linux/../linux/regs.c:48:33: error: ‘struct
pt_regs’ has no member named ‘rip’; did you mean ‘ip’?
   48 | #define RREG(nm, regs) ((regs)->r##nm)
      |                                 ^
```
did some dig and figure it out it's caused by macro STAPCONF_X86_UNIREGS
missing and which is caused by autoconf-x86-uniregs.c compile error with
-Werror.
this error message extracted from output of stap -vvvvv -e 'probe vfs.read
{printf("read performed\n"); exit()}'
```
if gcc -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include
-D__KERNEL__ -fmacro-prefix-map=./=  -I./arch/x86/include
-I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi
-I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/    
uapi -include ./include/linux/kconfig.h  -Wall -Wundef
-Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-fshort-wchar -fno-PIE -Werror=implicit-function-declaration
-Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89
-mno-sse -mno-     mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64
-falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387
-mpreferred-stack-boundary=3 -mskip-rax-setup -march=core2 -mno-red-zone
-mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-  
       branch=thunk-extern -mindirect-branch-register -fno-jump-tables
-fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation
-Wno-format-overflow -Wno-address-of-packed-member -O2
-fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong -
         Wimplicit-fallthrough -Wno-unused-but-set-variable
-Wno-unused-const-variable -fomit-frame-pointer -Wdeclaration-after-statement
-Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds
-Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-             
uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack
-Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init
-Wno-packed-not-aligned    
-DKBUILD_BASENAME=\"stap_424bc6bc72c5e4959fc064d5545d98ca_2636\" -Werror -S -o
/dev/null -xc  "/usr/share/  systemtap/runtime"/linux/autoconf-x86-uniregs.c;
then echo "#define STAPCONF_X86_UNIREGS 1"; fi >>
/tmp/stapMRil1C/autoconf-x86-uniregs.c.h
 In file included from ./arch/x86/include/asm/ptrace.h:97,
                  from
/usr/share/systemtap/runtime/linux/autoconf-x86-uniregs.c:1:
 ./arch/x86/include/asm/proto.h:14:30: error: ‘struct task_struct’ declared
inside parameter list will not be visible outside of this definition or
declaration [-Werror]
    14 | long do_arch_prctl_64(struct task_struct *task, int option, unsigned
long arg2);
       |                              ^~~~~~~~~~~
 ./arch/x86/include/asm/proto.h:40:34: error: ‘struct task_struct’ declared
inside parameter list will not be visible outside of this definition or
declaration [-Werror]
    40 | long do_arch_prctl_common(struct task_struct *task, int option,
       |                                  ^~~~~~~~~~~
 cc1: all warnings being treated as errors

and i found some way to aovid the error, i'm not sure which is better
method 1:  insert line '#include <linux/sched.h>' into autoconf-x86-uniregs.c
before line '#include <asm/ptrace.h>'; <linux/sched.h> introduce the
defineition of struct task_struct;
method 2:  insert line 'struct task_struct{};' into autoconf-x86-uniregs.c
before line '#include <asm/ptrace.h>';introduce a fake struct task_struct to
make compiler happy;
method 3:  remove -Werror

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug runtime/28084] autoconf-x86-uniregs.c compile failled with -Werror cause STAPCONF_X86_UNIREGS missing
  2021-07-13 23:06 [Bug runtime/28084] New: autoconf-x86-uniregs.c compile failled with -Werror cause STAPCONF_X86_UNIREGS missing duzhe0211+sourceware at gmail dot com
@ 2021-07-13 23:17 ` fche at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: fche at redhat dot com @ 2021-07-13 23:17 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=28084

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |fche at redhat dot com
         Resolution|---                         |FIXED

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
Solved this with your suggested solution #1, thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-13 23:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 23:06 [Bug runtime/28084] New: autoconf-x86-uniregs.c compile failled with -Werror cause STAPCONF_X86_UNIREGS missing duzhe0211+sourceware at gmail dot com
2021-07-13 23:17 ` [Bug runtime/28084] " fche at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).