From 98f21e694a6b0964d6d08196cb6bfbc1c2ae2ff4 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 5 Jul 2024 00:02:53 +0300 Subject: fix some small build issues + Compiling for size emits memcpy() calls after they've already been removed by LTO, so add __used attribute to counteract this. Newer versions of GCC seem to prefer `-flto=auto` to just `-flto`, so use that. printf format %d -> %ld --- include/kmi/attrs.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/kmi/attrs.h b/include/kmi/attrs.h index 5c15201..f789310 100644 --- a/include/kmi/attrs.h +++ b/include/kmi/attrs.h @@ -59,6 +59,10 @@ /** Weak linkage. */ #define __weak __attribute__((weak)) +/** Tell optimizer something is used, even though it might not seem like it. + * Special functions like memcpy() may need it. */ +#define __used __attribute__((used)) + /** Main entry point of kernel proper. */ #define __main __section(".kernel.start") __noinline -- cgit v1.3