Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to enable GCC for gentoo -fstack-clash-protection to fix
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gentoo-find
n00b
n00b


Joined: 07 Apr 2018
Posts: 74

PostPosted: Sat Jan 12, 2019 5:39 am    Post subject: How to enable GCC for gentoo -fstack-clash-protection to fix Reply with quote

https://www.openwall.com/lists/oss-security/2019/01/09/3

How to enable GCC for gentoo -fstack-clash-protection to fix systemd cve
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat Jan 12, 2019 6:44 am    Post subject: Reply with quote

Add it to your *FLAGS vars in make.conf and emerge -e @world.
Back to top
View user's profile Send private message
gentoo-find
n00b
n00b


Joined: 07 Apr 2018
Posts: 74

PostPosted: Sat Jan 12, 2019 10:22 am    Post subject: Reply with quote

Ant P. wrote:
Add it to your *FLAGS vars in make.conf and emerge -e @world.


COMMON_FLAGS="-fstack-clash-protection" ?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30909
Location: here

PostPosted: Sat Jan 12, 2019 10:26 am    Post subject: Reply with quote

gentoo-find wrote:
Ant P. wrote:
Add it to your *FLAGS vars in make.conf and emerge -e @world.


COMMON_FLAGS="-fstack-clash-protection" ?

I think Ant P. means
Code:
CFLAGS="<your current cflags> -fstack-clash-protection"
CXXFLAGS="${CFLAGS}"

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Sat Jan 12, 2019 5:02 pm    Post subject: Reply with quote

Also, be sure you use a gcc that understands that option. It appears to be new in 8.x. If you use it in an older version, gcc will reject it and the build will fail.
Code:
$ gcc-7.3.0 -x c -o /dev/null /dev/null -c -fstack-clash-protection
gcc-7.3.0: error: unrecognized command line option '-fstack-clash-protection'; did you mean '-fstack-protector'?
$ gcc-8.2.0 -x c -o /dev/null /dev/null -c -fstack-clash-protection
$
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30909
Location: here

PostPosted: Sat Jan 12, 2019 9:11 pm    Post subject: Reply with quote

Hu wrote:
Also, be sure you use a gcc that understands that option. It appears to be new in 8.x. If you use it in an older version, gcc will reject it and the build will fail.]

Thanks for the tips Hu, I missed this one.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
kurly
Apprentice
Apprentice


Joined: 02 Apr 2012
Posts: 260

PostPosted: Sat Jan 12, 2019 9:44 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Hu wrote:
Also, be sure you use a gcc that understands that option. It appears to be new in 8.x. If you use it in an older version, gcc will reject it and the build will fail.]

Thanks for the tips Hu, I missed this one.

Should be on already?
Code:
kurly@smile ~ $ LANG=C gcc-8.2.0 -Q --help=common | fgrep stack-clash
  -fstack-clash-protection          [enabled]
Back to top
View user's profile Send private message
Tom_
Guru
Guru


Joined: 20 May 2004
Posts: 444
Location: France

PostPosted: Fri Feb 08, 2019 4:23 pm    Post subject: Reply with quote

I wonder if any of you has already enabled this flag globally. Does this flag cause compilation issue ?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Feb 08, 2019 6:49 pm    Post subject: Reply with quote

Tom_ wrote:
I wonder if any of you has already enabled this flag globally. Does this flag cause compilation issue ?

Evidently not, if you'd read the post directly above yours you'll see we already all have it enabled.
Back to top
View user's profile Send private message
Tom_
Guru
Guru


Joined: 20 May 2004
Posts: 444
Location: France

PostPosted: Fri Feb 08, 2019 7:13 pm    Post subject: Reply with quote

Of course I read the post above but I didn't understand it at first. I thought that this command showed gcc capabilities (to show that gcc-8 was required for this flag) but not actual compiler flags. Sorry
Back to top
View user's profile Send private message
Moonboots
Apprentice
Apprentice


Joined: 02 Dec 2006
Posts: 161

PostPosted: Tue Feb 12, 2019 11:27 am    Post subject: Reply with quote

https://bugs.gentoo.org/675050
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum