-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8323672: Suppress unwanted autoconf added flags in CC and CXX #17401
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 jwaters! A progress list of the required criteria for merging this PR into |
|
@TheShermanTanker The following label 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 list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
I'm kind of on the fence for this one. On one hand filtering out stuff is really hacky, but so is setting internal undocumented variables. We have done some meddling with internal variable in a few places before, but I'd really like to keep that to a minumum. I'm not sure this is an improvement. I'd like to get input from other build folks on this. |
Co-authored-by: Magnus Ihse Bursie <mag@icus.se>
I was holding off for Magnus' opinion here. Both solutions are bad, but we are also trying to work around a pretty bad behavior in autoconf that has met quite a bit of opposition from what I've read. I don't see a clear winner, so I'm leaning towards sticking with the solution that is already integrated for now. If we see more related problems crop up we can re-evaluate then. |
|
I was thinking earlier this morning if I could roll a custom AC_PROG_CC for the JDK, since it could solve the issues that the current AC_PROG_CC and AC_PROG_CXX (including the addition of flags that we don't want). This way we could avoid hacks and messing with autoconf internals related to the problems that AC_PROG_CC presents (such as the one present here). Any thoughts on this? |
|
The current use of AC_PROG_CC does not fit very well with out needs. It does a lot of testing that is not needed for us (and at least on Windows, this considerably slows down configure). So it would make sense to replace it with something that only does what we need. I have thought of this before, even without the context of this bug. However, I have not pushed in this direction yet, partly because of lack of time, but also partly since I was afraid (well-grounded or not) that this was doing a lot of "autoconf black magic" that is needed elsewhere. But if you can take the time to analyze and understand what the vanilla AC_PROG_CC macro actually does, and extract just the parts that are relevant for us, and argue convincingly that the parts we're leaving out is not going to affect us, then I think it would be good. The more I've worked with autoconf, the less happy I've become with all its magic stuff, unchangable premises and bad fit for our use case. |
|
Out of curiosity: What exactly does AC_PROG_CC do that we need? I've begun writing a modified version of it, and I'm shocked with how much can be completely stripped away from the new version, and am unsure if I'm eliminating parts of it that we actually need |
|
What fun, I just found out that omitting the call to AC_PROG_CC and AC_PROG_CXX has no effect, and they're still called magically from somewhere by autoconf even if you don't call them. I'm genuinely at a loss for words :) |
|
Then it sounds like this is not a viable approach. Also, check your inbox for a personal invitation to The "wtf-autoconf-rly?" Club. ;-) |
There's definitely gotta be a way to make autoconf do what we want that's out there, I'll work on it and post any findings back here. I've just found out that the implicit calls to AC_PROG_CC are due to AC_PROG_CPP calling AC_REQUIRE on AC_PROG_CC for instance
I think I'm already a long time member of that club by this point... |
While I think we're stuck with make for the long run, a long-term goal for me has been (and still is) to replace autoconf with a system written in Java. Fortunately, we have a well defined interface: The user runs |
That sounds like a huge potential improvement, at least to me. I've also just come across JEP-138 (Fascinating cache of JDK history within that JEP! Never knew the JDK used to only work with make), so it's interesting to see if autoconf can be phased out after its introduction 9 years ago. If I understand you correctly, this new hypothetical system would replace autoconf as such? configure -> autoconf -> compiled configure -> make |
If I'm to guess, I think this is caused by AC_PROG_* being defined as AC_DEFUN_ONCE and every other autoconf macro that uses compilers for checks will implicitly call AC_PROG_* first if it hasn't been called yet. My understanding of these implicit calls is to make a more declarative programming style possible. |
It's not so much the AC_DEFUN_ONCE, but actually due to other autoconf macros calling AC_REQUIRE([AC_PROG_CC]) and AC_REQUIRE([AC_PROG_CXX]), for instance our calls to AC_PROG_CPP and AC_PROG_CXXCPP will cause AC_PROG_CC and AC_PROG_CXX respectively to be implicitly called |
|
I found out that the issue of having AC_PROG_CC and AC_PROG_CXX being called by AC_REQUIRE can be solved by directly overwriting them in util.m4, rather than providing our own UTIL_PROG_CC and so on. Unsure how satisfactory this is, but I have here a stripped down version of both that omits: For AC_PROG_CC
For AC_PROG_CXX
Notably, I left the check that checks if the compiler accepts -g in there, as I was unsure if we need it or not. I also tried removing the check for the object file extension, but apparently autoconf needs that to function properly. The exe file extension check is misleadingly named, because in actuality all of AC_PROG_CC and AC_PROG_CXX's functionality is in it,and it's also likely required for autoconf to work properly |
|
@TheShermanTanker I think this is essentially done. All that needs are the testing. Can you do it or do you want help with it? |
I'm able to do so myself, I've just been busy with university so far. I've only tested 2.71 and 2.72 though, 2.69 and 2.70 might still need testing. I'm still unhappy that I can't properly undefine the macros, as a side tangent |
|
@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@TheShermanTanker This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
|
/open |
|
@TheShermanTanker This pull request is now open |
|
@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
Keep it for a while more, bot. I'll try to some testing of this on 2.69 and 2.70 if Julian is unable to. |
|
@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@TheShermanTanker This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
|
/open |
|
@TheShermanTanker This pull request is now open |
|
Ok. I have now tested this patch with autoconf 2.69 and 2.70, and afaict it works just fine. So this is finally ready to integrate. @TheShermanTanker Will you have the honors? |
|
Sorry for essentially having you do the testing on my behalf. I'm still very unhappy that I have to overwrite an AC_DEFUN function like this, but there doesn't seem to be any other way. I'll fix the conflicts first though |
|
/integrate |
|
@TheShermanTanker Pushed as commit 5eae20f. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
JDK-8323008 reports unwanted autoconf flags being added to the command line, and solves the issue by filtering out the added flags by force. This is not optimal however, as doing so leaves the autoconf message that the flags were added still displaying during the configure process, which is confusing. Instead, setting a couple of fields to disable the autoconf internals responsible for the unwanted flag is a cleaner solution
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17401/head:pull/17401$ git checkout pull/17401Update a local copy of the PR:
$ git checkout pull/17401$ git pull https://git.openjdk.org/jdk.git pull/17401/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17401View PR using the GUI difftool:
$ git pr show -t 17401Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17401.diff
Webrev
Link to Webrev Comment