Repository navigation
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
27fe00d to
e618b6b
Compare
4163f40 to
cf2f23b
Compare
- fix `find` commands to not miss items. - call `file` on the built files in `curl -V` steps. To give more feedback on what was built. - add `curl info` step for cross-jobs that can't do a `curl -V`. It lists the files built and calls `file` on them. - appveyor: make a VS2010 32-bit to match the VS2008 job it replaced. Follow-up to d34aeec #15934 - GHA/windows: drop the word "old" from standalone mingw-w64 jobs to not conflate it with "old mingw" we no longer support (while also keeping it short). Cherry-picked from #15975 Closes #16001
c5f56be to
56e28ae
Compare
Does vcpkg support Windows CE via mingw32ce? |
|
vcpkg support mingw in community. I can try to see if it works with that mingw. |
Sounds good to me! This is a rather niche mingw (based on the old-mingw Another interesting challenge would be making a WinCE build with either There is also the "revived" mingw32ce, but it needs to be built from source Also, actually running any of these builds under an emulator would be interesting, |
|
@vszakats why you run wince under macos? can you try on linux? |
Pre-built CeGCC binaries are available for macOS and Windows. Of these, the to unixy macOS runner is faster and easier to work Linux would be nicer but this isn't officially packaged, external |
These are the binaries I was working with, and what's used in CI. |
Follow-up to e49797a curl#16022 Follow-up to 2a292c3 curl#15975 Cherry-picked from curl#16394
|
Forgot to mention it publicly: With Maybe there is a better solution; I didn't explore this rabbit hole in depth. |
Follow-up to e49797a curl#16022 Follow-up to 2a292c3 curl#15975 Cherry-picked from curl#16394 Closes curl#16455
As long ssize_t has a size of signed size_t type (int I'd assume in this case) I don't see a problem |
Yes, it should be the case. Which made me think this is possibly a GCC bug and not worth addressing. Maybe there is a |
|
test: #16492 (comment) |
|
This patch seems to work to fix (=silence) it: e6359ca The next question is why does autotools want to detect C11 and C99 in these builds, and not in others: vs. a normal mingw builds: |
`./configure` mingw32ce builds enable C99 mode automatically, that triggers compiler warnings in gcc 4.4.0. We initially worked it around in CI by suppressing the detection of C99 with `ac_cv_prog_cc_c99=no`. Replace it with automatically silencing the bogus warnings in C99 mode, for all build systems: ``` lib/ftp.c: In function 'Curl_GetFTPResponse': lib/ftp.c:726: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t' lib/ws.c: In function 'ws_dec_pass_payload': lib/ws.c:304: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/ws.c: In function 'ws_enc_write_head': lib/ws.c:581: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' lib/vtls/schannel.c: In function 'schannel_connect_step1': lib/vtls/schannel.c:1122: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/vtls/schannel.c: In function 'schannel_connect_step2': lib/vtls/schannel.c:1311: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/vtls/schannel.c: In function 'schannel_send': lib/vtls/schannel.c:1793: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/vtls/schannel.c:1810: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/vtls/schannel.c: In function 'schannel_shutdown': lib/vtls/schannel.c:2286: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t' lib/vtls/vtls.c: In function 'ssl_cf_recv': lib/vtls/vtls.c:1422: error: format '%zd' expects type 'signed size_t', but argument 5 has type 'ssize_t' ``` Ref: https://github.com/curl/curl/actions/runs/13533841306/job/37821720902?pr=16492#step:9:20 Also: simplify Windows CE job configuration in GHA/windows. Follow-up to 2a292c3 #15975 Closes #16492
…allouts
- GHA/windows/WinCE:
- set `-O3 -DNDEBUG` C flags manually for the CMake mingw32ce build.
CMake doesn't recognize the platform and fails to add them. To match
autotools (using `-O2`), and hit similar compiler warnings.
- enable parallel builds for cmake.
- tune parallelism for cmake using unity batches.
- tune parallelism for autotools.
Follow-up to 2a292c3 #15975
- tests: fix potentially uninitialized value in `readline()` in
`getpart.c`. Detected by gcc 4.4.0 `-O2` (Windows CE) jobs:
```
tests/server/getpart.c: In function 'getpart':
tests/server/getpart.c:298: error: 'datalen' may be used uninitialized in this function
```
Ref: https://github.com/curl/curl/actions/runs/13522595237/job/37785147505?pr=16476#step:11:25
Follow-up to 592880a
- vtls_scache: rework returning pointer to avoid compiler warning seen
with `-O3` gcc 4.4.0 builds (Windows CE/schannel):
```
lib/vtls/schannel.c: In function 'schannel_connect_step1':
lib/vtls/vtls_scache.c:975: error: dereferencing pointer 'old_cred.4474' does break strict-aliasing rules
lib/vtls/vtls_scache.c:985: error: dereferencing pointer 'old_cred.4474' does break strict-aliasing rules
lib/vtls/schannel.c:959: note: initialized from here
```
Ref: https://github.com/curl/curl/actions/runs/13523868335/job/37789610845#step:9:25
Follow-up to fa0ccd9 #15774
Closes #16476
- fix `find` commands to not miss items. - call `file` on the built files in `curl -V` steps. To give more feedback on what was built. - add `curl info` step for cross-jobs that can't do a `curl -V`. It lists the files built and calls `file` on them. - appveyor: make a VS2010 32-bit to match the VS2008 job it replaced. Follow-up to d34aeec curl#15934 - GHA/windows: drop the word "old" from standalone mingw-w64 jobs to not conflate it with "old mingw" we no longer support (while also keeping it short). Cherry-picked from curl#15975 Closes curl#16001
They were more or less the same, but each missed some things the other had. Windows CE is a subset of Win32, make the headers reflect that and avoid duplications. Ref: curl#15975 Closes curl#16038
- silence false positive picky warnings. - avoid "possible noreturn" warnings for standalone tests and examples. - fix to compile without `#pragma GCC diagnostic push` support. - fix "#pragma GCC diagnostic not allowed inside functions". Prerequisite for curl#15975 that needs GCC 4.4 for the latest pre-built CeGCC/mingw32ce toolchain for Windows CE. Cherry-picked from curl#15975 Closes curl#16062
Make it possible to build curl for Windows CE using the CeGCC toolchain. With both CMake and autotools, including tests and examples, also in CI. The build configuration is the default one with Schannel enabled. No 3rd-party dependencies have been tested. Also revive old code to make Schannel build with Windows CE, including certificate verification. Builds have been throughougly tested. But, I've made no functional tests for this PR. Some parts (esp. file operations, like truncate and seek) are stubbed out and likely broken as a result. Test servers build, but they do not work on Windows CE. This patch substitutes `fstat()` calls with `stat()`, which operate on filenames, not file handles. This may or may not work and/or may not be secure. About CeGCC: I used the latest available macOS binary build v0.59.1 r1397 from 2009, in native `mingw32ce` build mode. CeGCC is in effect MinGW + GCC 4.4.0 + old/classic-mingw Windows headers. It targets Windows CE v3.0 according to its `_WIN32_WCE` value. It means this PR restores portions of old/classic-mingw support. It makes the Windows CE codepath compatible with GCC 4.4.0. It also adds workaround for CMake, which cannot identify and configure this toolchain out of the box. Notes: - CMake doesn't recognize CeGCC/mingw32ce, necessitating tricks as seen with Amiga and MS-DOS. - CMake doesn't set `MINGW` for mingw32ce. Set it and `MINGW32CE` manually as a helper variable, in addition to `WINCE` which CMake sets based on `CMAKE_SYSTEM_NAME`. - CMake fails to create an implib for `libcurl.dll`, due to not recognizing the platform as a Windowsy one. This patch adds the necessary workaround to make it work. - headers shipping with CeGCC miss some things curl needs for Schannel support. Fixed by restoring and renovating code previously deleted old-mingw code. - it's sometime non-trivial to figure out if a fallout is WinCE, mingw32ce, old-mingw, or GCC version-specific. - WinCE is always Unicode. With exceptions: no `wmain`, `GetProcAddress()`. - `_fileno()` is said to convert from `FILE *` to `void *` which is a Win32 file `HANDLE`. (This patch doesn't use this, but with further effort it probably could be.) https://stackoverflow.com/questions/3989545/how-do-i-get-the-file-handle-from-the-fopen-file-structure - WinCE has no signals, current directory, stdio/CRT file handles, no `_get_osfhandle()`, no `errno`, no `errno.h`. Some of this stuff is standard C89, yet missing from this platform. Microsoft expects Windows CE apps to use Win32 file API and `FILE *` exclusively. - revived CeGCC here (not tested for this PR): https://building.enlyze.com/posts/a-new-windows-ce-x86-compiler-in-2024/ On `UNDER_CE` vs. `_WIN32_WCE`: (This patch settled on `UNDER_CE`) - A custom VS2008 WinCE toolchain does not set any of these. The compiler binaries don't contain these strings, and has no compiler option for targeting WinCE, hinting that a vanilla toolchain isn't setting any of them either. - `UNDER_CE` is automatically defined by the CeGCC compiler. https://cegcc.sourceforge.net/docs/details.html - `UNDER_CE` is similar to `_WIN32`, except it's not set automatically by all compilers. It's not supposed to have any value, like a version. (Though e.g. OpenSSL sets it to a version) - `_WIN32_WCE` is the CE counterpart of the non-CE `_WIN32_WINNT` macro. That does return the targeted Windows CE version. - `_WIN32_WCE` is not defined by compilers, and relies on a header setting it to a default, or the build to set it to the desired target version. This is also how `_WIN32_WINNT` works. - `_WIN32_WCE` default is set by `windef.h` in CeGCC. - `_WIN32_WCE` isn't set to a default by MSVC Windows CE headers (the ones I checked at least). - CMake sets `_WIN32_WCE=<ver>`, `UNDER_CE`, `WINCE` for MSVC WinCE. - `_WIN32_WCE` seems more popular in other projects, including CeGCC itself. `zlib` is a notable exception amongst curl dependencies, which uses `UNDER_CE`. - Since `_WIN32_WCE` needs "certain" headers to have it defined, it's undefined depending on headers included beforehand. - `curl/curl.h` re-uses `_WIN32_WCE`'s as a self-guard, relying on its not-(necessarily)-defined-by-default property: https://github.com/curl/curl/blob/25b445e4796bcbf9f842de686a8c384b30f6c2a2/include/curl/curl.h#L77 Toolchain downloads: - Windows: https://downloads.sourceforge.net/cegcc/cegcc/0.59.1/cegcc_mingw32ce_cygwin1.7_r1399.tar.bz2 - macOS Intel: https://downloads.sourceforge.net/cegcc/cegcc/0.59.1/cegcc_mingw32ce_snowleopard_r1397.tar.bz2 Closes curl#15975
Follow-up to e49797a curl#16022 Follow-up to 2a292c3 curl#15975 Cherry-picked from curl#16394 Closes curl#16455
`./configure` mingw32ce builds enable C99 mode automatically, that triggers compiler warnings in gcc 4.4.0. We initially worked it around in CI by suppressing the detection of C99 with `ac_cv_prog_cc_c99=no`. Replace it with automatically silencing the bogus warnings in C99 mode, for all build systems: ``` lib/ftp.c: In function 'Curl_GetFTPResponse': lib/ftp.c:726: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t' lib/ws.c: In function 'ws_dec_pass_payload': lib/ws.c:304: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/ws.c: In function 'ws_enc_write_head': lib/ws.c:581: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' lib/vtls/schannel.c: In function 'schannel_connect_step1': lib/vtls/schannel.c:1122: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/vtls/schannel.c: In function 'schannel_connect_step2': lib/vtls/schannel.c:1311: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/vtls/schannel.c: In function 'schannel_send': lib/vtls/schannel.c:1793: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/vtls/schannel.c:1810: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t' lib/vtls/schannel.c: In function 'schannel_shutdown': lib/vtls/schannel.c:2286: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t' lib/vtls/vtls.c: In function 'ssl_cf_recv': lib/vtls/vtls.c:1422: error: format '%zd' expects type 'signed size_t', but argument 5 has type 'ssize_t' ``` Ref: https://github.com/curl/curl/actions/runs/13533841306/job/37821720902?pr=16492#step:9:20 Also: simplify Windows CE job configuration in GHA/windows. Follow-up to 2a292c3 curl#15975 Closes curl#16492
…allouts
- GHA/windows/WinCE:
- set `-O3 -DNDEBUG` C flags manually for the CMake mingw32ce build.
CMake doesn't recognize the platform and fails to add them. To match
autotools (using `-O2`), and hit similar compiler warnings.
- enable parallel builds for cmake.
- tune parallelism for cmake using unity batches.
- tune parallelism for autotools.
Follow-up to 2a292c3 curl#15975
- tests: fix potentially uninitialized value in `readline()` in
`getpart.c`. Detected by gcc 4.4.0 `-O2` (Windows CE) jobs:
```
tests/server/getpart.c: In function 'getpart':
tests/server/getpart.c:298: error: 'datalen' may be used uninitialized in this function
```
Ref: https://github.com/curl/curl/actions/runs/13522595237/job/37785147505?pr=16476#step:11:25
Follow-up to 592880a
- vtls_scache: rework returning pointer to avoid compiler warning seen
with `-O3` gcc 4.4.0 builds (Windows CE/schannel):
```
lib/vtls/schannel.c: In function 'schannel_connect_step1':
lib/vtls/vtls_scache.c:975: error: dereferencing pointer 'old_cred.4474' does break strict-aliasing rules
lib/vtls/vtls_scache.c:985: error: dereferencing pointer 'old_cred.4474' does break strict-aliasing rules
lib/vtls/schannel.c:959: note: initialized from here
```
Ref: https://github.com/curl/curl/actions/runs/13523868335/job/37789610845#step:9:25
Follow-up to fa0ccd9 curl#15774
Closes curl#16476
Make it possible to build curl for Windows CE using the CeGCC toolchain.
With both CMake and autotools, including tests and examples, also in CI.
The build configuration is the default one with Schannel enabled. No
3rd-party dependencies have been tested.
Also revive old code to make Schannel build with Windows CE, including
certificate verification.
Builds have been throughougly tested. But, I've made no functional tests
for this PR. Some parts (esp. file operations, like truncate and seek)
are stubbed out and likely broken as a result. Test servers build, but
they do not work on Windows CE. This patch substitutes
fstat()callswith
stat(), which operate on filenames, not file handles. This may ormay not work and/or may not be secure.
About CeGCC: I used the latest available macOS binary build v0.59.1
r1397 from 2009, in native
mingw32cebuild mode. CeGCC is in effectMinGW + GCC 4.4.0 + old/classic-mingw Windows headers. It targets
Windows CE v3.0 according to its
_WIN32_WCEvalue. It means this PRrestores portions of old/classic-mingw support. It makes the Windows CE
codepath compatible with GCC 4.4.0. It also adds workaround for CMake,
which cannot identify and configure this toolchain out of the box.
Notes:
with Amiga and MS-DOS.
MINGWfor mingw32ce. Set it andMINGW32CEmanually as a helper variable, in addition to
WINCEwhich CMake setsbased on
CMAKE_SYSTEM_NAME.libcurl.dll, due to notrecognizing the platform as a Windowsy one. This patch adds the
necessary workaround to make it work.
support. Fixed by restoring and renovating code previously deleted
old-mingw code.
mingw32ce, old-mingw, or GCC version-specific.
wmain,GetProcAddress()._fileno()is said to convert fromFILE *tovoid *which isa Win32 file
HANDLE. (This patch doesn't use this, but with furthereffort it probably could be.)
https://stackoverflow.com/questions/3989545/how-do-i-get-the-file-handle-from-the-fopen-file-structure
_get_osfhandle(), noerrno, noerrno.h. Some of this stuff isstandard C89, yet missing from this platform. Microsoft expects
Windows CE apps to use Win32 file API and
FILE *exclusively.https://building.enlyze.com/posts/a-new-windows-ce-x86-compiler-in-2024/
On
UNDER_CEvs._WIN32_WCE: (This patch settled onUNDER_CE)The compiler binaries don't contain these strings, and has no compiler
option for targeting WinCE, hinting that a vanilla toolchain isn't
setting any of them either.
UNDER_CEis automatically defined by the CeGCC compiler.https://cegcc.sourceforge.net/docs/details.html
UNDER_CEis similar to_WIN32, except it's not set automaticallyby all compilers. It's not supposed to have any value, like a version.
(Though e.g. OpenSSL sets it to a version)
_WIN32_WCEis the CE counterpart of the non-CE_WIN32_WINNTmacro.That does return the targeted Windows CE version.
_WIN32_WCEis not defined by compilers, and relies on a headersetting it to a default, or the build to set it to the desired target
version. This is also how
_WIN32_WINNTworks._WIN32_WCEdefault is set bywindef.hin CeGCC._WIN32_WCEisn't set to a default by MSVC Windows CE headers (theones I checked at least).
_WIN32_WCE=<ver>,UNDER_CE,WINCEfor MSVC WinCE._WIN32_WCEseems more popular in other projects, including CeGCCitself.
zlibis a notable exception amongst curl dependencies,which uses
UNDER_CE._WIN32_WCEneeds "certain" headers to have it defined, it'sundefined depending on headers included beforehand.
curl/curl.hre-uses_WIN32_WCE's as a self-guard, relying onits not-(necessarily)-defined-by-default property:
curl/include/curl/curl.h
Line 77 in 25b445e
Toolchain downloads:
https://downloads.sourceforge.net/cegcc/cegcc/0.59.1/cegcc_mingw32ce_cygwin1.7_r1399.tar.bz2
https://downloads.sourceforge.net/cegcc/cegcc/0.59.1/cegcc_mingw32ce_snowleopard_r1397.tar.bz2
w/o whitespace: https://github.com/curl/curl/pull/15975/files?w=1
HAVE_SIGNAL_H,HAVE_ERRNO_H? They are C89, yet WinCE chose not to support them.96c2990 build: delete checks for C89 standard headers #11940
fe3463e build: assume errno.h is always available #9986
SKIP, it's enough to do this once there is one more platform with such need.
get_winapi_error()from lib to re-use in tests. (replacing the copy-pasted duplicate)UNDER_CEvs._WIN32_WCE. →UNDER_CE