-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8309880: Add support for linking libffi on Windows and Mac #14446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back jvernee! A progress list of the required criteria for merging this PR into |
@JornVernee The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
/contributor add @shipilev |
@JornVernee |
/label remove hotspot-compiler |
@JornVernee |
@JornVernee |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add the instructions for building libffi for Windows in a comment in createLibffiBundle.sh? I think it would be good to keep those around now that you have figured out how to do it.
- Tab to spaces in java.base/Lib.gmk - Add comment with Windows build instructions to createLibffiBundle.sh
I've fixed the tab, and added the instructions for Windows to |
@JornVernee This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 22 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
I've also filed: https://bugs.openjdk.org/browse/JDK-8309954 as documentation of why the tests are disabled. |
/integrate |
Going to push as commit 4c18b9e.
Your commit was automatically rebased without conflicts. |
@JornVernee Pushed as commit 4c18b9e. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Update the make/autoconf/lib-ffi.m4 script to support using libffi on Windows and Mac.
For Windows I had to tweak
fallbackLinker.c
to be able to build: there was an import ofstdint.h
missing, and since it was usingWSAGetLastError
it needed to link againstws2_32.lib
.This PR also contains a fix originally made by @shipilev as part of: #13827 (with a minor tweak), in order to be able to build the fallback linker on mac correctly. I also disabled 3 tests that were failing when using the (libffi-based) fallback linker on that platform.
I've updated the
createLibffiBundle.sh
script for Mac, since I got it to work with a devkit, but I didn't manage to do the same for Windows. The steps I took to make my Windows libffi bundle were as follows:ucrt64
(this is one of the shell environments that comes with MSYS2). This should carry over the environment set up by the VS dev prompt.3.a run
autogen.sh
3.b run:
(
<install dest>
can be whatever you like. That's what you point--with-libffi
to).make install
. This should create the<intstall dest>
directory with the files:include/ffi.h
,include/ffitarget.h
,lib/libffi.dll
. It also creates alib/libffi.lib
file, but it is of the wrong file type,DLL
rather thanLIBRARY
..lib
file:5.a use
dumpbin /exports libffi.dll
to get a list of exported symbols5.b put them in a
libffi.def
file:EXPORTS
on the first line, then a symbol on each line following5.c run
lib /def:libffi.def /machine:x64 /out:libffi.lib
to create the right.lib
file (lib
is a visual studio tool)Testing:
jdk_foreign
test suite with-Djdk.internal.foreign.CABI=FALLBACK
(i.e. using the fallback linker).jdk_foreign
suiteProgress
Issue
Reviewers
Contributors
<shade@openjdk.org>
<jvernee@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14446/head:pull/14446
$ git checkout pull/14446
Update a local copy of the PR:
$ git checkout pull/14446
$ git pull https://git.openjdk.org/jdk.git pull/14446/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14446
View PR using the GUI difftool:
$ git pr show -t 14446
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14446.diff
Webrev
Link to Webrev Comment