mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Fix breakages in Linux-only build modes
- compile.com now polyfills -march=native which gcc/clang removed - Guarantee zero Windows code is linked into non-Windows binaries - MODE=tinylinux binaries are now back to being as tiny as ~4kb - Improve the runtime's stack allocation / alignment hack - GitHub Actions now tests Linux modes for assurance
This commit is contained in:
parent
0e4c828a8e
commit
3dc86ce154
32 changed files with 283 additions and 104 deletions
6
third_party/python/Python/errors.c
vendored
6
third_party/python/Python/errors.c
vendored
|
@ -4,6 +4,7 @@
|
|||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/nt/enum/formatmessageflags.h"
|
||||
|
@ -11,6 +12,7 @@
|
|||
#include "libc/nt/memory.h"
|
||||
#include "libc/nt/process.h"
|
||||
#include "libc/nt/runtime.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/dictobject.h"
|
||||
|
@ -589,6 +591,10 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilenameObjects(
|
|||
PyObject *message;
|
||||
PyObject *args, *v;
|
||||
uint32_t err = (uint32_t)ierr;
|
||||
if (!IsWindows()) {
|
||||
PyErr_SetString(PyExc_SystemError, "this is not windows");
|
||||
return 0;
|
||||
}
|
||||
if (err==0) err = GetLastError();
|
||||
len = FormatMessage(
|
||||
/* Error API error */
|
||||
|
|
5
third_party/python/Python/sysmodule.c
vendored
5
third_party/python/Python/sysmodule.c
vendored
|
@ -1032,6 +1032,11 @@ sys_getwindowsversion(PyObject *self)
|
|||
void *verblock;
|
||||
uint32_t verblock_size;
|
||||
|
||||
if (!IsWindows()) {
|
||||
PyErr_SetString(PyExc_SystemError, "this is not windows");
|
||||
return 0;
|
||||
}
|
||||
|
||||
ver.dwOSVersionInfoSize = sizeof(ver);
|
||||
if (!GetVersionEx(&ver))
|
||||
return PyErr_SetFromWindowsErr(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue