toolchain: fix for building blu_spark kernel using google's aosp toolchains. addresses error: undefined symbol 'stack_chk_guard';#1
Conversation
aosp toolchains. addresses error:
undefined symbol 'stack_chk_guard';
details: this patch checks for CC_IS_AOSP_CLANG before
stackprotector. if it is, then global stack-
protector guard is used, instead of per-task
and sysreg (using a canary instead of TLS).
blu_spark KCFLAGS changes from aosp kernel
source tree in /Makefile cause final linking
of vmlinux.o to fail with per-task stack-
protector guard. this patch is designed to
resolve the error without modifying blu_spark
code.
credit: micfogas
signed-off-by: micfogas <tech@technotic.us>
|
This doesn't make much sense outside of forks, not aiming to build with exp higher clang. |
|
I'm curious about your build environment. I determined that the CFLAG '-mcpu=cortex-a55' in your Makefile is the cause of this problem on both of my build systems. Both Almalinux 10 and Ubuntu 22.04. I am aware that global vs. per_task is less secure. It was an older patch I made and yes, even 487747c has this issue. I build primarily with 19.0.1 (r536225) due to some optimizations with clang 19 over 17, particularly with CFI. I am far from an advanced kernel dev, and I've been doing it for maybe only 6 months. I started learning to build for my Pixel 6 Pro (device target raven, kernel target raviole) from forking your kernel source. I then requested the source for 250916 (qpr2 b3) and then 251205 (qpr2 release) from Google, which gave me the full Bazel/kleaf systems, though I've stuck to keeping KMI compatibility creating only Image.lz4. I provided the patch (I suppose simply omitting the problem CFLAG would be better, I'm not sure on all the optimizations that cortex-a55 adds) as a workaround without modifying your code any, including your Makefile optimizations. Do you have any insight on why that CFLAG would cause an issue with stack guard? Thanks for your time. |
details: this patch checks for CC_IS_AOSP_CLANG before
stackprotector. if it is, then global stack-
protector guard is used, instead of per-task
and sysreg (using a canary instead of TLS).
signed-off-by: micfogas tech@technotic.us