public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
@ 2020-06-14 11:17 ungift-ed at ya dot ru
  2020-06-15  6:49 ` [Bug target/95671] " marxin at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: ungift-ed at ya dot ru @ 2020-06-14 11:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

            Bug ID: 95671
           Summary: Fails to build kernel 5.7 with -march=bdver{2,3,4}
                    workaround -mno-tbm
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ungift-ed at ya dot ru
  Target Milestone: ---

There is patch for build kernel with different march:
https://github.com/graysky2/kernel_gcc_patch/blob/master/enable_additional_cpu_optimizations_for_gcc_v9.1%2B_kernel_v5.7%2B.patch

Gentoo use this patch with USE='experimental'

Since 5.7 kernel builds fails on bdver{2,3,4}.
I can build kernel when add -mno-tbm

         cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1)
         cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2)
+        cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-mno-tbm)
         cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-march=bdver3)
+        cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-mno-tbm)
         cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-march=bdver4)
+        cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-mno-tbm)

Please look if it gcc issue. Thanks.

My build log:
  HOSTCC  scripts/kconfig/conf.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
  HOSTCXX -fPIC scripts/gcc-plugins/structleak_plugin.o
  HOSTLLD -shared scripts/gcc-plugins/structleak_plugin.so
  GENSEED scripts/gcc-plugins/randomize_layout_seed.h
  HOSTCXX -fPIC scripts/gcc-plugins/randomize_layout_plugin.o
  HOSTLLD -shared scripts/gcc-plugins/randomize_layout_plugin.so
  HOSTCXX -fPIC scripts/gcc-plugins/stackleak_plugin.o
  HOSTLLD -shared scripts/gcc-plugins/stackleak_plugin.so
  HOSTCC  scripts/genksyms/genksyms.o
  YACC    scripts/genksyms/parse.tab.[ch]
  HOSTCC  scripts/genksyms/parse.tab.o
  LEX     scripts/genksyms/lex.lex.c
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/bin2c
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/extract-cert
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/empty.o
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  CC      kernel/bounds.s
  CC      arch/x86/kernel/asm-offsets.s
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  DESCEND  objtool
  HOSTCC   /usr/src/linux-5.7.1-gentoo-2/tools/objtool/fixdep.o
  HOSTLD   /usr/src/linux-5.7.1-gentoo-2/tools/objtool/fixdep-in.o
  LINK     /usr/src/linux-5.7.1-gentoo-2/tools/objtool/fixdep
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/exec-cmd.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/help.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/pager.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/parse-options.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/run-command.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/sigchain.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/subcmd-config.o
  LD       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/libsubcmd-in.o
  AR       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/libsubcmd.a
  GEN     
/usr/src/linux-5.7.1-gentoo-2/tools/objtool/arch/x86/lib/inat-tables.c
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/arch/x86/decode.o
  LD       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/arch/x86/objtool-in.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/builtin-check.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/builtin-orc.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/check.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/orc_gen.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/orc_dump.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/elf.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/special.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/objtool.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/libstring.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/libctype.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/str_error_r.o
  CC       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/librbtree.o
  LD       /usr/src/linux-5.7.1-gentoo-2/tools/objtool/objtool-in.o
  LINK     /usr/src/linux-5.7.1-gentoo-2/tools/objtool/objtool
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/main.o
init/main.o: warning: objtool: initcall_blacklisted()+0xd9: return with
modified stack frame
  CC      init/version.o
  CC      init/do_mounts.o
  CC      init/noinitramfs.o
  CC      init/calibrate.o
  CC      init/init_task.o
  AR      init/built-in.a
  AR      usr/built-in.a
  CC      arch/x86/entry/vdso/vma.o
  LDS     arch/x86/entry/vdso/vdso.lds
  AS      arch/x86/entry/vdso/vdso-note.o
  CC      arch/x86/entry/vdso/vclock_gettime.o
  CC      arch/x86/entry/vdso/vgetcpu.o
  VDSO    arch/x86/entry/vdso/vdso64.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso64.so
  HOSTCC  arch/x86/entry/vdso/vdso2c
  VDSO2C  arch/x86/entry/vdso/vdso-image-64.c
  CC      arch/x86/entry/vdso/vdso-image-64.o
  AR      arch/x86/entry/vdso/built-in.a
  CC      arch/x86/entry/vsyscall/vsyscall_64.o
arch/x86/entry/vsyscall/vsyscall_64.o: warning: objtool:
emulate_vsyscall()+0x287: stack state mismatch: cfa1=7+64 cfa2=7+56
  AS      arch/x86/entry/vsyscall/vsyscall_emu_64.o
  AR      arch/x86/entry/vsyscall/built-in.a
  AS      arch/x86/entry/entry_64.o
  AS      arch/x86/entry/thunk_64.o
  CC      arch/x86/entry/syscall_64.o
  CC      arch/x86/entry/common.o
  AR      arch/x86/entry/built-in.a
  CC      arch/x86/events/amd/core.o
arch/x86/events/amd/core.o: warning: objtool: amd_pmu_handle_irq()+0x30: stack
state mismatch: cfa1=7+16 cfa2=7+0
  CC      arch/x86/events/amd/uncore.o
  CC      arch/x86/events/amd/power.o
  CC      arch/x86/events/amd/ibs.o
arch/x86/events/amd/ibs.o: warning: objtool: perf_ibs_init()+0x23: can't find
jump dest instruction at .text+0xe5
make[3]: *** [scripts/Makefile.build:267: arch/x86/events/amd/ibs.o] Error 255
make[3]: *** Deleting file 'arch/x86/events/amd/ibs.o'
make[2]: *** [scripts/Makefile.build:488: arch/x86/events/amd] Error 2
make[1]: *** [scripts/Makefile.build:488: arch/x86/events] Error 2
make: *** [Makefile:1729: arch/x86] Error 2

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
@ 2020-06-15  6:49 ` marxin at gcc dot gnu.org
  2020-06-15  6:56 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-15  6:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-06-15
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Can you please attach a pre-processed file for an object that fails with
objtool?

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
  2020-06-15  6:49 ` [Bug target/95671] " marxin at gcc dot gnu.org
@ 2020-06-15  6:56 ` rguenth at gcc dot gnu.org
  2020-06-15 11:19 ` ungift-ed at ya dot ru
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-15  6:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-* i?86-*-*
            Version|unknown                     |10.1.0

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Assuming GCC 10.1 - you didn't specify.

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
  2020-06-15  6:49 ` [Bug target/95671] " marxin at gcc dot gnu.org
  2020-06-15  6:56 ` rguenth at gcc dot gnu.org
@ 2020-06-15 11:19 ` ungift-ed at ya dot ru
  2020-06-15 11:23 ` ungift-ed at ya dot ru
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ungift-ed at ya dot ru @ 2020-06-15 11:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

--- Comment #3 from Maxim Britov <ungift-ed at ya dot ru> ---
(In reply to Richard Biener from comment #2)
> Assuming GCC 10.1 - you didn't specify.

In my env I can reproduce it on 8.3.0 / 9.2.0 / 9.3.0/ 10.1.0

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-8.3.0-r1/work/gcc-8.3.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/8.3.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/8.3.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/8.3.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/8.3.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/8.3.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --disable-nls --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened
8.3.0-r1 p1.1' --enable-esp --enable-libstdcxx-time --disable-libstdcxx-pch
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --disable-multilib --with-multilib-list=m64
--disable-altivec --disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libmudflap --disable-libssp --disable-libmpx --disable-systemtap
--enable-vtable-verify --enable-lto --without-isl --enable-default-pie
--enable-default-ssp
Thread model: posix
gcc version 8.3.0 (Gentoo Hardened 8.3.0-r1 p1.1) 



Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-9.3.0/work/gcc-9.3.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/9.3.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.3.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.3.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.3.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/9.3.0/python
--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror
--with-system-zlib --disable-nls --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened 9.3.0
p2' --enable-esp --enable-libstdcxx-time --with-build-config=bootstrap-lto
--disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --disable-multilib
--with-multilib-list=m64 --disable-altivec --disable-fixed-point
--enable-targets=all --enable-libgomp --disable-libmudflap --disable-libssp
--disable-libada --disable-systemtap --enable-vtable-verify
--disable-libquadmath --enable-lto --without-isl --enable-default-pie
--enable-default-ssp
Thread model: posix
gcc version 9.3.0 (Gentoo Hardened 9.3.0 p2) 



built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/10.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/10.1.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10.1.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10.1.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10.1.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/include/g++-v10
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/10.1.0/python
--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror
--with-system-zlib --disable-nls --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 10.1.0-r1 p2'
--disable-esp --enable-libstdcxx-time --with-build-config=bootstrap-lto
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --disable-multilib --with-multilib-list=m64
--disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libmudflap --disable-libssp --disable-libada --disable-systemtap
--enable-vtable-verify --with-zstd --disable-libquadmath --enable-lto
--with-isl --disable-isl-version-check --enable-default-pie
--enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.1.0 (Gentoo 10.1.0-r1 p2)

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (2 preceding siblings ...)
  2020-06-15 11:19 ` ungift-ed at ya dot ru
@ 2020-06-15 11:23 ` ungift-ed at ya dot ru
  2020-06-15 11:24 ` ungift-ed at ya dot ru
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ungift-ed at ya dot ru @ 2020-06-15 11:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

--- Comment #4 from Maxim Britov <ungift-ed at ya dot ru> ---
(In reply to Martin Liška from comment #1)
> Can you please attach a pre-processed file for an object that fails with
> objtool?

Heh... I'm afraid I need some howto for this... :(

But I made some minimal reproducible .config for kernel 5.7

$ tar xf linux-5.7.tar.xz
$ cd linux-5.7
$ curl
https://raw.githubusercontent.com/graysky2/kernel_gcc_patch/master/enable_additional_cpu_optimizations_for_gcc_v9.1%2B_kernel_v5.7%2B.patch
| patch -p1

$ copy .config10 .config
$ make oldconfig
$ make

I will attach my .config10

For me it fails:
  CC      arch/x86/entry/vdso/vma.o
  LDS     arch/x86/entry/vdso/vdso.lds
  AS      arch/x86/entry/vdso/vdso-note.o
  CC      arch/x86/entry/vdso/vclock_gettime.o
  CC      arch/x86/entry/vdso/vgetcpu.o
  VDSO    arch/x86/entry/vdso/vdso64.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso64.so
  HOSTCC  arch/x86/entry/vdso/vdso2c
  VDSO2C  arch/x86/entry/vdso/vdso-image-64.c
  CC      arch/x86/entry/vdso/vdso-image-64.o
  AR      arch/x86/entry/vdso/built-in.a
  CC      arch/x86/entry/vsyscall/vsyscall_64.o
arch/x86/entry/vsyscall/vsyscall_64.o: warning: objtool:
emulate_vsyscall()+0x60: can't find jump dest instruction at .text+0x10a
make[3]: *** [scripts/Makefile.build:267:
arch/x86/entry/vsyscall/vsyscall_64.o] Error 255
make[3]: *** Deleting file 'arch/x86/entry/vsyscall/vsyscall_64.o'
make[2]: *** [scripts/Makefile.build:488: arch/x86/entry/vsyscall] Error 2
make[1]: *** [scripts/Makefile.build:488: arch/x86/entry] Error 2
make: *** [Makefile:1729: arch/x86] Error 2

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (3 preceding siblings ...)
  2020-06-15 11:23 ` ungift-ed at ya dot ru
@ 2020-06-15 11:24 ` ungift-ed at ya dot ru
  2020-06-15 11:25 ` marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ungift-ed at ya dot ru @ 2020-06-15 11:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

--- Comment #5 from Maxim Britov <ungift-ed at ya dot ru> ---
Created attachment 48732
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48732&action=edit
some minimal config for kerknel 5.7 for reproduce

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (4 preceding siblings ...)
  2020-06-15 11:24 ` ungift-ed at ya dot ru
@ 2020-06-15 11:25 ` marxin at gcc dot gnu.org
  2020-06-15 11:57 ` schwab@linux-m68k.org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-15 11:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Maxim Britov from comment #4)
> (In reply to Martin Liška from comment #1)
> > Can you please attach a pre-processed file for an object that fails with
> > objtool?
> 
> Heh... I'm afraid I need some howto for this... :(
> 

Add -E option to the compilation and attach the output file.

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (5 preceding siblings ...)
  2020-06-15 11:25 ` marxin at gcc dot gnu.org
@ 2020-06-15 11:57 ` schwab@linux-m68k.org
  2020-06-15 12:05 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: schwab@linux-m68k.org @ 2020-06-15 11:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

--- Comment #7 from Andreas Schwab <schwab@linux-m68k.org> ---
make arch/x86/entry/vsyscall/vsyscall_64.i

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (6 preceding siblings ...)
  2020-06-15 11:57 ` schwab@linux-m68k.org
@ 2020-06-15 12:05 ` marxin at gcc dot gnu.org
  2020-06-15 12:08 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-15 12:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
I've got a reduced test-case:

$ cat lbr.i
int a, c, d;
long b;

void
fn1() {
  for (; c; c++) {
    int e, f = 0;
    if (a) {
      e = !(d & 1ULL << 63);
      f = e;
    }
    d = fn1;
    b = f;
  }
}

$ gcc lbr.i -c -O2 -march=bdver2 -c &&
~/Programming/linux/tools/objtool/objtool check --uaccess lbr.o
lbr.i: In function ‘fn1’:
lbr.i:12:7: warning: assignment to ‘int’ from ‘void (*)()’ makes integer from
pointer without a cast [-Wint-conversion]
   12 |     d = fn1;
      |       ^
lbr.o: warning: objtool: fn1()+0x26: can't find jump dest instruction at
.text+0x36

disassembly:
  26:   74 0e                   je     36 <fn1+0x36>
  28:   48 0f ba fa 1f          btc    $0x1f,%rdx
  2d:   8f ea f8 10 ca 1f 01    bextr  $0x11f,%rdx,%rcx
  34:   00 00 
  36:   ff c0                   inc    %eax

It seems to me bextr is not supported (parsed) by objtool?

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (7 preceding siblings ...)
  2020-06-15 12:05 ` marxin at gcc dot gnu.org
@ 2020-06-15 12:08 ` marxin at gcc dot gnu.org
  2020-06-15 12:09 ` ungift-ed at ya dot ru
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-15 12:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (8 preceding siblings ...)
  2020-06-15 12:08 ` marxin at gcc dot gnu.org
@ 2020-06-15 12:09 ` ungift-ed at ya dot ru
  2020-06-15 12:17 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ungift-ed at ya dot ru @ 2020-06-15 12:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

--- Comment #9 from Maxim Britov <ungift-ed at ya dot ru> ---
Created attachment 48733
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48733&action=edit
gcc -E ...

I believe attachment is what you aksed. I did

gcc -E -Wp,-MD,arch/x86/entry/vsyscall/.vsyscall_64.o.d -nostdinc -isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/include -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 -include ./include/linux/compiler_types.h
-D__KERNEL__ -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE
-Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security
-std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1
-falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3
-mskip-rax-setup -march=bdver2 -mno-red-zone -mcmodel=kernel -Wno-sign-compare
-fno-asynchronous-unwind-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 -fno-stack-protector -Wno-unused-but-set-variable
-Wimplicit-fallthrough -Wno-unused-const-variable -fno-omit-frame-pointer
-fno-optimize-sibling-calls -fno-var-tracking-assignments
-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-merge-all-constants
-fmerge-constants -fno-stack-check -fconserve-stack -Werror=date-time
-Werror=incompatible-pointer-types -Werror=designated-init
-fmacro-prefix-map=./= -Wno-packed-not-aligned   
-DKBUILD_MODFILE='"arch/x86/entry/vsyscall/vsyscall_64"'
-DKBUILD_BASENAME='"vsyscall_64"' -DKBUILD_MODNAME='"vsyscall_64"' -c -o
arch/x86/entry/vsyscall/vsyscall_64.o arch/x86/entry/vsyscall/vsyscall_64.c


Fail was:

make -f ./scripts/Makefile.build obj=arch/x86/entry/vsyscall \
 \
need-builtin=1 \
need-modorder=1
  gcc -Wp,-MD,arch/x86/entry/vsyscall/.vsyscall_64.o.d -nostdinc -isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/include -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 -include ./include/linux/compiler_types.h
-D__KERNEL__ -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE
-Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security
-std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1
-falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3
-mskip-rax-setup -march=bdver2 -mno-red-zone -mcmodel=kernel -Wno-sign-compare
-fno-asynchronous-unwind-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 -fno-stack-protector -Wno-unused-but-set-variable
-Wimplicit-fallthrough -Wno-unused-const-variable -fno-omit-frame-pointer
-fno-optimize-sibling-calls -fno-var-tracking-assignments
-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-merge-all-constants
-fmerge-constants -fno-stack-check -fconserve-stack -Werror=date-time
-Werror=incompatible-pointer-types -Werror=designated-init
-fmacro-prefix-map=./= -Wno-packed-not-aligned   
-DKBUILD_MODFILE='"arch/x86/entry/vsyscall/vsyscall_64"'
-DKBUILD_BASENAME='"vsyscall_64"' -DKBUILD_MODNAME='"vsyscall_64"' -c -o
arch/x86/entry/vsyscall/vsyscall_64.o arch/x86/entry/vsyscall/vsyscall_64.c
   ./tools/objtool/objtool check  --uaccess
arch/x86/entry/vsyscall/vsyscall_64.o
arch/x86/entry/vsyscall/vsyscall_64.o: warning: objtool:
emulate_vsyscall()+0x60: can't find jump dest instruction at .text+0xca
make[3]: *** [scripts/Makefile.build:267:
arch/x86/entry/vsyscall/vsyscall_64.o] Error 255
make[3]: *** Deleting file 'arch/x86/entry/vsyscall/vsyscall_64.o'
make[2]: *** [scripts/Makefile.build:488: arch/x86/entry/vsyscall] Error 2
make[1]: *** [scripts/Makefile.build:488: arch/x86/entry] Error 2
make: *** [Makefile:1729: arch/x86] Error 2

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (9 preceding siblings ...)
  2020-06-15 12:09 ` ungift-ed at ya dot ru
@ 2020-06-15 12:17 ` marxin at gcc dot gnu.org
  2020-06-15 12:34 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-15 12:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

--- Comment #10 from Martin Liška <marxin at gcc dot gnu.org> ---
Yep, I've already created a reduced-testcase myself:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671#c6

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (10 preceding siblings ...)
  2020-06-15 12:17 ` marxin at gcc dot gnu.org
@ 2020-06-15 12:34 ` jakub at gcc dot gnu.org
  2020-06-15 13:18 ` jakub at gcc dot gnu.org
  2020-06-15 14:41 ` ungift-ed at ya dot ru
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-06-15 12:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That is clearly a kernel/objtool bug.
Seems it has its own x86_64 instruction decoder and has some VEX decoding code,
but either not well tested or not working in this particular case.
Kernel doesn't normally use floating point or SIMD instructions, therefore I'd
expect that it only rarely uses VEX encoded instructions, and BEXTR is one of
the few general purpose instructions that are VEX encoded.

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (11 preceding siblings ...)
  2020-06-15 12:34 ` jakub at gcc dot gnu.org
@ 2020-06-15 13:18 ` jakub at gcc dot gnu.org
  2020-06-15 14:41 ` ungift-ed at ya dot ru
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-06-15 13:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Please report it to kernel bugzilla or whatever objtool has bugtracker.
https://bugs.gentoo.org/642924
is very likely exactly the same thing, but not sure if they have reported it
upstream.

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

* [Bug target/95671] Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm
  2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
                   ` (12 preceding siblings ...)
  2020-06-15 13:18 ` jakub at gcc dot gnu.org
@ 2020-06-15 14:41 ` ungift-ed at ya dot ru
  13 siblings, 0 replies; 15+ messages in thread
From: ungift-ed at ya dot ru @ 2020-06-15 14:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671

--- Comment #13 from Maxim Britov <ungift-ed at ya dot ru> ---
New report https://bugzilla.kernel.org/show_bug.cgi?id=208187

Thanks!

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

end of thread, other threads:[~2020-06-15 14:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-14 11:17 [Bug c/95671] New: Fails to build kernel 5.7 with -march=bdver{2,3,4} workaround -mno-tbm ungift-ed at ya dot ru
2020-06-15  6:49 ` [Bug target/95671] " marxin at gcc dot gnu.org
2020-06-15  6:56 ` rguenth at gcc dot gnu.org
2020-06-15 11:19 ` ungift-ed at ya dot ru
2020-06-15 11:23 ` ungift-ed at ya dot ru
2020-06-15 11:24 ` ungift-ed at ya dot ru
2020-06-15 11:25 ` marxin at gcc dot gnu.org
2020-06-15 11:57 ` schwab@linux-m68k.org
2020-06-15 12:05 ` marxin at gcc dot gnu.org
2020-06-15 12:08 ` marxin at gcc dot gnu.org
2020-06-15 12:09 ` ungift-ed at ya dot ru
2020-06-15 12:17 ` marxin at gcc dot gnu.org
2020-06-15 12:34 ` jakub at gcc dot gnu.org
2020-06-15 13:18 ` jakub at gcc dot gnu.org
2020-06-15 14:41 ` ungift-ed at ya dot ru

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).