Background: We have acquired a software product that builds to a 32-bit Windows application in Visual Studio. We wish to port this application to 64-bit.
A mission-critical component of this code is a black-box static library (.a file) originally built using gFortran by a third party. The original developer has since passed away, and the Fortran source we were able to get was incomplete and not the version this library was built off of (and contains critical bugs not present in the compiled library). They did not use a VCS.
Problem: I would like to create a 64-bit static library whose code is functionally equivalent to the 32-bit static library we have.
What I've Tried:
- Using the Snowman decompiler to get C++ source code to recompile in 64-bit. This proved impossible because the code that was generated uses low-level intrinsic functions that appear to be gcc-specific. It likely wouldn't work anyway because such intrinsics would compile to code that isn't functionally equivalent in 64-bit. I'd likely need a better decompiler.
- Apparently x86 assembly is valid x86_64 assembly, so I looked briefly into why I couldn't just run the assembly through a 64-bit assembler. Turns out the ABI is different in 64-bit, so the calling convention won't match. MAYBE I could manually convert the function calls to the proper convention and leave the rest the same, but that might be an intractable problem. Opinions?
__zero_stack_offset()
, then that would be a reasonable question. You'd need to post example disassembly output that showed the use of this intrinsic in context, but then someone could either tell you what the precise equivalent is, or explain what this intrinsic means so that a workaround could be found. That would be sufficiently scoped for SO. But that probably won't help you very much in the way of actually solving this problem. You can't do it one-question-at-a-time. "Hire a programmer" to convert it was popular advice. – Crary