Skip to content

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

Merged
Nightwalker-87 merged 30 commits into
testingfrom
fix/win_binaries
Jul 13, 2026
Merged

Fixes for MinGW cross compilation on Linux to generate Windows binaries (Part 2) #1501
Nightwalker-87 merged 30 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.

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)
@Nightwalker-87

Copy link
Copy Markdown
Member Author

I’ll wait here as I know reviewing takes the time it needs.

@jameswalmsley jameswalmsley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to approve this so you can land it, and we have a base for the next PRs.

Comment thread cmake/modules/Findlibusb.cmake Outdated
Comment thread cmake/modules/Findlibusb.cmake Outdated
Comment thread cmake/modules/Findlibusb.cmake Outdated
- Removed duplicated win32_socket.h includes
- Improved Windows-specific cmake config
- Corrected comments in Findlibusb.cmake
@Nightwalker-87
Nightwalker-87 merged commit 8bef995 into testing Jul 13, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in Release v1.8.1 Jul 13, 2026
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Jul 13, 2026
@Nightwalker-87
Nightwalker-87 deleted the fix/win_binaries branch July 13, 2026 19:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.