simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Will simulavr support the Windows platform?


From: Helge Kruse
Subject: Will simulavr support the Windows platform?
Date: Sun, 25 Oct 2020 14:23:06 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.3

Hello,

The support for Windows has been dropped with simulavr 1.1.

But I would like to use the simulator on the Windows platform. I have
compiled the current version with VS2017 Community Edition. This
required some changes of the CMake output as well as at the source
files. Here are the necessary changes:

The Windows socket layer requires some changes:

- different set of include files.
- call to WSAStartup/WSACleanup
- call to _read() or recv() instead of read(), same applies to write()

The getopt module is not part of th Windows run time library and had to
be added from source.

The static constructors caused by the AVR_REGISTER macro invocation
doesn't work with the Microsoft linker. The reason is, that the linker
only uses object modules that resolve undefined symbols. As a
workaround, the simulavr currently links againts the static library
sim_static.lib and all object modules are forced to be included with
/WHOLEARCHIVE:sim_static.lib.

These changes require a change of the source code. Some "#ifdef WIN32"
can be used to make the adaption to the winsock subsystem. The getopt
module must be added or referenced by the simulavr project. Probably the
remaining changes can be done with a Windows specific CMakefile.txt.
Since CMake requires only one CMakefile.txt in a directory, the Linux
and the Windows build should get their own directories.

So, that's my idea of regaining the support for Windows of simulvar 1.x.
What do you think about it? Is it still desired to maintain a
cross-platform program? In that case I could  try to add my changes and
(honestly  current) hacks to a Git repository after improving the code
quality (remove hacks, etc.).


Best regards,
Helge





reply via email to

[Prev in Thread] Current Thread [Next in Thread]