Messages in this thread | | | Date | Wed, 22 Apr 2020 19:02:51 +0200 | From | Jakub Jelinek <> | Subject | Re: [PATCH v2] x86: fix early boot crash on gcc-10 |
| |
On Wed, Apr 22, 2020 at 06:53:39PM +0200, Borislav Petkov wrote: > > $ cat asm-detect.c > > int foo(int a); > > int bar(int a) > > { > > int r = foo(a); > > asm (""); > > return r; > > } > > > > $ gcc -O2 -c asm-detect.c -S -o/dev/stdout | grep jmp > > [no output] > > That is a good test to run at the beginning of the compilation I guess.
If it is x86 specific, it can work, though I'd suggest -o - instead of -o/dev/stdout and being more picky on where you want to match the jmp, as you don't want to match it in comments, or say filenames in the asm file etc. E.g. require that jmp must be preceeded on the line only by whitespace and followed by whitespace.
Jakub
| |