Linux kernel support -O0 optimization flag?
Change KBUILD_CFLAGS to -O0 in Makefile and got the compilation error as below.
Is the Linux kernel support -O0 optimization flag?
Note, I have tried 2 architecture compilers and got the same error.
In function 'zap_pmd_range',
inlined from 'zap_pud_range' at mm/memory.c:1288:8,
inlined from 'unmap_page_range' at mm/memory.c:1313:8:mm/memory.c:1243:23: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed
make[1]: *** [mm/memory.o] Error 1
Quoted 5 lines · Ley Foon Tan
Change
KBUILD_CFLAGSto -O0 inMakefileand got the compilation error as below.
Is the Linux kernel support -O0 optimization flag?
No. If I'm not mistaken we need this to make sure that the compiler inlines some functions.
In your case the compiler failed to compute the BUILD_BUG() macro correctly. It depends also on optimization.
--
Thanks,
//richard
Quoted 6 lines · richard -rw- weinberger
No. If I'm not mistaken we need this to make sure that the compiler inlines some functions.
In your case the compiler failed to compute the
BUILD_BUG()macro correctly. It depends also on optimization.
Thank you.
So, the supported optimization flags are -O1, -O2, -O3 and -Os?
Regards
LFTAN
Quoted 7 lines · richard -rw- weinberger
Quoted 5 lines · Ley Foon Tan
Change
KBUILD_CFLAGSto -O0 inMakefileand got the compilation error as below.
Is the Linux kernel support -O0 optimization flag?
Quoted 5 lines
No. If I'm not mistaken we need this to make sure that the compiler inlines some functions.
In your case the compiler failed to compute the
BUILD_BUG()macro correctly. It depends also on optimization.
Actually... You probably could replace BUILD_BUG() with nop. Bugs are not expected to happen, right? you'll probably hit something else...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html