how can I add cflags to use debian/rules

Asked by lyl

how can I add cflags to use debian/rules to build disco or other release kernel

such as add the gcc's flag "-fno-stack-protected" to avoid the error of stack-protected

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Ubuntu disco is not supported any more, see https://wiki.ubuntu.com/Releases
(the same for eoan)

and by the way, as far as I know the flag is named "-fno-stack-protector", not "-fno-stack-protected"

Revision history for this message
lyl (liyl) said :
#2

yeah ,I want to add the flag "-fno-stack-protector" because the gcc reports that "xxxx _stack_guards"

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

(un)-setting stack protection is done in the kernel config, see e.g. https://github.com/torvalds/linux/blob/master/arch/Kconfig#L484

Revision history for this message
lyl (liyl) said :
#4

an errors about kernel/traps.c 328 undefined reference to `__stack_chk_guard`

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#5

Are you sure that your approach makes sense?
stack-protection is a security feature to detect stack corruption (e.g. caused by buffer overflow).
Why do you want to turn it off?

Revision history for this message
lyl (liyl) said :
#6

Thanks Manfred Hampl, that solved my question.