gh-148294: Make configure find g++ correctly#148298
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
I think this PR do not impact on Python users. The renson shows in PR description. |
|
@aisk Thanks for add the skip news label. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Can anyone take look this PR, thanks. |
|
I had already found this issue in the past and I have fixed it into my sources because it makes the cross compilation impossible to do. My binaries need to be built with the cross compiler, not with the system GCC. which is what I expected to get. |
Thanks for sharing this real-world cross-compilation example — that’s very helpful. I agree this isn’t only about cleaning up the configure message. With the incorrect AC_PATH_TOOL invocation, the fourth argument is treated as the search path, so prefixed tools like x86_64-w64-mingw32-g++ are not found correctly and cross builds can fail or fall back to the wrong compiler. |
|
@sendaoYan I'm not sure why pushing the blurb seems to have changed authorship on your commit causing the CLA failure, but would you mind to fix it? Either by adding the address that the message mentions to your CLA by clicking the button again, or by rewriting your commit to use the correct author address. |
|
Thanks @sendaoYan for the PR, and @zware for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @sendaoYan for the PR, and @zware for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @sendaoYan for the PR, and @zware for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
Sorry, @sendaoYan and @zware, I could not cleanly backport this to |
|
GH-150211 is a backport of this pull request to the 3.14 branch. |
|
GH-150212 is a backport of this pull request to the 3.15 branch. |
|
Thanks @zware for the approved and the merged. |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
The buildbot failure looks almost certainly unrelated. Since the 3.13 backport didn't take automatically, I'll decline to backport it that far. I did a bit of archaeology, and it turns out that this check has been wrong since it was added just over 20 years ago, in spite of several changes to the relevant lines in that span. Thanks for the patch! |
Hi all,
There is a bug in configure.ac when try to find the c++ compiler. The AC_PATH_TOOL autoconf macro usage should be like below:
Before this PR, AC_PATH_TOOL was invoked with duplicated prog-to-check-for parameter, this will cause the forth parameter
[notfound]treated as g++ search path. So configure shell script can not find the g++ through search pathnotfound.This PR fix the bug in configure.ac. and re-generate configure through autoconf 2.72.
After this PR, the configure log snippet shows below:
This PR do not change the hehavior with native compile. This PR only avoid the annoying configure warning. Before this PR configure select g++ as c++ compiler, after this PR configure select /usr/bin/g++ as the c++ compiler. g++ and /usr/bing++ is the same binary actually on my machine.
Fixes incorrect AC_PATH_TOOL usage when detecting the default C++ compiler. A duplicated program argument caused the fallback value (notfound) to be passed as the search path, so prefixed tools were not resolved from $PATH.
On native builds this mainly affects configure messaging (g++ vs /usr/bin/g++). On cross-compilation builds (for example, x86_64-w64-mingw32-g++ in a Cygwin/MinGW setup, as reported by @carlo-bramini), it can prevent configure from selecting the correct cross compiler.
AC_PATH_TOOLinconfigure.acfor finding compilers #148294