Skip to content

64 bit proxy DLL for fat MSVC builds of MPIR#19

Open
wjblanke wants to merge 4 commits into
BrianGladman:masterfrom
Chia-Network:master
Open

64 bit proxy DLL for fat MSVC builds of MPIR#19
wjblanke wants to merge 4 commits into
BrianGladman:masterfrom
Chia-Network:master

Conversation

@wjblanke

Copy link
Copy Markdown

This solution generates a stub proxy DLL for the MPIR library. When applications link to MPIR, they will call this stub proxy DLL instead. The stub proxy DLL analyzes the CPU model it is running on, and then uses LoadLibrary to load the appropriate optimized version of MPIR.dll. It patches all of the MPIR function entrypoints and JMPs to the appropriate function in the optimized version of MPIR.

The basis for the 64 bit stub DLL was automatically generated from the 64 bit GC version of MPIR.dll using the tool below:

https://www.codeproject.com/Articles/1179147/ProxiFy-Automatic-Proxy-DLL-Generation

@SanderBouwhuis

Copy link
Copy Markdown

Oh wow! That's a pretty good idea!
Does it work? It states that 'All checks have failed'. Or is that pertaining something else?

@wjblanke

Copy link
Copy Markdown
Author

It's a completely separate solution/project so I don't think it is included in the current MPIR build checks.

Yes it works :-). Enjoy!

@BrianGladman

Copy link
Copy Markdown
Owner

Thank you for offering this contribution, which I believe that many users of MPIR on WIndows will appreciate. But it is not clear to me whether it makes sense to integrate it into the MPIR Windows build or whether it is preferable to maintain it as a self standing addition. In particular, if it is to be integrated, it will be necessary to identify a designated and active maintainer of this component of the build as I am not in a position to take on this additional workload.

@justinengland
justinengland deleted the branch BrianGladman:master May 26, 2021 20:36
@justinengland
justinengland deleted the master branch May 26, 2021 20:36
@GitMensch

Copy link
Copy Markdown

rechecked:

  • this would be indeed very useful for many windows users
  • it should be integrated in this repo, because it depends on all we have here
  • it can (and should) be integrated into the CI and testing, once it is integrated [I volunteer for handling the CI; the old setup is broken, but if my work of today is merged will be fine and extended again]
  • code-wise I'd suggest to have the code staying in "msvc" directly and then add the solution to all vc directories (at least vs2019+vs2022, but I guess this code would also work with vs2013, no?)

@BrianGladman

Copy link
Copy Markdown
Owner

rechecked:

  • this would be indeed very useful for many windows users
  • it should be integrated in this repo, because it depends on all we have here
  • it can (and should) be integrated into the CI and testing, once it is integrated [I volunteer for handling the CI; the old setup is broken, but if my work of today is merged will be fine and extended again]
  • code-wise I'd suggest to have the code staying in "msvc" directly and then add the solution to all vc directories (at least vs2019+vs2022, but I guess this code would also work with vs2013, no?)

Hi Simon, It would be a useful addition to this repository but I would need a volunteer to integrate it into the repository and then maintain it .

Quite a bit of work would be involved as my current build assumes and builds only one specified version of MPIR whereas the proposed addition would need to build each of a number of versions and then package them with the stub library to produce the multi-architecture binary. This is a significant development exercise even though the basic approach has been shown to work.

I don't believe the original proposer was willing to take on this task so the proposal was not pursued further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants