Skip to content

Can't cross-compile with external libcrypt #14284

Closed
@orlitzky

Description

@orlitzky

Description

At https://bugs.gentoo.org/931884 we have a bug report that boils down to the external libcrypt (./configure --with-external-libcrypt) checks running e.g.

  AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
    AC_RUN_IFELSE([AC_LANG_SOURCE([[
      ...                                                                          
    ]])
    ],[
      ac_cv_crypt_ext_des=yes
    ],[
      ac_cv_crypt_ext_des=no
    ],[
      ac_cv_crypt_ext_des=no
    ])
  ])

where the last case is executed for cross-compiles and forces the feature to undetected (which, in this case, is fatal). We have a few options to work around this within Gentoo, but I thought it was worth asking about upstream approach more generally. AC_RUN_IFELSE is used in a few places, and I think it would be better if the cross-compile branch were kept consistent to whatever extent that's possible.

For another example, take ext/iconv/config.m4:

AC_MSG_CHECKING([if iconv supports errno])
AC_RUN_IFELSE(...
[
  AC_MSG_RESULT(yes, cross-compiling)
])

Or ext/pcre/config0.m4:

AC_CACHE_CHECK([for JIT support in PCRE2], ac_cv_have_pcre2_jit, [
  AC_RUN_IFELSE(...
  [
    AC_CANONICAL_HOST
    case $host_cpu in
      arm*|i[[34567]]86|x86_64|mips*|powerpc*|sparc)
        ac_cv_have_pcre2_jit=yes
        ;;
      *)
	ac_cv_have_pcre2_jit=no
        ;;
    esac
  ])

This is important to me because I'm planning on making --with-external-gd the default soon, and I myself am guilty of writing a test that disables certain formats when cross-compiling because they cannot be detected with AC_RUN_IFELSE. This bug report has given me second thoughts about doing that.

ping @remicollet

PHP Version

git HEAD

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions