public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
       [not found] <bug-29838-4@http.gcc.gnu.org/bugzilla/>
@ 2015-01-08 17:12 ` egall at gwmail dot gwu.edu
  0 siblings, 0 replies; 10+ messages in thread
From: egall at gwmail dot gwu.edu @ 2015-01-08 17:12 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Gallager <egall at gwmail dot gwu.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egall at gwmail dot gwu.edu

--- Comment #11 from Eric Gallager <egall at gwmail dot gwu.edu> ---
If changing the code generation or adding a new flag to control this is too
difficult, how about just adding this to the list of things that
"-Wstack-protector" warns about in the meantime?


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

* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
  2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
                   ` (7 preceding siblings ...)
  2006-11-15 11:01 ` samuel dot thibault at ens-lyon dot org
@ 2006-12-15 19:30 ` tschwinge at gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: tschwinge at gnu dot org @ 2006-12-15 19:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from tschwinge at gnu dot org  2006-12-15 19:30 -------
Roland McGrath proposed the following: ``I think it really ought to be
controlled by a -mno-stack-protector-tls or suchlike, for complete flexibility.
 Obviously it should default to disabled for -ffreestanding.''


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838


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

* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
  2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
                   ` (6 preceding siblings ...)
  2006-11-15 10:41 ` jakub at gcc dot gnu dot org
@ 2006-11-15 11:01 ` samuel dot thibault at ens-lyon dot org
  2006-12-15 19:30 ` tschwinge at gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: samuel dot thibault at ens-lyon dot org @ 2006-11-15 11:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from samuel dot thibault at ens-lyon dot org  2006-11-15 11:01 -------
About not using -fstack-protector, the problem is that it is the default on
ubuntu for instance.  That would mean we have to explicitely use
-fno-stack-protector, but only for recent versions of gcc, so we'll have to
detect that, etc... Not counting all such new options that may arise which we'd
have to disable...

Please answer this, at least by just yes/no: you're saying that -ffreestanding
doesn't mean "an OS kernel" (as manual says), but "the kernel of the target",
so that people working on other kernels will have to first build a
cross-compiler? (the bug is a documentation bug then)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838


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

* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
  2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
                   ` (5 preceding siblings ...)
  2006-11-15 10:38 ` jakub at gcc dot gnu dot org
@ 2006-11-15 10:41 ` jakub at gcc dot gnu dot org
  2006-11-15 11:01 ` samuel dot thibault at ens-lyon dot org
  2006-12-15 19:30 ` tschwinge at gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-11-15 10:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2006-11-15 10:41 -------
If you use __thread in -ffreestanding it is the same, you don't get emulated
TLS either.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838


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

* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
  2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
                   ` (4 preceding siblings ...)
  2006-11-15 10:30 ` samuel dot thibault at ens-lyon dot org
@ 2006-11-15 10:38 ` jakub at gcc dot gnu dot org
  2006-11-15 10:41 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-11-15 10:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2006-11-15 10:37 -------
Using %fs:0x28/%gs:0x28 on x86_64-linux resp. %gs:0x14 on i?86-linux is part
of the ABI.  -ffreestanding is not supposed to change the ABI, so if you
don't want to use this ABI, just use a different target (x86_64-elf etc., or
don't use -fstack-protector (nobody forces you to use that).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838


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

* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
  2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
                   ` (3 preceding siblings ...)
  2006-11-15 10:23 ` jakub at gcc dot gnu dot org
@ 2006-11-15 10:30 ` samuel dot thibault at ens-lyon dot org
  2006-11-15 10:38 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: samuel dot thibault at ens-lyon dot org @ 2006-11-15 10:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from samuel dot thibault at ens-lyon dot org  2006-11-15 10:30 -------
So you are saying that gcc now imposes (whatever the kernel) kernel-land and
user-land to use the same TLS scheme, and now requires people to build a
cross-compiler before building a kernel from another kernel's userland?  I
thought -ffreestanding was precisely meant to escape such considerations...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838


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

* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
  2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
                   ` (2 preceding siblings ...)
  2006-11-15 10:11 ` tschwinge at gnu dot org
@ 2006-11-15 10:23 ` jakub at gcc dot gnu dot org
  2006-11-15 10:30 ` samuel dot thibault at ens-lyon dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-11-15 10:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2006-11-15 10:23 -------
Linux kernel has this support planned:
http://lkml.org/lkml/2006/08/16/216
http://lkml.org/lkml/2006/08/16/217
http://lkml.org/lkml/2006/08/16/218
http://lkml.org/lkml/2006/08/16/220
http://lkml.org/lkml/2006/08/16/221
http://lkml.org/lkml/2006/08/16/222
Linux -ffreestanding should stay as is.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838


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

* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
  2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
  2006-11-15  2:50 ` [Bug target/29838] " pinskia at gcc dot gnu dot org
  2006-11-15  9:33 ` samuel dot thibault at ens-lyon dot org
@ 2006-11-15 10:11 ` tschwinge at gnu dot org
  2006-11-15 10:23 ` jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tschwinge at gnu dot org @ 2006-11-15 10:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tschwinge at gnu dot org  2006-11-15 10:11 -------
Cced to Jakub Jelinek, who originally implemented this functionality.  Could
you please comment on this issue?


-- 

tschwinge at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838


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

* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
  2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
  2006-11-15  2:50 ` [Bug target/29838] " pinskia at gcc dot gnu dot org
@ 2006-11-15  9:33 ` samuel dot thibault at ens-lyon dot org
  2006-11-15 10:11 ` tschwinge at gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: samuel dot thibault at ens-lyon dot org @ 2006-11-15  9:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from samuel dot thibault at ens-lyon dot org  2006-11-15 09:33 -------
Mmm, if I have to use another target for avoiding my default target's specific
stuff, what is the use of -ffreestanding?

Does that mean that we will have to add a linux-kernel target (as opposed to
linux-user target) and build a cross-compiler before building a linux kernel?
(replace "linux" with whatever kernel you want).

And x86_64 Linux just poses the same problem: it emits %fs:0x28 instead of
%gs:0x14, but it's just the same issue.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838


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

* [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode
  2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
@ 2006-11-15  2:50 ` pinskia at gcc dot gnu dot org
  2006-11-15  9:33 ` samuel dot thibault at ens-lyon dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-11-15  2:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-11-15 02:50 -------
Seems to me, you should not be using a target that defines
TARGET_THREAD_SSP_OFFSET for -ffreestanding mode.  Also IIRC the x86_64 Linux
has a different TLS base register which fixes this issue there.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838


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

end of thread, other threads:[~2015-01-08 17:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-29838-4@http.gcc.gnu.org/bugzilla/>
2015-01-08 17:12 ` [Bug target/29838] -fstack-protector shouldn't use TLS in freestanding mode egall at gwmail dot gwu.edu
2006-11-15  1:14 [Bug c/29838] New: " samuel dot thibault at ens-lyon dot org
2006-11-15  2:50 ` [Bug target/29838] " pinskia at gcc dot gnu dot org
2006-11-15  9:33 ` samuel dot thibault at ens-lyon dot org
2006-11-15 10:11 ` tschwinge at gnu dot org
2006-11-15 10:23 ` jakub at gcc dot gnu dot org
2006-11-15 10:30 ` samuel dot thibault at ens-lyon dot org
2006-11-15 10:38 ` jakub at gcc dot gnu dot org
2006-11-15 10:41 ` jakub at gcc dot gnu dot org
2006-11-15 11:01 ` samuel dot thibault at ens-lyon dot org
2006-12-15 19:30 ` tschwinge at gnu dot org

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