Skip to content

Commit

Permalink
[Genio] Correct bugs which cause build failure on Genio project
Browse files Browse the repository at this point in the history
1. Due to commit project-chip#31025 adjust the pathes of src/lwip. include the correct pathes to build system.

2. Since GCC has been upgraded to v13.2, fixed some compatibility issues on Genio platform settings.
  • Loading branch information
Matter-mt793x committed Apr 30, 2024
1 parent c277524 commit 9f9354f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
52 changes: 52 additions & 0 deletions examples/platform/mt793x/link_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ int __wrap__write(int file, char * ptr, int len)
#include "task.h"
#include <sys/time.h>
#include <sys/times.h>
#include <errno.h>
#include <sys/stat.h>

int __wrap__gettimeofday(struct timeval * tv, void * ptz)
{
Expand Down Expand Up @@ -111,3 +113,53 @@ void __wrap__wlan_printf(int skip, int level, const char * fmt, ...)
}

/****************************************************************************/

extern int __io_getchar(void) __attribute__((weak));
int _read(int file, char *ptr, int len)
{
int DataIdx;

for (DataIdx = 0; DataIdx < len; DataIdx++) {
*ptr++ = __io_getchar();
}

return len;
}

int _close(int file)
{
return -1;
}

int _fstat(int file, struct stat *st)
{
st->st_mode = S_IFCHR;
return 0;
}

int _isatty(int file)
{
return 1;
}

int _lseek(int file, int ptr, int dir)
{
return 0;
}

int _open(const char *name, int flags, int mode)
{
return -1;
}

int _getpid(void)
{
errno = ENOTSUP;
return -1;
}

int _kill(int pid, int sig)
{
errno = ENOTSUP;
return -1;
}
8 changes: 5 additions & 3 deletions third_party/mt793x_sdk/mt793x_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ template("mt793x_sdk") {
}

include_dirs += [
"${lwip_root}/repo/lwip/ports/include",
"${lwip_root}/repo/lwip/src/include",
"${mt793x_sdk_build_root}/lwip/repo/lwip/ports/include",
"${mt793x_sdk_build_root}/lwip/repo/lwip/src/include",
]

defines = []
Expand All @@ -77,7 +77,9 @@ template("mt793x_sdk") {

libs = []

defines = []
defines = [
"CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE=48",
]

if (defined(invoker.defines)) {
defines += invoker.defines
Expand Down

0 comments on commit 9f9354f

Please sign in to comment.