Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
-fstack-protector not supported by compiler?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue Mar 14, 2017 7:21 pm    Post subject: -fstack-protector not supported by compiler? Reply with quote

Trying to install/compile the gentoo-sources kernel 4.9.6-r1, and it fails with the following error:
Code:
*Enable tracing for RCU (RCU_TRACE) [N/y/?] n
*Provide debugging asserts for adding NO_HZ support to an arch (RCU_EQS_DEBUG) [N/y/?] (NEW)
*Force round-robin CPU selection for unbound work items (DEBUG_WQ_FORCE_RR_CPU) [N/y/?] (NEW)
*Force extended block device numbers and spread them (DEBUG_BLOCK_EXT_DEVT) [N/y/?] n
*Enable CPU hotplug state control (CPU_HOTPLUG_STATE_CONTROL) [N/y/?] (NEW)
*Notifier error injection (NOTIFIER_ERROR_INJECTION) [N/m/y/?] (NEW)
*--
*  SYSTBL  arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h
*  HOSTCC  scripts/basic/bin2c
*  CHK     include/config/kernel.release
*  UPD     include/config/kernel.release
*Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
*make: *** [Makefile:1066: prepare-compiler-check] Error 1
*--


All of the searching I've done seems to indicate that gcc needs to be updated to compile the newer kernels. But all of the forum and mailing list threads I can find are usually talking about "older" gcc's, e.g. 4.3.x/4.4.x, etc. I'm currently on gcc-4.9.4 and it seems the only newer versions in portage are 5.x.

Do I need to migrate to gcc-5.x to compile this kernel? If so, shouldn't the kernel ebuild require >=gcc-5.x?

Am I missing something?

TIA
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43223
Location: 56N 3W

PostPosted: Tue Mar 14, 2017 8:08 pm    Post subject: Reply with quote

dataking,

What does
Code:
gcc-config -l
show?
and the output of
Code:
emerge sys-devel/gcc -pv
please?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Syl20
Guru
Guru


Joined: 04 Aug 2005
Posts: 564
Location: France

PostPosted: Wed Mar 15, 2017 1:32 pm    Post subject: Re: -fstack-protector not supported by compiler? Reply with quote

dataking wrote:
Do I need to migrate to gcc-5.x to compile this kernel?

You don't. Gcc 4.9 does support -fstack-protector (and even -fstack-protector-strong).
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Wed Mar 15, 2017 5:04 pm    Post subject: Reply with quote

Neddy, requested output below. Thanks!

NeddySeagoon wrote:
Code:
gcc-config -l

Code:
$ sudo gcc-config -l
 [1] i686-pc-linux-gnu-4.9.4 *

NeddySeagoon wrote:
Code:
emerge sys-devel/gcc -pv

Code:
$ sudo emerge -pv sys-devel/gcc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-devel/gcc-4.9.4:4.9.4::gentoo  USE="cxx fortran nls nptl openmp sanitize vtv (-altivec) (-awt) -cilk -debug -doc (-fixed-point) -gcj -go -graphite (-hardened) (-libssp) (-multilib) -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla" 88,027 KiB

Total: 1 package (1 reinstall), Size of downloads: 88,027 KiB

_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1696

PostPosted: Wed Mar 15, 2017 5:17 pm    Post subject: Reply with quote

Quote:
If so, shouldn't the kernel ebuild require >=gcc-5.x?


The kernel it's self does not depend on gcc-5, because you enabled that kernel config option, that is why it is needing gcc-5; you could easily disable that config option and not depend on gcc-5...
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Wed Mar 15, 2017 10:23 pm    Post subject: Reply with quote

ct85711 wrote:
Quote:
If so, shouldn't the kernel ebuild require >=gcc-5.x?


The kernel it's self does not depend on gcc-5, because you enabled that kernel config option, that is why it is needing gcc-5; you could easily disable that config option and not depend on gcc-5...
Well, if it's really Just That Simple™...... ;-)

The odd thing about it though, is this is just from a "genkernel all". I'm not trying to do anything "fancy". (genkernel.conf is also *mostly* default.) Which should mean that others trying to build/install this kernel with genkernel should be seeing similar issues. If they aren't then it's something unique to my environment. The problem is, I have no idea what (is unique)!
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
Parmenides
n00b
n00b


Joined: 02 Apr 2008
Posts: 15

PostPosted: Mon Jun 05, 2017 9:54 am    Post subject: Reply with quote

dataking wrote:
ct85711 wrote:
Quote:
If so, shouldn't the kernel ebuild require >=gcc-5.x?


The kernel it's self does not depend on gcc-5, because you enabled that kernel config option, that is why it is needing gcc-5; you could easily disable that config option and not depend on gcc-5...
Well, if it's really Just That Simple™...... ;-)

The odd thing about it though, is this is just from a "genkernel all". I'm not trying to do anything "fancy". (genkernel.conf is also *mostly* default.) Which should mean that others trying to build/install this kernel with genkernel should be seeing similar issues. If they aren't then it's something unique to my environment. The problem is, I have no idea what (is unique)!


same problem and no idea how to solve
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Mon Jun 05, 2017 10:46 am    Post subject: Reply with quote

You need the option off, or a gcc that could use it.

I highly recommand you upgrade gcc to 5, because of ABI change, please read https://www.gentoo.org/support/news-items/2015-10-22-gcc-5-new-c++11-abi.html
Back to top
View user's profile Send private message
Tzvi
n00b
n00b


Joined: 22 Jun 2017
Posts: 3

PostPosted: Thu Jun 22, 2017 2:48 pm    Post subject: Reply with quote

I am having the exact same issue; but I am already running GCC 5.x (5.4.0)

At this point I think it makes sense for me to turn the option off; but I am a newbie and not quite sure how to do that. I tried using genkernal --menuconfig all, but I have no idea what exactly I need to turn off.

Any help?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43223
Location: 56N 3W

PostPosted: Thu Jun 22, 2017 3:06 pm    Post subject: Reply with quote

Tzvi,

Have you selected gcc-5.4 and performed the revdep-rebuild or do you have gcc-5.4 installed but not yet in use?
What does
Code:
gcc-config -l
say?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Tzvi
n00b
n00b


Joined: 22 Jun 2017
Posts: 3

PostPosted: Thu Jun 22, 2017 4:47 pm    Post subject: Reply with quote

I managed to find the option to disable and everything is working well now.

Thanks NeddySeagoon
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43223
Location: 56N 3W

PostPosted: Thu Jun 22, 2017 4:53 pm    Post subject: Reply with quote

Tzvi,

It works for the wrong reasons.
fstack-protector is a security feature.

The correct course of action is to fix the problem, not work around it by disabling security features.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Thu Jun 22, 2017 5:25 pm    Post subject: Reply with quote

the hint to turn off the option was also made with install a gcc that could support it because the user have a 4x gcc series, and i recommand the switching to gcc 5x over turning off the option.

out of the two options, you create a 3rd: use a gcc 5 and turn the option off.
sorry, that's a bad 3rd option.
Back to top
View user's profile Send private message
Tzvi
n00b
n00b


Joined: 22 Jun 2017
Posts: 3

PostPosted: Thu Jun 22, 2017 5:51 pm    Post subject: Reply with quote

Thank you all for explaining it to me, I feel better about Gentoo knowing that there is an awesome community like this.

I will attempt to create the kernel with all the necessary security.
Back to top
View user's profile Send private message
sevilla.larry
n00b
n00b


Joined: 09 Nov 2015
Posts: 25

PostPosted: Mon Jun 04, 2018 2:50 am    Post subject: Reply with quote

genkernel all

Got the same error:
Code:
*Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler


gcc-config -l
Code:
[1] i686-pc-linux-gnu-6.4.0 *


emerge sys-devl/gcc -pv
Code:

[ebuild R ] sys-devl/gcc-6.4.0-r1:6.4.0::gentoo USE="cxx fortran nls nptl openmp pch (pie) sanitize ssp vtv (-altivec) (-awt) -cilk -debu -doc (-fixed-point) (-gcj) -go -graphite (-hardened) (-jlt) (-libssp) -mpx (-multilib) -objc -objc++ -objc-gc-pgo -regression-test -vanilla" 74,387 KiB
Back to top
View user's profile Send private message
acmondor
n00b
n00b


Joined: 08 Aug 2014
Posts: 35
Location: Canadian Prairies

PostPosted: Tue Jun 05, 2018 4:19 pm    Post subject: Reply with quote

I encountered this same problem with "genkernel all" yesterday. I normally don't use genkernel, but I was having trouble getting a manually build kernel to boot as a qemu guest so I thought I'd give it a try. This is on brand new install using the lastest stage3 with gcc 6.4.0. The odd thing is that version of gcc most definitely supports -fstack-protector. I confirmed that by compiling as simple hello world program with that option. I also eventually abandoned genkernel and returned to my manually configured kernel, which I did manage to get working, and it does use CONFIG_CC_STACKPROTECTOR_REGULAR. So, it does seem like there is something not quite right with the way genkernel is doing things.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1014

PostPosted: Sun Aug 05, 2018 5:05 am    Post subject: Reply with quote

I would find it difficult to believe the problem is with anything other than user systems being misconfigured when running the tool.

Neddy, I think the reason advising about changing kernel configuration option seems incorrect is because that is the purpose of the tool in the first place to not have to configure the kernel :P

Also developers of this kind of automated tool that does the work for the user cannot account for every feature, and setting that woud be present andcould possibly go crazy attempting that. If the genkernel doesn't build the kernel on the system, it is either time to upgrade the system, reinstall the system, or else learn to manually configure and build the kernel without the need for genkernel.

Those seem like viable options. I don't know what genkernel can do that is so great anyway, anyone???
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Aug 05, 2018 2:59 pm    Post subject: Reply with quote

LIsLinuxIsSogood wrote:
Those seem like viable options. I don't know what genkernel can do that is so great anyway, anyone???

LIsLinuxIsSogood ... it increases the number of posts on the forum tenfold, and so doubleplusgood.

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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