Merge pull request #131 from outis1one/claude/zealous-heisenberg-8ylloi
fix(kyber-linux): fix ___chkstk_ms link error in cmd shim
This commit is contained in:
@@ -310,10 +310,13 @@ int WINAPI mainCRTStartup(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* pass-through to original cmd */
|
/* pass-through to original cmd */
|
||||||
WCHAR newcl[4096] = L"cmd-real.exe";
|
|
||||||
LPWSTR rest = GetCommandLineW();
|
LPWSTR rest = GetCommandLineW();
|
||||||
while (*rest && *rest != L' ') rest++;
|
while (*rest && *rest != L' ') rest++;
|
||||||
if ((lstrlenW(newcl) + lstrlenW(rest)) < 4090)
|
LPCWSTR prefix = L"cmd-real.exe";
|
||||||
|
int plen = lstrlenW(prefix), rlen = lstrlenW(rest);
|
||||||
|
LPWSTR newcl = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
|
||||||
|
(plen + rlen + 2) * sizeof(WCHAR));
|
||||||
|
lstrcpyW(newcl, prefix);
|
||||||
lstrcatW(newcl, rest);
|
lstrcatW(newcl, rest);
|
||||||
STARTUPINFOW si = {sizeof(si)};
|
STARTUPINFOW si = {sizeof(si)};
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
@@ -326,6 +329,7 @@ int WINAPI mainCRTStartup(void) {
|
|||||||
}
|
}
|
||||||
CEOF
|
CEOF
|
||||||
x86_64-w64-mingw32-gcc -O2 -ffreestanding -nostdlib \
|
x86_64-w64-mingw32-gcc -O2 -ffreestanding -nostdlib \
|
||||||
|
-mno-stack-arg-probe \
|
||||||
-e mainCRTStartup -o "$SHIM_EXE" "$SHIM_C" \
|
-e mainCRTStartup -o "$SHIM_EXE" "$SHIM_C" \
|
||||||
-lkernel32 -lshell32 \
|
-lkernel32 -lshell32 \
|
||||||
&& cp "$CMD_SHIM" "$CMD_REAL" \
|
&& cp "$CMD_SHIM" "$CMD_REAL" \
|
||||||
|
|||||||
Reference in New Issue
Block a user