fix lunch params etc.
This commit is contained in:
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
add_subdirectory(coremark)
|
||||
add_subdirectory(tinycc-arm-thumb)
|
||||
add_subdirectory(app_test)
|
||||
add_subdirectory(test)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_BOARD_NAME})
|
||||
add_subdirectory(${CONFIG_BOARD_NAME})
|
||||
endif()
|
||||
|
||||
@@ -7,12 +7,12 @@ file(
|
||||
)
|
||||
|
||||
add_executable(
|
||||
app_test.elf
|
||||
tst.elf
|
||||
${deps}
|
||||
${START_SRC}
|
||||
)
|
||||
target_link_libraries(
|
||||
app_test.elf
|
||||
tst.elf
|
||||
PUBLIC
|
||||
-Bstatic
|
||||
${LIBC_NAME}
|
||||
@@ -26,7 +26,7 @@ target_link_libraries(
|
||||
${GCC_LIB_PATH}/libgcc.a
|
||||
)
|
||||
target_include_directories(
|
||||
app_test.elf
|
||||
tst.elf
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/mkrtos_user/lib/sys/inc
|
||||
${CMAKE_SOURCE_DIR}/mkrtos_user/lib/sys_svr/inc
|
||||
@@ -38,31 +38,31 @@ target_include_directories(
|
||||
${CMAKE_SOURCE_DIR}/mkrtos_user/user/drv/lib/mk_display
|
||||
)
|
||||
add_dependencies(
|
||||
app_test.elf
|
||||
tst.elf
|
||||
${START_LIB}
|
||||
sys
|
||||
sys_util
|
||||
)
|
||||
set_target_properties(
|
||||
app_test.elf PROPERTIES LINK_FLAGS
|
||||
tst.elf PROPERTIES LINK_FLAGS
|
||||
"-T ${CMAKE_CURRENT_LIST_DIR}/${ARCH_NAME}/link.lds ${CORTEX_M_LINK_FLAGS} --gc-section -no-dynamic-linker "
|
||||
#--no-warn-rwx-segments
|
||||
)
|
||||
add_custom_target(
|
||||
app_test_dump ALL
|
||||
tst_dump ALL
|
||||
COMMAND
|
||||
${CMAKE_OBJDUMP} -s -S app_test.elf > ${CMAKE_SOURCE_DIR}/build/output/app_test.S
|
||||
${CMAKE_OBJDUMP} -s -S tst.elf > ${CMAKE_SOURCE_DIR}/build/output/tst.S
|
||||
COMMAND
|
||||
${CMAKE_READELF} -a app_test.elf > ${CMAKE_SOURCE_DIR}/build/output/app_test.txt
|
||||
${CMAKE_READELF} -a tst.elf > ${CMAKE_SOURCE_DIR}/build/output/tst.txt
|
||||
COMMAND
|
||||
${CMAKE_OBJCOPY} -O binary -S app_test.elf app_test.bin
|
||||
${CMAKE_OBJCOPY} -O binary -S tst.elf tst.bin
|
||||
COMMAND
|
||||
${CMAKE_SIZE} app_test.elf
|
||||
${CMAKE_SIZE} tst.elf
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy app_test.bin ${CMAKE_SOURCE_DIR}/build/output/cpio/app_test
|
||||
${CMAKE_COMMAND} -E copy tst.bin ${CMAKE_SOURCE_DIR}/build/output/cpio/tst
|
||||
COMMAND
|
||||
cp app_test.elf ${CMAKE_SOURCE_DIR}/build/output/app_test.elf
|
||||
cp tst.elf ${CMAKE_SOURCE_DIR}/build/output/tst.elf
|
||||
)
|
||||
|
||||
add_dependencies(app_test_dump app_test.elf)
|
||||
add_dependencies(tst_dump tst.elf)
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
printf("%s init..\n", argv[0]);
|
||||
for (int i = 0; i < argc; i++)
|
||||
{
|
||||
printf("argv[%d]: %s\n", i, argv[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -76,6 +76,8 @@ add_custom_target(
|
||||
${CMAKE_SIZE} tcc.elf
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy tcc.bin ${CMAKE_SOURCE_DIR}/build/output/cpio/tcc
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy tcc.elf ${CMAKE_SOURCE_DIR}/build/output/tcc.elf
|
||||
|
||||
)
|
||||
if ((DEFINED CONFIG_ELF_LAUNCH) AND (CONFIG_ELF_LAUNCH STREQUAL "y"))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#define HEAP_SIZE 1024*1024*3
|
||||
#define STACK_SIZE 8192
|
||||
#define HEAP_SIZE (1024*1024*8)
|
||||
#define STACK_SIZE (8192)
|
||||
|
||||
#if defined(__CC_ARM)
|
||||
#define HEAP_ATTR SECTION("HEAP") __attribute__((zero_init))
|
||||
|
||||
@@ -255,11 +255,11 @@ char *fake_argv[] = {
|
||||
"-nostdinc",
|
||||
"-nostdlib",
|
||||
"-c",
|
||||
"/mnt/1.c",
|
||||
"/bin/1.c",
|
||||
"-o",
|
||||
"/mnt/a.out"
|
||||
};
|
||||
|
||||
//tcc -nostdinc -nostdlib -c /bin/1.c -o /mnt/a.out
|
||||
int main(int argc0, char **argv0)
|
||||
{
|
||||
TCCState *s, *s1;
|
||||
@@ -270,9 +270,13 @@ int main(int argc0, char **argv0)
|
||||
char **argv;
|
||||
FILE *ppfp = stdout;
|
||||
|
||||
for(int i=0;i<argc0;i++)
|
||||
{
|
||||
printf("%s \n", argv0[i]);
|
||||
}
|
||||
printf("\n");
|
||||
redo:
|
||||
// argc = argc0, argv = argv0;
|
||||
argc = 7, argv = fake_argv;
|
||||
argc = argc0, argv = argv0;
|
||||
s = s1 = tcc_new();
|
||||
opt = tcc_parse_args(s, &argc, &argv, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user