public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "duzhe0211+sourceware at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug runtime/28084] New: autoconf-x86-uniregs.c compile failled with -Werror cause STAPCONF_X86_UNIREGS missing
Date: Tue, 13 Jul 2021 23:06:09 +0000	[thread overview]
Message-ID: <bug-28084-6586@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2021-07-13 23:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 23:06 duzhe0211+sourceware at gmail dot com [this message]
2021-07-13 23:17 ` [Bug runtime/28084] " fche at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28084-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).