capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.

Home Page:http://www.capstone-engine.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Has v5.0.x Dropped VS2010 Support?

Necrolis opened this issue · comments

According to https://github.com/capstone-engine/capstone/blob/next/COMPILE_MSVC.TXT

VS2010 should still be supported as a compilation target. However, compiling with it yields a slurry of compilation errors.

Steps to reproduce:

  1. Download capstone 5.0.1 from the releases page.
  2. Extract and open msvc/capstone.sln with VS2010
  3. Select Release + Win32 as the build target
  4. Compile capstone_static or cpastone_dll

Sample compilation output: output.txt
My VS2010 Version

Version 10.0.30319.1 RTMRel
Version 4.8.09037 RTMRel
Installed Version: Ultimate
Microsoft Visual C++ 2010   01019-532-2002102-70641

Is VS2010 still a supported compiler target?

Notes:

  • bumping up the platform toolset to v140_xp does allow for successful compilation, so VS2015 is still working, but I need to compile some legacy code that only targets VS2010.
  • 4.0.2 does compile under VS2010 (v100 platform toolset).

From what I recall in the VS2010 toolchain, MSVC has really poor C99 support, and the majority of the code is written using C99 rules at least. Supporting MSVC below VS2015 is unreasonable in 2024, in my opinion, just like Python 2 support.
If you need some super-legacy target, you can always use either an older capstone or try to use different compilers like clang-cl (just my opinion, which might be different from what actual maintainers think). Given the lack of maintaining hands, it's unlikely will be worth spending too much effort on that.

In Rizin, a user of the Capstone library, we limit ourselves to VS2017 as the lowest, precisely because of the sluggish Microsoft who made MSVC C99-compatible 15 years late:

I ended up just using Capstone 4.0.2 since it was compatible with my needs.

So this ticket is more about updating the minimum required build toolset for the MSVC docs (along with a hint to use 4.0.2 for older compilers).

VS2017 sounds good, but keep in mind that cuts off WinXP support (since the last available MSVC toolset with WinXP support is v140_xp, and there are still quite a few people using WinXP, at least in the circles I deal with). VS2017 does ship with v141_xp, but since v140 is compatible with 5.0.x, I'd say it'd make more sense to move to VS2015 as the minimum target, shifting up when it becomes necessary.

Though at the same time I represent an extremely small use-case/user base that uses or deals with legacy systems, so whatever is easier to maintain in the long-term given the lack of maintainers probably makes more sense.

EDIT: Updated as per these Microsoft docs.