fix: L0 GN compilation problem

Close: #I3ORHS
Change-Id: Ia105084336f2ba66f91546226a9383646a0148ce
This commit is contained in:
zhushengle 2021-04-29 10:38:54 +08:00
parent 1f725147f3
commit 2f9bfcc6ee
5 changed files with 19 additions and 3 deletions

View File

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

View File

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

View File

@ -490,6 +490,16 @@ LITE_OS_SEC_TEXT_INIT VOID HalExcHandleEntry(UINT32 excType, UINT32 faultAddr, U
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
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);
#endif
/* stack protector */
extern UINT32 __stack_chk_guard;
extern VOID __stack_chk_fail(VOID);
UINT32 HalIsIntActive(VOID);
#define OS_INT_ACTIVE (HalIsIntActive())
#define OS_INT_INACTIVE (!(OS_INT_ACTIVE))

View File

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