From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 24DB23857C62; Tue, 13 Jul 2021 23:06:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24DB23857C62 From: "duzhe0211+sourceware at gmail dot com" 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 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: duzhe0211+sourceware at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2021 23:06:10 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28084 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=3D13558&action=3Ded= it 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=20 ``` 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 =E2=80=98_stp_print_regs=E2=80=99: /usr/share/systemtap/runtime/linux/../linux/regs.c:48:33: error: =E2=80=98s= truct pt_regs=E2=80=99 has no member named =E2=80=98rip=E2=80=99; did you mean = =E2=80=98ip=E2=80=99? 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=3D./=3D -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/= =20=20=20=20 uapi -include ./include/linux/kconfig.h -Wall -Wundef -Werror=3Dstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=3Dimplicit-function-declaration -Werror=3Dimplicit-int -Werror=3Dreturn-type -Wno-format-security -std=3Dgn= u89 -mno-sse -mno- mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=3Dnone= -m64 -falign-jumps=3D1 -falign-loops=3D1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3D3 -mskip-rax-setup -march=3Dcore2 -mno-red-zone -mcmodel=3Dkernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindir= ect-=20=20 branch=3Dthunk-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=3D2048 -fstack-protector-st= rong - Wimplicit-fallthrough -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -Wdeclaration-after-stateme= nt -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-=20=20=20= =20=20=20=20=20=20=20=20=20=20 uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=3Ddate-time -Werror=3Dincompatible-pointer-types -Werror=3Ddesignat= ed-init -Wno-packed-not-aligned=20=20=20=20 -DKBUILD_BASENAME=3D\"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: =E2=80=98struct task_struct= =E2=80=99 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, unsign= ed long arg2); | ^~~~~~~~~~~ ./arch/x86/include/asm/proto.h:40:34: error: =E2=80=98struct task_struct= =E2=80=99 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 ' into autoconf-x86-uniregs= .c before line '#include '; introduce the defineition of struct task_struct; method 2: insert line 'struct task_struct{};' into autoconf-x86-uniregs.c before line '#include ';introduce a fake struct task_struct to make compiler happy; method 3: remove -Werror --=20 You are receiving this mail because: You are the assignee for the bug.=