mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-17 15:44:18 +08:00
Change asm into __asm__ in previous commit
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
This commit is contained in:
parent
c52b96cf85
commit
3e8f1da9c5
@ -1401,12 +1401,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
||||
#ifdef __arm__
|
||||
void *sp;
|
||||
|
||||
asm("sub sp, sp, %1\n"
|
||||
__asm__("sub sp, sp, %1\n"
|
||||
"\tmov %0, sp"
|
||||
: "=r" (sp)
|
||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||
memcpy(sp, var, cnt * sizeof(char *));
|
||||
asm("mov pc, %0" : : "r" (prog_main));
|
||||
__asm__("mov pc, %0" : : "r" (prog_main));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -1176,12 +1176,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
||||
#else
|
||||
void *sp;
|
||||
|
||||
asm("sub sp, sp, %1\n"
|
||||
__asm__("sub sp, sp, %1\n"
|
||||
"\tmov %0, sp"
|
||||
: "=r" (sp)
|
||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||
memcpy(sp, var, cnt * sizeof(char *));
|
||||
asm("br %0" : : "r" (prog_main));
|
||||
__asm__("br %0" : : "r" (prog_main));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -512,12 +512,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
||||
#else
|
||||
void *sp;
|
||||
|
||||
asm("sub %1, %%esp\n"
|
||||
__asm("sub %1, %%esp\n"
|
||||
"\tmov %%esp, %0"
|
||||
: "=r" (sp)
|
||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||
memcpy(sp, var, cnt * sizeof(char *));
|
||||
asm("jmp *%0" : : "r" (prog_main));
|
||||
__asm__("jmp *%0" : : "r" (prog_main));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -774,12 +774,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
||||
#ifdef __riscv
|
||||
void *sp;
|
||||
|
||||
asm("sub sp, sp, %1\n"
|
||||
__asm__("sub sp, sp, %1\n"
|
||||
"\tmv %0, sp"
|
||||
: "=r" (sp)
|
||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||
memcpy(sp, var, cnt * sizeof(char *));
|
||||
asm("jalr %0" : : "r" (prog_main));
|
||||
__asm__("jalr %0" : : "r" (prog_main));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
2
tccrun.c
2
tccrun.c
@ -258,7 +258,7 @@ LIBTCCAPI int tcc_run(TCCState *s1, int argc, char **argv)
|
||||
if (envp)
|
||||
while (*e++)
|
||||
n++;
|
||||
p = tcc_malloc((argc + n + 2) * sizeof(char **));
|
||||
p = tcc_malloc((argc + n + 2) * sizeof(char *));
|
||||
p[0] = (char *) (size_t) argc;
|
||||
memcpy(p + 1, argv, argc * sizeof(char *));
|
||||
p[argc + 1] = NULL;
|
||||
|
||||
@ -1443,12 +1443,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
||||
#ifdef __x86_64__
|
||||
void *sp;
|
||||
|
||||
asm("subq %1, %%rsp\n"
|
||||
__asm__("subq %1, %%rsp\n"
|
||||
"\tmovq %%rsp, %0"
|
||||
: "=r" (sp)
|
||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||
memcpy(sp, var, cnt * sizeof(char *));
|
||||
asm("jmp *%0" : : "r" (prog_main));
|
||||
__asm__("jmp *%0" : : "r" (prog_main));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user