!100 fix: L0 GN compilation problem

Merge pull request !100 from zhushengle/SIG
This commit is contained in:
openharmony_ci 2021-04-29 16:37:19 +08:00 committed by Gitee
commit 0a65cfb651
5 changed files with 19 additions and 3 deletions

View File

@ -29,12 +29,11 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#define _GNU_SOURCE 1
#include "ff.h" #include "ff.h"
#if FF_USE_EXPAND
#define _GNU_SOURCE
#endif
#include "fatfs.h" #include "fatfs.h"
#include "errno.h" #include "errno.h"
#include "stdbool.h"
#include "limits.h" #include "limits.h"
#include "pthread.h" #include "pthread.h"
#include "time.h" #include "time.h"

View File

@ -19,6 +19,7 @@ extern "C" {
#define __NEED_mbstate_t #define __NEED_mbstate_t
#if __STDC_VERSION__ < 201112L #if __STDC_VERSION__ < 201112L
#define __NEED_off_t
#define __NEED_struct__IO_FILE #define __NEED_struct__IO_FILE
#endif #endif

View File

@ -490,6 +490,16 @@ LITE_OS_SEC_TEXT_INIT VOID HalExcHandleEntry(UINT32 excType, UINT32 faultAddr, U
HalSysExit(); HalSysExit();
} }
/* stack protector */
WEAK UINT32 __stack_chk_guard = 0xd00a0dff;
WEAK VOID __stack_chk_fail(VOID)
{
/* __builtin_return_address is a builtin function, building in gcc */
LOS_Panic("stack-protector: Kernel stack is corrupted in: %p\n",
__builtin_return_address(0));
}
/* **************************************************************************** /* ****************************************************************************
Function : HalHwiInit Function : HalHwiInit
Description : initialization of the hardware interrupt Description : initialization of the hardware interrupt

View File

@ -62,6 +62,11 @@ typedef VOID (*HWI_PROC_FUNC)(VOID *parm);
typedef VOID (*HWI_PROC_FUNC)(void); typedef VOID (*HWI_PROC_FUNC)(void);
#endif #endif
/* stack protector */
extern UINT32 __stack_chk_guard;
extern VOID __stack_chk_fail(VOID);
UINT32 HalIsIntActive(VOID); UINT32 HalIsIntActive(VOID);
#define OS_INT_ACTIVE (HalIsIntActive()) #define OS_INT_ACTIVE (HalIsIntActive())
#define OS_INT_INACTIVE (!(OS_INT_ACTIVE)) #define OS_INT_INACTIVE (!(OS_INT_ACTIVE))

View File

@ -31,6 +31,7 @@ static_library("utils") {
sources = [ sources = [
"los_debug.c", "los_debug.c",
"los_error.c", "los_error.c",
"los_hook.c",
] ]
include_dirs = [ include_dirs = [