Fix Cygwin compatibility (#330)

* Make simple WASI work in Cygwin.

Issue #329

* Prevent M3_WEAK from taking effect on Cygwin.

Issue #329

* Add CI to ensure that Cygwin doesn’t regress.

Issue #329
opam-2.0.0
Felipe Gasper 2 years ago committed by GitHub
parent ce423d1861
commit 8523770b80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -154,6 +154,19 @@ jobs:
cd test
python run-wasi-test.py
cygwin-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@main
- name: Set up Cygwin
uses: egor-tensin/setup-cygwin@master
with:
platform: x64
packages: make gcc-g++ cmake
- run: cd $GITHUB_WORKSPACE && cmake -DBUILD_WASI=simple . && make
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
wasi:
runs-on: ubuntu-latest
timeout-minutes: 10

@ -33,7 +33,7 @@
#if defined(APE)
// Actually Portable Executable
// All functions are already included in cosmopolitan.h
#elif defined(__wasi__) || defined(__APPLE__) || defined(__ANDROID_API__) || defined(__OpenBSD__) || defined(__linux__) || defined(__EMSCRIPTEN__)
#elif defined(__wasi__) || defined(__APPLE__) || defined(__ANDROID_API__) || defined(__OpenBSD__) || defined(__linux__) || defined(__EMSCRIPTEN__) || defined(__CYGWIN__)
# include <unistd.h>
# include <sys/uio.h>
# if defined(__APPLE__)

@ -67,7 +67,7 @@
# define M3_WEAK //__declspec(selectany)
# define M3_NO_UBSAN
# define M3_NOINLINE
# elif defined(__MINGW32__)
# elif defined(__MINGW32__) || defined(__CYGWIN__)
# define M3_WEAK //__attribute__((selectany))
# define M3_NO_UBSAN
# define M3_NOINLINE __attribute__((noinline))

Loading…
Cancel
Save