forked from Mirrors/tinycc
TCC tools don't run exec command.
parent
d5bd2531b0
commit
785af9373a
19
tcctools.c
19
tcctools.c
|
@ -481,24 +481,7 @@ static int execvp_win32(const char *prog, char **argv)
|
||||||
|
|
||||||
ST_FUNC void tcc_tool_cross(TCCState *s, char **argv, int target)
|
ST_FUNC void tcc_tool_cross(TCCState *s, char **argv, int target)
|
||||||
{
|
{
|
||||||
char program[4096];
|
tcc_error("-m%d not implemented.", target);
|
||||||
char *a0 = argv[0];
|
|
||||||
int prefix = tcc_basename(a0) - a0;
|
|
||||||
|
|
||||||
snprintf(program, sizeof program,
|
|
||||||
"%.*s%s"
|
|
||||||
#ifdef TCC_TARGET_PE
|
|
||||||
"-win32"
|
|
||||||
#endif
|
|
||||||
"-tcc"
|
|
||||||
#ifdef _WIN32
|
|
||||||
".exe"
|
|
||||||
#endif
|
|
||||||
, prefix, a0, target == 64 ? "x86_64" : "i386");
|
|
||||||
|
|
||||||
if (strcmp(a0, program))
|
|
||||||
execvp(argv[0] = program, argv);
|
|
||||||
tcc_error("could not run '%s'", program);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TCC_TARGET_I386 && TCC_TARGET_X86_64 */
|
#endif /* TCC_TARGET_I386 && TCC_TARGET_X86_64 */
|
||||||
|
|
Loading…
Reference in New Issue