Giter VIP home page Giter VIP logo

Comments (10)

letmaik avatar letmaik commented on August 24, 2024 2

@jithinjosepkl You wanted to check with the compiler team. What was the result of that? In the meantime, I found the following work-around which simply stubs out the unavailable CFG check function:

cfg_stub.c:

void __guard_check_icall_fptr(unsigned long ptr) { }

Modified compile commands (see first post):

gcc -c cfg_stub.c
gfortran -o example1 example.F90 cfg_stub.o -fno-range-check -lmsmpifec -lmsmpi -L"$MSMPI_LIB64" -I$MINGW_PREFIX/include

from microsoft-mpi.

zbeekman avatar zbeekman commented on August 24, 2024 1

@jithinjosepkl

Let me connect you with the compiler team and take this offline. I believe it is the MSVCRT itself.

Please do report your findings in this thread. @letmaik is not the only one affected by this issue.

from microsoft-mpi.

jithinjosepkl avatar jithinjosepkl commented on August 24, 2024

@letmaik - Yep, this is coming from the control flow guard. We added this as part of a security requirement from one of the partner s/w. Unfortunately we cannot disable it in official releases.

Is there a similar option for gfortran? I couldn't find one with a quick search, but you might know better on that. Other option will be to build MSMPI from this repo and use it.

from microsoft-mpi.

letmaik avatar letmaik commented on August 24, 2024

Just to clarify, if control flow guard (CFG) was enabled during compilation of a static library (here MSMPI), does that mean that dependent libraries or executables have to be compiled with CFG as well? Is that why you are asking whether gfortran has a similar option?
I'm also slightly surprised that I could use gcc without issues, which either means that gcc supports CFG and has it enabled by default, or that no CFG checks were inserted into the C msmpi static library, but rather only into the Fortran ones.

from microsoft-mpi.

letmaik avatar letmaik commented on August 24, 2024

I just checked with dumpbin, indeed msmpi.lib does not have the __guard_check_icall_fptr symbol. Is this expected?
Regarding CFG in gcc/gfortran, there's no support for it as far as I see, but maybe it is enough to just link to additional system libraries (which?) from Windows to provide the unresolved symbol? That would mean the msmpi part is CFG-protected and the rest of the app is not, which would be fine in my case.

from microsoft-mpi.

jithinjosepkl avatar jithinjosepkl commented on August 24, 2024

Yeah, I also couldn't see the symbol using dumpbin. The symbol is not there in the final exe as well, but CFG shows up in the headers.

            C160 DLL characteristics
                   High Entropy Virtual Addresses
                   Dynamic base
                   NX compatible
                   Control Flow Guard

Let me check with the compiler team to see what their recommendation is for gfortran.

from microsoft-mpi.

jithinjosepkl avatar jithinjosepkl commented on August 24, 2024

@letmaik - Compiler team confirmed that this procedure is inside the VC runtime, and that explains the linker errors with non vc runtime.

from microsoft-mpi.

letmaik avatar letmaik commented on August 24, 2024

Which runtime exactly? Do you have a DLL filename? MinGW links against MSVCRT.

from microsoft-mpi.

jithinjosepkl avatar jithinjosepkl commented on August 24, 2024

Let me connect you with the compiler team and take this offline. I believe it is the MSVCRT itself.

from microsoft-mpi.

KineticTheory avatar KineticTheory commented on August 24, 2024

I am also struggling this as I try to move from MS-MPI 8 to version 10. Is the cfg_stub.c work around the only path forward?

from microsoft-mpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.