Talk:Libgcc without red zone: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
Content added Content deleted
(note that CFLAGS_FOR_TARGET is the supported method)
 
m (Reformat and add missing signature)
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
== For a userland-less GCC, isn't this normally done with <code>CFLAGS_FOR_TARGET</code>? ==
== For a userland-less GCC, isn't this normally done with <code>CFLAGS_FOR_TARGET</code>? ==


Given that a <code>x86_64-pc-elf</code> GCC is mostly useless for userland programming (without -mno-red-zone), shouldn't it just be built with <code>CFLAGS_FOR_TARGET=-mno-red-zone</code>? See this gcc-help posting: [https://gcc.gnu.org/ml/gcc-help/2011-07/msg00158.html]. Also, it'd be interesting to know how this is achieved in Linux, *BSD, &c. kernels that are built with a conventional userland compiler and don't have (?) a special libgcc.
Given that a <code>x86_64-pc-elf</code> GCC is mostly useless for userland programming (without -mno-red-zone), shouldn't it just be built with <code>CFLAGS_FOR_TARGET=-mno-red-zone</code>? See this gcc-help posting: [https://gcc.gnu.org/ml/gcc-help/2011-07/msg00158.html]. Also, it'd be interesting to know how this is achieved in Linux, *BSD, &c. kernels that are built with a conventional userland compiler and don't have (?) a special libgcc. --[[User:Alexshpilkin]] (Forgot to sign message)
:Thank's for bringing the topic up. I tried <code>CFLAGS_FOR_TARGET</code> (as that flag is documented by gcc) but it's silently ignored when building the <code>crtbegin</code> and <code>crtend</code> objects. Trust me with this. It took about three days to figure out a clean way to get the <code>-mno-redzone</code> to apply to these files. We also had lots of discussion on that topic in #osdev. --[[User:Shirk|Shirk]] 12:00, 23 October 2014 (CDT)

Latest revision as of 19:59, 23 October 2014

For a userland-less GCC, isn't this normally done with CFLAGS_FOR_TARGET?

Given that a x86_64-pc-elf GCC is mostly useless for userland programming (without -mno-red-zone), shouldn't it just be built with CFLAGS_FOR_TARGET=-mno-red-zone? See this gcc-help posting: [1]. Also, it'd be interesting to know how this is achieved in Linux, *BSD, &c. kernels that are built with a conventional userland compiler and don't have (?) a special libgcc. --User:Alexshpilkin (Forgot to sign message)

Thank's for bringing the topic up. I tried CFLAGS_FOR_TARGET (as that flag is documented by gcc) but it's silently ignored when building the crtbegin and crtend objects. Trust me with this. It took about three days to figure out a clean way to get the -mno-redzone to apply to these files. We also had lots of discussion on that topic in #osdev. --Shirk 12:00, 23 October 2014 (CDT)