-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8326587: Separate out Microsoft toolchain linking #17987
Conversation
👋 Welcome back ihse! A progress list of the required criteria for merging this PR into |
Webrevs
|
Is it really a good idea to split makefiles based on target platform? It creates a less flexible separation that makes experimentation with different combinations of toolchains and platforms much harder. We currently have a pretty well established mapping between target platform and toolchain type in practice, while trying to keep the concepts somewhat separated, but this kind of change really cements that mapping. Given Julian's ambition for making it possible to compile for Windows using a different toolchain, I'm not sure this is the right way to go. |
53c12cd
to
1ec6478
Compare
1ec6478
to
2750080
Compare
I have verified that there is no differences in the resulting output using COMPARE_BUILD, for the platforms in Oracle's CI: windows-x64,linux-x64,linux-aarch64,macosx-x64,macosx-aarch64, confirming that this is a pure build system refactoring. |
Ok, fair enough, I should have phrase this split as "Microsoft toolchain" and "everything else". The point is that linking is vastly different on Windows than on other platforms. Our efforts to force "lib" to behave as "ar" etc was far-fetched to begin with. And to fully support static libraries, we need to separate the static linking into several steps, running ld, objcopy and then finally ar There is no correspondence to of this at all with the Microsoft toolchain, and trying to shoehorn this in is just going to make matters worse. I'll rename the split according to toolchain and not platform. (And then I think this will actually help Julian, since we'll push the microsoft strangeness away in a separate file.) Sounds OK to you then? |
That sounds good to me, thanks! |
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.
I think this looks good. There looks to be a conflict with #17986, but I assume you are aware.
Thanks! Though I do first need to rebase on top of it and fix all the merge conflicts first... Just a comment: Why not reuse the AR variable for lib rather than introduce an entirely new LIB variable? The logic treating lib.exe as ar is gone with this change, but that doesn't mean they have to be split into entirely different variables. LinkMicrosoft could just run $($1_AR) without treating it as ar. This saves one autoconf and Makefile variable |
The reason will become more apparent as I progress towards proper handling of static libs. In short, AR is not by far a 1-to-1 mapping with LIB. On non-Microsoft toolchains, we are basically going to do static linking by ld + objcopy + ar; on Windows, it's just lib. So there is nothing to be gained by pretending that lib is ar. |
/integrate |
@magicus This pull request has not yet been marked as ready for integration. |
That last second save is nothing short of impressive haha |
@magicus 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 7 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 3780ad3.
Your commit was automatically rebased without conflicts. |
There is not much overlap on how linking is done on Windows on one hand, and on all Unix platforms on the other. This makes Link.gmk basically consists of two parts, each in it own half of if statements, and the few common parts are artificially shoehorned in to fit both sides.
The code will be much clearer if we just split this into two different files.
Note that this PR slightly collides with JDK-8326583 (#17986). Whichever of this goes in first will mean that the other one needs to make some adaptations.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17987/head:pull/17987
$ git checkout pull/17987
Update a local copy of the PR:
$ git checkout pull/17987
$ git pull https://git.openjdk.org/jdk.git pull/17987/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17987
View PR using the GUI difftool:
$ git pr show -t 17987
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17987.diff
Webrev
Link to Webrev Comment