Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 724ed8f4 authored by Channagoud Kadabi's avatar Channagoud Kadabi
Browse files

include: Disable compile time boundary check



Newer version of gcc keeps the calls to __write_overflow which is only a
compile time check. __write_overflow is implemented as error function
and as a result all the string functions fail with the overflow error.
Work around the gcc issue by defining the overflow functions as no-op.

Change-Id: I41c2bb6d35c1a308c1a4e9c1d484ad6ad2bf7d3f
Signed-off-by: default avatarChannagoud Kadabi <ckadabi@codeaurora.org>
parent 4e7334e5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -224,6 +224,14 @@ config ARCH_HAS_FORTIFY_SOURCE
	  An architecture should select this when it can successfully
	  build and run with CONFIG_FORTIFY_SOURCE.

config FORTIFY_COMPILE_CHECK
	depends on ARCH_HAS_FORTIFY_SOURCE
	bool
	help
	  Disable compile time size check for string routines as part
	  of fortify source. Selecting this option will not enforce compile
	  time size check for string functions.

# Select if arch init_task initializer is different to init/init_task.c
config ARCH_INIT_TASK
       bool
+7 −0
Original line number Diff line number Diff line
@@ -173,9 +173,16 @@ static inline const char *kbasename(const char *path)
#define __RENAME(x) __asm__(#x)

void fortify_panic(const char *name) __noreturn __cold;

#ifdef CONFIG_FORTIFY_COMPILE_CHECK
void __read_overflow(void) __compiletime_error("detected read beyond size of object passed as 1st parameter");
void __read_overflow2(void) __compiletime_error("detected read beyond size of object passed as 2nd parameter");
void __write_overflow(void) __compiletime_error("detected write beyond size of object passed as 1st parameter");
#else
#define __read_overflow(void) do { } while (0)
#define __read_overflow2(void) do { } while (0)
#define __write_overflow(void) do { } while (0)
#endif

#if !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE)
__FORTIFY_INLINE char *strncpy(char *p, const char *q, __kernel_size_t size)