[PATCH] D149996: [test] [ExecutionEngine] Skip the ExecutionEngine tests on mingw targets

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 01:43:53 PDT 2023


mstorsjo added a comment.

In D149996#4326183 <https://reviews.llvm.org/D149996#4326183>, @sgraenitz wrote:

> In D149996#4325838 <https://reviews.llvm.org/D149996#4325838>, @mstorsjo wrote:
>
>> Conversely, an MSVC-built lli.exe runs the test just fine even
>
> You could check what symbols this `lli.exe` exports. It might have both, `__chkstk` and `__chkstk_ms`, so that they are resolved from the host process in the MSVC case? Same would be interesting for the MinGW case. I guess it exports neither of them?

MSVC built executables don't export any symbols at all (they don't have a symbol table; they could have DLL-style exported symbols though, but this one doesn't). The MinGW built `lli.exe` does contain `___chkstk_ms` in the symbol table.

> Not sure yet what the correct solution would look like. Maybe feed one example into a static linker and see how it deals with that?

Are there any options I could inject here, to make it more verbose about what it does, to inspect the code generation vs linking cases here?

As the `-mtriple=` option didn't seem to make any difference, I also tried modifying `sys::getDefaultTargetTriple()` to return an MSVC style triple, but even then, the MinGW built `lli.exe` fails with references to the MinGW style named `___chckstk_ms` symbol. So there's something in the Orc jit linking step that always goes for the MinGW style name here. What do I do to gain insight into what's actually going on in the Orc jit linking step?

In D149996#4326193 <https://reviews.llvm.org/D149996#4326193>, @sgraenitz wrote:

> One more guess: Could this function possibly reside in a runtime library for MinGW?

The function normally does reside in a runtime library, yes, either libgcc or compiler-rt builtins. However in the MSVC case, the corresponding `__chkstk` function also is required, and is provided by a toolchain runtime library in the same way. How do I see if the linking step does resolve that symbol, and from where?

> `lli` has `--orc-runtime` but it's not in use implicitly. As far as I know, we only support MSVC. Would MinGW support be interesting? Do we have anything in place? Maybe @sunho knows more about it. Thanks!

I guess it might be interesting - but as you say, that's not happening implicitly for the MSVC case here either.

Also just to set the scope here; I'm primarily working towards having `check-llvm` (and similar for other tools) run successfully in MinGW configurations - there are holes to fill in in various components, so I can't take on full the "let's implement everything" role right now; I just want to either flag known failing cases as such, and for trivial cases (like this seems like it would be), fix it by figuring out what is differing between the MSVC and MinGW cases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149996/new/

https://reviews.llvm.org/D149996



More information about the llvm-commits mailing list