-
Notifications
You must be signed in to change notification settings - Fork 511
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
Fix cross-compilation on Gentoo #1920
base: master
Are you sure you want to change the base?
Conversation
Use AC_CHECK_TOOL which checks the environment variable `$AR` as well, which is useful for us in Gentoo when cross-compiling. We could use AC_PROG_AR in newer autoconf or AM_PROG_AR in automake but the AR_R use is hardcoded in a bunch of places so not worth it. Bug: https://bugs.gentoo.org/911945
Can one of the admins verify this patch? |
@thesamesam, thank you for fixing this bug and sharing your changes! I fixed PR description formatting (to comply with Squid Project requirements) and adjusted PR title/description text a bit. Please check that I did not misrepresent anything and adjust further as needed. PR title/description will become commit title/message when your changes are automatically merged into master... Please add one of the two variations of your email addresses to Squid CONTRIBUTORS file. You will find the corresponding diff showing both variations in the failed CI source-maintenance-tests log (expand "Check source-maintenance" section). I also have a question: Do you know why the following test in Gentoo build.log has failed? Should not ./configure find x86_64-pc-linux-gnu-ar binary if the tester was trying to use that binary by setting
Disclaimer: I am not a cross-compilation expert. |
Thank you for your feedback! I will address it likely tomorrow if not tonight. |
Would you be interested in doing a followup PR making that change? |
@@ -129,7 +129,7 @@ AS_IF([test "x$ac_cv_path_PERL" = "xnone"],[ | |||
AC_PATH_PROG(POD2MAN, pod2man, $FALSE) | |||
AM_CONDITIONAL(ENABLE_POD2MAN_DOC, test "x${ac_cv_path_POD2MAN}" != "x$FALSE") | |||
|
|||
AC_PATH_PROG(AR, ar, $FALSE) | |||
AC_CHECK_TOOL(AR, ar, :) |
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.
The /bin/false
alternative is there intentionally to halt early "on first use". Using :
will silently skip problems until a lot more build cycles have been wasted.
AC_CHECK_TOOL(AR, ar, :) | |
AC_CHECK_TOOL(AR, ar, $FALSE) |
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.
@thesamesam, if you commit Amos suggestion, please do not forget to adjust PR description that currently claims that we are emulating AC_PROG_AR in this fix. AC_PROG_AR does not use $FALSE. It uses :
or, effectively, "true" AFAICT:
AC_DEFUN([AC_PROG_AR],
[AC_CHECK_TOOL(AR, ar, :)])
Use AC_CHECK_TOOL that checks the environment variable
$AR
as well,which is useful when cross-compiling (e.g., on Gentoo).
Autoconf v2.72 introduces AC_PROG_AR which does the same thing, but we
do not want to require that 2023 Autoconf version at this time.
TODO: We should be using Automake's AM_PROG_AR (available since 2011
Automake v1.11.0a) instead of manually creating AR_R. AM_PROG_AR also
uses AC_CHECK_TOOLS internally but checks for more
ar
tool variations.Gentoo bug report: https://bugs.gentoo.org/911945