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
10
arm-gen.c
10
arm-gen.c
@ -1401,12 +1401,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
|||||||
#ifdef __arm__
|
#ifdef __arm__
|
||||||
void *sp;
|
void *sp;
|
||||||
|
|
||||||
asm("sub sp, sp, %1\n"
|
__asm__("sub sp, sp, %1\n"
|
||||||
"\tmov %0, sp"
|
"\tmov %0, sp"
|
||||||
: "=r" (sp)
|
: "=r" (sp)
|
||||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||||
memcpy(sp, var, cnt * sizeof(char *));
|
memcpy(sp, var, cnt * sizeof(char *));
|
||||||
asm("mov pc, %0" : : "r" (prog_main));
|
__asm__("mov pc, %0" : : "r" (prog_main));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
arm64-gen.c
10
arm64-gen.c
@ -1176,12 +1176,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
|||||||
#else
|
#else
|
||||||
void *sp;
|
void *sp;
|
||||||
|
|
||||||
asm("sub sp, sp, %1\n"
|
__asm__("sub sp, sp, %1\n"
|
||||||
"\tmov %0, sp"
|
"\tmov %0, sp"
|
||||||
: "=r" (sp)
|
: "=r" (sp)
|
||||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||||
memcpy(sp, var, cnt * sizeof(char *));
|
memcpy(sp, var, cnt * sizeof(char *));
|
||||||
asm("br %0" : : "r" (prog_main));
|
__asm__("br %0" : : "r" (prog_main));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
10
i386-gen.c
10
i386-gen.c
@ -512,12 +512,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
|||||||
#else
|
#else
|
||||||
void *sp;
|
void *sp;
|
||||||
|
|
||||||
asm("sub %1, %%esp\n"
|
__asm("sub %1, %%esp\n"
|
||||||
"\tmov %%esp, %0"
|
"\tmov %%esp, %0"
|
||||||
: "=r" (sp)
|
: "=r" (sp)
|
||||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||||
memcpy(sp, var, cnt * sizeof(char *));
|
memcpy(sp, var, cnt * sizeof(char *));
|
||||||
asm("jmp *%0" : : "r" (prog_main));
|
__asm__("jmp *%0" : : "r" (prog_main));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@ -774,12 +774,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
|||||||
#ifdef __riscv
|
#ifdef __riscv
|
||||||
void *sp;
|
void *sp;
|
||||||
|
|
||||||
asm("sub sp, sp, %1\n"
|
__asm__("sub sp, sp, %1\n"
|
||||||
"\tmv %0, sp"
|
"\tmv %0, sp"
|
||||||
: "=r" (sp)
|
: "=r" (sp)
|
||||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||||
memcpy(sp, var, cnt * sizeof(char *));
|
memcpy(sp, var, cnt * sizeof(char *));
|
||||||
asm("jalr %0" : : "r" (prog_main));
|
__asm__("jalr %0" : : "r" (prog_main));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
tccrun.c
2
tccrun.c
@ -258,7 +258,7 @@ LIBTCCAPI int tcc_run(TCCState *s1, int argc, char **argv)
|
|||||||
if (envp)
|
if (envp)
|
||||||
while (*e++)
|
while (*e++)
|
||||||
n++;
|
n++;
|
||||||
p = tcc_malloc((argc + n + 2) * sizeof(char **));
|
p = tcc_malloc((argc + n + 2) * sizeof(char *));
|
||||||
p[0] = (char *) (size_t) argc;
|
p[0] = (char *) (size_t) argc;
|
||||||
memcpy(p + 1, argv, argc * sizeof(char *));
|
memcpy(p + 1, argv, argc * sizeof(char *));
|
||||||
p[argc + 1] = NULL;
|
p[argc + 1] = NULL;
|
||||||
|
|||||||
10
x86_64-gen.c
10
x86_64-gen.c
@ -1443,12 +1443,12 @@ void tcc_run_start(int (*prog_main)(int, char **, char **), int cnt, char **var)
|
|||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
void *sp;
|
void *sp;
|
||||||
|
|
||||||
asm("subq %1, %%rsp\n"
|
__asm__("subq %1, %%rsp\n"
|
||||||
"\tmovq %%rsp, %0"
|
"\tmovq %%rsp, %0"
|
||||||
: "=r" (sp)
|
: "=r" (sp)
|
||||||
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
: "r" ((((size_t) cnt + 1) & -2) * sizeof(char *)));
|
||||||
memcpy(sp, var, cnt * sizeof(char *));
|
memcpy(sp, var, cnt * sizeof(char *));
|
||||||
asm("jmp *%0" : : "r" (prog_main));
|
__asm__("jmp *%0" : : "r" (prog_main));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user