Skip to content

Fixes for MinGW cross compilation on Linux to generate Windows binaries (Part 2) #1501

Open
Nightwalker-87 wants to merge 29 commits into
testingfrom
fix/win_binaries
Open

Fixes for MinGW cross compilation on Linux to generate Windows binaries (Part 2) #1501
Nightwalker-87 wants to merge 29 commits into
testingfrom
fix/win_binaries

Conversation

@Nightwalker-87

@Nightwalker-87 Nightwalker-87 commented Jul 10, 2026

Copy link
Copy Markdown
Member

This is a subsequent PR to #1497.

(Closes #1472) (Closes #1478) (Closes #1497)

Nightwalker-87 and others added 25 commits July 4, 2026 15:52
- Further code improvements in Findlibusb.cmake
Note: POSIX-Sockets conflict betweewn WIN32 and UNIX in remote.c
- Further code improvements in Findlibusb.cmake
Note: POSIX-Sockets conflict betweewn WIN32 and UNIX in remote.c
- Updated and activated CI-Test for MinGW cross compiling
- Fixes in win32_socket
- Included cmake Threads-Module
- Moved <getopt.h> include in st-server.c  (temporary)
Signed-off-by: James Walmsley <james@fullfat-fs.co.uk>
Signed-off-by: James Walmsley <james@fullfat-fs.co.uk>
Signed-off-by: James Walmsley <james@fullfat-fs.co.uk>
…n_binaries

# Conflicts:
#	src/st-server/server.c
#	src/st-util/semihosting.c
 - Restore whitequark's copyright notice to gdb-server.c/gdb-remote.c
 - update notice in st-server

Signed-off-by: James Walmsley <james@fullfat-fs.co.uk>
- Unified header declaration scheme
- Corrected cmake parametres
- Clean-up for cmake file structure
- Clarified naming for Windows compile script
- Unified header declaration scheme
- Corrected cmake parametres
- Clean-up for cmake file structure
- Clarified naming for Windows compile script
@Nightwalker-87

Nightwalker-87 commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@jameswalmsley: Technically it doesn't look too bad though...
There are a few redefined functions for the Windows compilation that pop up now (after some minor changes).
Unix compilation remains smoothly with working stlink command line tools.
Here is another paste: https://pastebin.com/ECEwEQs6

If there are no further issues, I'd suggest to merge this PR first, without closing the linked issues and continue with a third PR. Otherwise it will become very difficult to review the changes.

- Restructured dependency checks for cmake
- Corrected pkg name in compiling instructions
- Moved backend documentation to /doc
- Moved general header includes to header files where they belong (no changes to includes)
- st-trace: #defines and typedefs go to header file
- Centralise win32_socket.h include in CMakeLists.txt and leave it to cmake. This should not be done individually in the source or header files, as it is dependent on the build target.
- Commented sections in unistd.h (temporary)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment