Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
-fstack-protector available but compiler is broken
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
ethan_t
n00b
n00b


Joined: 01 Aug 2018
Posts: 3

PostPosted: Thu Aug 02, 2018 9:31 pm    Post subject: -fstack-protector available but compiler is broken Reply with quote

Hi there!
I am having a bit of trouble with compiling a kernel. I followed everything in the handbook except with a few more things in the kernel part.
When I run
Code:
make && make modules_install

To compile my kernel, I get the following error:
Code:
Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector available but compiler is broken

And then make terminates.

Here is what I did: I followed the AMD64 Handbook wiki page up to the point where I was supposed to merge linux sources. I then followed the wiki page (https://wiki.gentoo.org/wiki/Kernel_Deblobing) to deblob the kernel. Everything went well and I went on with the handbook. I decided to use
Code:
genkernel --menuconfig all

I changed a few options and saved my configuration. When I hit the exit button, I got an error several pages long (which I could not read). Instead of running genkernel again, I just ran make with the modified genkernel configuration. That is how I got this error.

This is my first time installing Gentoo, please be gentle. Thank you in advance.

Edit: someone on #gentoo let me know that my problem is the same with the one here: https://forums.gentoo.org/viewtopic-t-1060654.html
I will just try not to use genkernel.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1014

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

I am curious if upgrading GCC would fix this issue. But if not are you willing to try a different method (genkernel is not the last option by the way for building a kernel). Genkernel I think is more help if what you want is somehting more involved and to automate the process of creating the kernel with initramfs etc. but is that wht you want?

Here's another way to get a pretty good starting point for a better kernel for your system...

1. boot into a live gentoo operating system
2. then copy the kernel found in /proc/config.gz and place that configuraiton into the the kernel source directory /usr/src/linux for your target system,
3. run make olddefconfig
4. then do the make && make install
5. Lastly be sure to update grub or whatever bootloader you use.

Then as for what may be causing the problem with genkernel, I checked the bugs list nothing there although about 100 other bugs, and therefore the problem could be a lot of different things such as the environment or profile, or even just some missing dependency maybe. Having some outdated packages never caused my manual builds of the kernel from source to fail. So maybe you will try.

HINT: Make sure once you have a working kernel and start "tinkering" with it to crate leaner and meaner settings that you always try to keep a working version of that kernel so that you aren't stuck with few options for booting into the system.

https://www.funtoo.org/Building_a_Kernel_from_Source
http://swift.siphos.be/linux_sea/kernelbuilding.html#idm3548299350096

Then there's probably many more great articles out there about configuring and building the kernel from source. Sorry if this doesn't help, but hpoefully it isn't a bunch of nonsense and I hope that it helps!
Back to top
View user's profile Send private message
ethan_t
n00b
n00b


Joined: 01 Aug 2018
Posts: 3

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

Thanks a lot for your reply, LIsLinuxIsSogood! I should have edited the post yesterday, because I managed to compile the kernel. Not by using genkernel, though, but I manually configured it.
Many thanks for sparing your time to help me out.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

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

ethan_t,

CONFIG_CC_STACKPROTECTOR_* requires a version of gcc that understands the option.
That kernel option passes a CFLAG to gcc.

You either fix your gcc, it must be quite old, or turn off the CONFIG_CC_STACKPROTECTOR_* options in the kernel.

What does
Code:
gcc-config -l
show on your system?
_________________
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
ethan_t
n00b
n00b


Joined: 01 Aug 2018
Posts: 3

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

NeddySeagoon wrote:
ethan_t,

CONFIG_CC_STACKPROTECTOR_* requires a version of gcc that understands the option.
That kernel option passes a CFLAG to gcc.

You either fix your gcc, it must be quite old, or turn off the CONFIG_CC_STACKPROTECTOR_* options in the kernel.

What does
Code:
gcc-config -l
show on your system?

The problem no longer persists, because I re-did the installation and configured the kernel by hand. I switched to the hybrid Live DVD before re-installing the system to get EFI boot. Before switching, I might have accidentally installed the 32-bit x86 stage 3 tarball. That was probably the cause of my problem. The installation is complete and my system works fine now. Thanks for sparing your time.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1014

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

EDIT: Do not get discourage, welcome to the fun-ness of source code and do it yourself operating system with gentoo linux. It is really fast and highly efficient at providing you all the custom options, but when it doesn't work it can start to be like looking down a long rabbit hole!

For completeness, here is how that looks on my system...

Code:
jonathanr@playboy ~ $ gcc-config -l
 [1] x86_64-pc-linux-gnu-6.4.0 *
 [2] x86_64-pc-linux-gnu-7.3.0


I think the main thing here to understand and gets confused a lot sometimes even though the error code is always the sign of the problem, but it cannot always be the easiest solution when there was some "early on" miscalculations with the install which makes perfect sense.

EDIT: Unlike other distros like debian that just starts up out of the box, Gentoo does make things more difficult (on purpose...because that provides the platform for understanding the ins and outs better for the system you install).

Under this topic within the forum (Installing Gentoo) I think it will be my first guess to ask for more detaied explanation from OP about the steps taken during the install process since it would likely turn up something without the need to go into the detailed inner-workings of things without making sure they are able to correcty diagnose and troubleshoot, or at least if not immediately like in this case...Here a reinstall was probably necessary, since install was done with the wrong architecture. So that does not good to try tell him/her how to fix an issue that is going to present itself as a complete nightmare if migrating from 32-bit to 64-bit. Hence the need for more information up front in order to dish the proper answer.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

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

LIsLinuxIsSogood,

It would be interesting to see the error message but a 32 bit install on a 64 bit system just works because it is self consistent.
Its a little like owning a Ferrari and only driving to the corner shop :) but it still works.

Code:
jonathanr@playboy ~ $ gcc-config -l
 [1] x86_64-pc-linux-gnu-6.4.0 *
 [2] x86_64-pc-linux-gnu-7.3.0
You have gcc-7.3.0 installed but not selected for use.
There is nothing wrong with that. You might get a fright when you run --depclean and it removes your active gcc though.
_________________
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
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1014

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

Quote:
You have gcc-7.3.0 installed but not selected for use.


I guess the reason for that unuse is because nothing else on that installed system (for gaming and multimedia stuff mostly) has required me to first upgrade to version-7 yet. How would I proceed if what I want is add both to my favorites/world file so that both could be preserved no matter what. Until I manually remove them that is with --unmerge instead. Is that an option?

jonathanr@playboy /etc $ equery l gcc
* Searching for gcc ...
[IP-] [ ] sys-devel/gcc-6.4.0-r1:6.4.0
[IP-] [ ] sys-devel/gcc-7.3.0-r3:7.3.0


And as for --depclean I tend to not use that tool until I am in a position of absolutely having to do something that removes the software. Others may claim this causes a problem with upgrades, but I can probably attest otherwise as that never seems to be the case. More often than not what does cause problems with an outdated package that may need to be removed before continuing, so that is no different than --depclean for the atom itself, but I typically don't subscribe to the philosophy that is described in the handbook for portage which is to run --depclean after world updates. And when I do it is usually with just --pretend flag anyhow :)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

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

LIsLinuxIsSogood wrote:
How would I proceed if what I want is add both to my favorites/world file so that both could be preserved no matter what.

Add them to world, both
Eiter use --noreplace =X (where X is sys-devel/gcc:6.4.0 and sys-devel/gcc:7.3.0) or the echo x >> /var/lib/portage/world
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Aug 05, 2018 12:45 pm    Post subject: Reply with quote

LIsLinuxIsSogood,

Don't use echo There is a world of pain between > and >>.
That's what backups are for though.
_________________
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
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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