This is an automated email from the ASF dual-hosted git repository.

jiuzhudong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 2ec1bff4e3c lib_stackchk.c: a duplicate implementation error reported 
during compilation
2ec1bff4e3c is described below

commit 2ec1bff4e3cfacb0d3c6d2018e2c09d32090728a
Author: hujun5 <[email protected]>
AuthorDate: Fri Sep 19 11:00:22 2025 +0800

    lib_stackchk.c: a duplicate implementation error reported during compilation
    
    Mark __stack_chk_guard and __stack_chk_fail as weak symbols to prevent 
linker
    conflicts when multiple definitions of these stack protection symbols exist
    across different compilation units.
    
    Signed-off-by: hujun5 <[email protected]>
---
 libs/libc/assert/lib_stackchk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libs/libc/assert/lib_stackchk.c b/libs/libc/assert/lib_stackchk.c
index e9e5ebedcc9..b07a242ac64 100644
--- a/libs/libc/assert/lib_stackchk.c
+++ b/libs/libc/assert/lib_stackchk.c
@@ -30,7 +30,7 @@
  * Public Data
  ****************************************************************************/
 
-FAR const void *const __stack_chk_guard = &__stack_chk_guard;
+weak_data FAR const void *const __stack_chk_guard = &__stack_chk_guard;
 
 /****************************************************************************
  * Public Functions
@@ -52,7 +52,7 @@ FAR const void *const __stack_chk_guard = &__stack_chk_guard;
  *
  ****************************************************************************/
 
-void __stack_chk_fail(void)
+void weak_function __stack_chk_fail(void)
 {
   PANIC();
 }

Reply via email to