LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   config stackprotector flag error with make of kernel (https://www.linuxquestions.org/questions/slackware-14/config-stackprotector-flag-error-with-make-of-kernel-4175638931/)

deretsigernu 09-21-2018 07:14 PM

config stackprotector flag error with make of kernel
 
I have installed 14.2 from an install DVD on a new ASUS that has a Realtek wireless chip. The default install doesn't recognize the chip and so I have no wireless. Which means I have NO internet connection at all, because the computer doesn't have an ethernet port either (Wasn't aware that was a thing with laptops now.) I am trying to get the driver installed for Realtek 8821 and have had a problem with getting that to work because the kernel installed from the DVD is 4.4.14-smp and it needs to be >= 4.15. I am trying to build 4.18.8. I am following the instructions here.
http://docs.slackware.com/howtos:sla...kernelbuilding

I got as far as "make xconfig" and then used "make all". The results were:
Quote:

scripts/kconfig/conf --silentoldconfig Kconfig
SYSTBL arch/x86/include/generated/asm/syscalls_32.h
SYSHDR arch/x86/include/generated/asm/unistd_32_ia32.h
SYSHDR arch/x86/include/generated/asm/unistd_64_x32.
SYSTBL arch/x86/include/generated/asm/syscall_64.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_32.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_64.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_32x.h
HOSTCC scripts/basic/bin2c
HOSTCC arch/x86/tools/relocs_32.o
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
HOSTLD arch/x86/tools/relocs
CHK include/config/kernel.release
UPD include/config/kernel.release
Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
Makefile:1114: recipe for target 'prepare-compiler-check' failed
make: *** [prepare-compiler-check] Error 1
I looked up "Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler"
and found something that said it was a result of having multiple versions of gcc installed.

I have only installed what was on the install DVD. When I
Code:

gcc --version (and g++)
returns
Quote:

gcc (GCC) 5.3.0
So I don't think it's the compiler. But I don't know for sure. What else can be causing the error?

A different search for just "CONFIG_CC_STACKPROTECTOR_REGULAR" turned up this:
https://stackoverflow.com/questions/...ector#10713047

If I understand the accepted answer correctly, I don't need this on my computer in order to make the new kernel. When I looked in the kernel's Makefile for the lines with the relevant flag, on lines 693-715 or so, it says:

Code:

ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
  stackp-flag := -fstack-protector
  stackp-name := REGULAR
else
ifdef CONFIG_CC_STACKPROTECTOR_STRONG
  stackp-flag := -fstack-protector
  stackp-name := STRONG
else
  # Force off for distro compilers that enable stack protector by default.
  stackp-flag := $(call cc-option, -fno-stack-protector)
endif
endif
# Find arch-specific stack protector compiler sanity-checking script.
ifdef CONFIG_CC_STACKPROTECTOR
  stackp-path := $(srctree)/scripts/gcc-$(SRCARCH)_$(BITS)-has-stack-protector.sh
  stackp-check := $(wildcard $(stackp-path))
endif

What do I need to change to stop the CONFIG_CC_STACKPROTECTOR_ problem when I try to make the new kernel, assuming the problem is with the kernel Makefile and not something else?

fskmh 09-22-2018 04:09 AM

That version of gcc seems adequate based on this. I suppose it's possible that a newer version of gcc is required for 4.18.xx and -fstack-protector-strong but I can't find anything to corroborate that, in fact it seems that gcc 4.8 should be good enough.
If you're sure that you don't have any compiler options specified in your environment somewhere that might be causing this you could try disabling "Strong Stack Protector" (not ideal) in the "General setup" of your kernel config, make clean and then make again, or you could try an older kernel like 4.16.

55020 09-22-2018 05:19 AM

You don't need to build your own 4.18 kernel.
https://dusk.idlemoor.tk/linux-4.18/x86_64/

deretsigernu 09-22-2018 06:45 PM

@fskmh, I don't know all the settings in the config to know what could be causing the problem. They're all default.

@55020, thanks for the link. I'm not sure what to do with all those files you linked to. I always pointed and clicked at something ready to download and make. To start, I downloaded the kernel generic, kernel headers, kernel modules, and kernel source (txz for each). They are on a different computer than what this thread is written about, so I have to move them over. If I put them on a thumbdrive and extract them to a new folder in /usr/src, what do I do next? For example, do I need to make anything? What order do the files need to processed? What other steps do I need? The only thing I know about modifying the kernel is what I linked to in my first post, where I said "... following instructions here:".

bassmadrigal 09-26-2018 12:00 AM

Quote:

Originally Posted by deretsigernu (Post 5906696)
@55020, thanks for the link. I'm not sure what to do with all those files you linked to. I always pointed and clicked at something ready to download and make. To start, I downloaded the kernel generic, kernel headers, kernel modules, and kernel source (txz for each). They are on a different computer than what this thread is written about, so I have to move them over. If I put them on a thumbdrive and extract them to a new folder in /usr/src, what do I do next? For example, do I need to make anything? What order do the files need to processed? What other steps do I need? The only thing I know about modifying the kernel is what I linked to in my first post, where I said "... following instructions here:".

These are pre-compiled packages and are all ready for installation. Then you would just need to regenerate an initrd, ensure your bootloader (lilo, grub, etc) is up-to-date with the newer kernel, then reboot.

slac-in-the-box 10-02-2018 02:02 PM

Quote:

If I put them on a thumbdrive and extract them to a new folder in /usr/src, what do I do next?
As bassmadigral indicated: these packages are not source code--they are slackware packages! To install them, put your thumbdrive in... mount it to /mnt/tmp, or any mountpoint of your choice, and then use installpkg or upgradepkg... And as he also said, you might want to check out the script: /usr/share/mkinitrd/mkinitrd_command_generator.sh, which can produce the mkinitrd command for you. Update your bootloader, and good to go. I don't think it matters which order you install them, but I usually go: source, headers, generic, modules.

bassmadrigal 10-02-2018 04:41 PM

Quote:

Originally Posted by slac-in-the-box (Post 5910297)
I don't think it matters which order you install them, but I usually go: source, headers, generic, modules.

It doesn't matter unless you install both the huge and generic kernels and use the /boot/vmlinuz symlink.

The reason why is both the huge and generic kernels have a script that is run at the end of installation that will update symlinks. Both will update the /boot/vmlinuz symlink to point to its own kernel. The last one run will be the one that /boot/vmlinuz is linked against. So, if you rely on /boot/vmlinuz symlink for your bootloader, make sure the kernel you want to use is used last.

I typically recommend referencing the specific kernel rather than relying on the symlink, but that's just personal preference.


All times are GMT -5. The time now is 06:41 PM.