All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [UML] 3.16 build without optimization fails
@ 2014-08-19 20:19 Thomas Meyer
  2014-08-19 20:25 ` Valdis.Kletnieks
  2014-08-19 20:26 ` Richard Weinberger
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Meyer @ 2014-08-19 20:19 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Linux Kernel Mailing List

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 951 bytes --]

Hi.

Thanks for your answer.

There goes my plan to better understand an UML kernel lock up by using a debugger... Everything gets optimised out with -O2 :-(

Can you give an example function that relies on this GCC feature?

With kind regards
Thomas

Am 19.08.2014 22:06 schrieb Valdis.Kletnieks@vt.edu:
>
> On Tue, 19 Aug 2014 21:12:10 +0200, Thomas Meyer said: 
> > > Hi, 
> > > 
> > > the build with -O0 fails with: 
>
> > > bug or feature? 
> > > 
> > > any ideas? 
>
> Feature.  The kernel is *known* to not build with -O0, because that 
> disables *all* function inlining, and there's several functions that *have* 
> to be inlined in order to function properly (most notably, anything 
> that uses the gcc __builtin_return_address in a function that is expected 
> to be inlined). 
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [UML] 3.16 build without optimization fails
  2014-08-19 20:19 [UML] 3.16 build without optimization fails Thomas Meyer
@ 2014-08-19 20:25 ` Valdis.Kletnieks
  2014-08-19 20:26 ` Richard Weinberger
  1 sibling, 0 replies; 6+ messages in thread
From: Valdis.Kletnieks @ 2014-08-19 20:25 UTC (permalink / raw)
  To: Thomas Meyer; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

On Tue, 19 Aug 2014 22:19:58 +0200, Thomas Meyer said:

> Can you give an example function that relies on this GCC feature?

cd /usr/src/linux && find include -type f | xargs grep __builtin_return_address

[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]

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

* Re: [UML] 3.16 build without optimization fails
  2014-08-19 20:19 [UML] 3.16 build without optimization fails Thomas Meyer
  2014-08-19 20:25 ` Valdis.Kletnieks
@ 2014-08-19 20:26 ` Richard Weinberger
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Weinberger @ 2014-08-19 20:26 UTC (permalink / raw)
  To: Thomas Meyer; +Cc: Valdis Kletnieks, Linux Kernel Mailing List, linux

On Tue, Aug 19, 2014 at 10:19 PM, Thomas Meyer <thomas@m3y3r.de> wrote:
> Hi.
>
> Thanks for your answer.
>
> There goes my plan to better understand an UML kernel lock up by using a debugger... Everything gets optimised out with -O2 :-(

Is it the filesystem/block lockup you saw some time ago?
Maybe Thorsten can give more details.
He sent me an patch off list a few days ago.

> Can you give an example function that relies on this GCC feature?
>
> With kind regards
> Thomas
>
> Am 19.08.2014 22:06 schrieb Valdis.Kletnieks@vt.edu:
>>
>> On Tue, 19 Aug 2014 21:12:10 +0200, Thomas Meyer said:
>> > > Hi,
>> > >
>> > > the build with -O0 fails with:
>>
>> > > bug or feature?
>> > >
>> > > any ideas?
>>
>> Feature.  The kernel is *known* to not build with -O0, because that
>> disables *all* function inlining, and there's several functions that *have*
>> to be inlined in order to function properly (most notably, anything
>> that uses the gcc __builtin_return_address in a function that is expected
>> to be inlined).



-- 
Thanks,
//richard

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

* Re: [UML] 3.16 build without optimization fails
@ 2014-08-19 20:35 Thomas Meyer
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Meyer @ 2014-08-19 20:35 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux, Linux Kernel Mailing List, Valdis Kletnieks

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1418 bytes --]

Yes, it's still there.

Am 19.08.2014 22:26 schrieb Richard Weinberger <richard.weinberger@gmail.com>:
>
> On Tue, Aug 19, 2014 at 10:19 PM, Thomas Meyer <thomas@m3y3r.de> wrote: 
> > Hi. 
> > 
> > Thanks for your answer. 
> > 
> > There goes my plan to better understand an UML kernel lock up by using a debugger... Everything gets optimised out with -O2 :-( 
>
> Is it the filesystem/block lockup you saw some time ago? 
> Maybe Thorsten can give more details. 
> He sent me an patch off list a few days ago. 
>
> > Can you give an example function that relies on this GCC feature? 
> > 
> > With kind regards 
> > Thomas 
> > 
> > Am 19.08.2014 22:06 schrieb Valdis.Kletnieks@vt.edu: 
> >> 
> >> On Tue, 19 Aug 2014 21:12:10 +0200, Thomas Meyer said: 
> >> > > Hi, 
> >> > > 
> >> > > the build with -O0 fails with: 
> >> 
> >> > > bug or feature? 
> >> > > 
> >> > > any ideas? 
> >> 
> >> Feature.  The kernel is *known* to not build with -O0, because that 
> >> disables *all* function inlining, and there's several functions that *have* 
> >> to be inlined in order to function properly (most notably, anything 
> >> that uses the gcc __builtin_return_address in a function that is expected 
> >> to be inlined). 
>
>
>
> -- 
> Thanks, 
> //richard 
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [UML] 3.16 build without optimization fails
  2014-08-19 19:12 Thomas Meyer
@ 2014-08-19 20:06 ` Valdis.Kletnieks
  0 siblings, 0 replies; 6+ messages in thread
From: Valdis.Kletnieks @ 2014-08-19 20:06 UTC (permalink / raw)
  To: Thomas Meyer; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 445 bytes --]

On Tue, 19 Aug 2014 21:12:10 +0200, Thomas Meyer said:
> > Hi,
> >
> > the build with -O0 fails with:

> > bug or feature?
> >
> > any ideas?

Feature.  The kernel is *known* to not build with -O0, because that
disables *all* function inlining, and there's several functions that *have*
to be inlined in order to function properly (most notably, anything
that uses the gcc __builtin_return_address in a function that is expected
to be inlined).

[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]

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

* [UML] 3.16 build without optimization fails
@ 2014-08-19 19:12 Thomas Meyer
  2014-08-19 20:06 ` Valdis.Kletnieks
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Meyer @ 2014-08-19 19:12 UTC (permalink / raw)
  To: Linux Kernel Mailing List

> Hi,
> 
> the build with -O0 fails with:
> 
> make -f scripts/Makefile.build obj=init
>   gcc -Wp,-MD,init/.main.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include -I./arch/um/include -Iarch/um/include/generated  -Iinclude -I./arch/um/include/uapi -Iarch/um/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -m64 -I./arch/x86/um -I./arch/x86/include -I./arch/x86/include/uapi -Iarch/x86/include/generated -Iarch/x86/include/generated/uapi -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -mcmodel=large -fno-builtin -m64 -funit-at-a-time -D__arch_um__ -I./arch/um/include/shared -I./arch/x86/um/shared -I./arch/um/include/shared/skas -Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask -Dmktime=kernel_mktime -fno-delete-null-pointer-checks -O0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(main)"  -D"KBUILD_MODNAME=KBUILD_STR(main)" -c -o init/main.o init/main.c
> In file included from ./arch/um/include/asm/fixmap.h:58:0,
>                  from ./arch/um/include/asm/pgtable.h:11,
>                  from include/linux/mm.h:51,
>                  from include/linux/ring_buffer.h:5,
>                  from include/linux/ftrace_event.h:5,
>                  from include/trace/syscall.h:6,
>                  from include/linux/syscalls.h:80,
>                  from init/main.c:18:
> include/asm-generic/fixmap.h: In function 'fix_to_virt':
> include/asm-generic/fixmap.h:31:2: error: size of unnamed array is negative
>   BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
>   ^
> make[1]: *** [init/main.o] Error 1
> make: *** [init] Error 2
> 
> bug or feature?
> 
> any ideas?
> 
> switching BUILD_BUG_ON unconditionally to BUILD_BUG_ON_MSG - which uses compiletime_assert() - breaks the build a bit later here:
> 
>   gcc -Wp,-MD,arch/um/kernel/skas/.uaccess.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include -I./arch/um/include -Iarch/um/include/generated  -Iinclude -I./arch/um/include/uapi -Iarch/um/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -m64 -I./arch/x86/um -I./arch/x86/include -I./arch/x86/include/uapi -Iarch/x86/include/generated -Iarch/x86/include/generated/uapi -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -mcmodel=large -fno-builtin -m64 -funit-at-a-time -D__arch_um__ -I./arch/um/include/shared -I./arch/x86/um/shared -I./arch/um/include/shared/skas -Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask -Dmktime=kernel_mktime -fno-delete-null-pointer-checks -O0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(uaccess)"  -D"KBUILD_MODNAME=KBUILD_STR(uaccess)" -c -o arch/um/kernel/skas/uaccess.o arch/um/kernel/skas/uaccess.c
> In file included from include/linux/err.h:4:0,
>                  from arch/um/kernel/skas/uaccess.c:6:
> arch/um/kernel/skas/uaccess.c: In function 'do_op_one_page':
> include/linux/compiler.h:346:20: error: call to '__compiletime_assert_85' declared with attribute error: BUILD_BUG_ON failed: __same_type(((void *)addr), struct page *)
>     prefix ## suffix();    \
>                     ^
> include/linux/compiler.h:351:2: note: in expansion of macro '__compiletime_assert'
>   __compiletime_assert(condition, msg, prefix, suffix)
>   ^
> include/linux/compiler.h:363:2: note: in expansion of macro '_compiletime_assert'
>   _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
>   ^
> include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
>  #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>                                      ^
> include/linux/bug.h:74:1: note: in expansion of macro 'BUILD_BUG_ON_MSG'
>  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
>  ^
> include/linux/highmem.h:125:2: note: in expansion of macro 'BUILD_BUG_ON'
>   BUILD_BUG_ON(__same_type((addr), struct page *));       \
>   ^
> arch/um/kernel/skas/uaccess.c:85:2: note: in expansion of macro 'kunmap_atomic'
>   kunmap_atomic((void *)addr);
>   ^
> make[2]: *** [arch/um/kernel/skas/uaccess.o] Error 1
> make[1]: *** [arch/um/kernel/skas] Error 2
> make: *** [arch/um/kernel] Error 2
> 



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

end of thread, other threads:[~2014-08-19 20:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-19 20:19 [UML] 3.16 build without optimization fails Thomas Meyer
2014-08-19 20:25 ` Valdis.Kletnieks
2014-08-19 20:26 ` Richard Weinberger
  -- strict thread matches above, loose matches on Subject: below --
2014-08-19 20:35 Thomas Meyer
2014-08-19 19:12 Thomas Meyer
2014-08-19 20:06 ` Valdis.Kletnieks

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.