Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bsp/abstract-machine/include/extra.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#ifndef __RTTHREAD_AM_EXTRA_H__
#define __RTTHREAD_AM_EXTRA_H__

#ifdef __ISA_NATIVE__
/* glibc uses __timeval_defined, while RT-Thread checks this guard. */
#define _TIMEVAL_DEFINED

Comment on lines +5 to +7

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是严谨的

/* Use the host libc definitions when AM runs as a native process. */
#include <sys/types.h>
#else
typedef long suseconds_t;
typedef unsigned long useconds_t;
#include <sys/types.h>
#endif

#ifdef __ISA_NATIVE__
// rename posix API to avoid conflict with glibc in native
Expand Down Expand Up @@ -36,3 +47,5 @@ typedef unsigned long useconds_t;
#define gettimeofday rt_gettimeofday

#endif

#endif /* __RTTHREAD_AM_EXTRA_H__ */
2 changes: 2 additions & 0 deletions bsp/abstract-machine/integrate-am-apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
am_app_mk_fp = open(f"build/{ARCH}/am-apps.mk", "w")
am_app_c_fp = open("build/am-apps.c" , "w")
lib_sym = [
# Linker-reserved symbol; do not namespace it with the application prefix.
"_GLOBAL_OFFSET_TABLE_",
"memset", "memcpy", "memmove", "memcmp",
"strlen", "strcat", "strcpy", "strncpy", "strcmp", "strncmp",
"srand", "rand", "malloc", "free", "abs", "atoi",
Expand Down