• [gentoo-dev] [PATCH] toolchain-funcs.eclass: Set CHOST within econf_bui

    From James Le Cuirot@21:1/5 to All on Tue Dec 6 10:10:01 2022
    We were setting CBUILD within econf_build but not CHOST. crossdev's /usr/share/config.site relies on both of these to decide whether to load configure overrides needed when cross-compiling. Using the wrong
    overrides leads to packages such as Python failing.

    Doing this also avoids the need to duplicate the --build and --host
    configure arguments.

    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/toolchain-funcs.eclass | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index a184887ad3b9..61a29d1b6ea6 100644
    --- a/eclass/toolchain-funcs.eclass
    +++ b/eclass/toolchain-funcs.eclass
    @@ -442,7 +442,8 @@ tc-env_build() {
    # @CODE
    econf_build() {
    local CBUILD=${CBUILD:-${CHOST}}
    - tc-env_build econf --build=${CBUILD} --host=${CBUILD} "$@"
    + econf_env() { CHOST=${CBUILD} econf "$@"; }
    + tc-env_build econf_env "$@"
    }

    # @FUNCTION: tc-ld-is-gold
    --
    2.38.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Tue Dec 6 11:20:01 2022
    On 6 Dec 2022, at 09:03, James Le Cuirot <chewi@gentoo.org> wrote:

    We were setting CBUILD within econf_build but not CHOST. crossdev's /usr/share/config.site relies on both of these to decide whether to load configure overrides needed when cross-compiling. Using the wrong
    overrides leads to packages such as Python failing.

    Doing this also avoids the need to duplicate the --build and --host
    configure arguments.

    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/toolchain-funcs.eclass | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index a184887ad3b9..61a29d1b6ea6 100644
    --- a/eclass/toolchain-funcs.eclass
    +++ b/eclass/toolchain-funcs.eclass
    @@ -442,7 +442,8 @@ tc-env_build() {
    # @CODE
    econf_build() {
    local CBUILD=${CBUILD:-${CHOST}}
    - tc-env_build econf --build=${CBUILD} --host=${CBUILD} "$@"
    + econf_env() { CHOST=${CBUILD} econf "$@"; }
    + tc-env_build econf_env "$@"
    }

    # @FUNCTION: tc-ld-is-gold
    --

    Lgtm provided you've tested it in the relevant envs (which I'm sure you have).

    Curious how this didn't come up as a problem before, but it
    seems fine!

    Thanks!

    Best,
    sam

    -----BEGIN PGP SIGNATURE-----

    iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY48Vml8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kCOvAQDZsEmsHiGriIaItpEux1jRhkrQf5CusO2fT9iz6dz26wD+PQkABp6bkEti FnlIje66MedWgvPgSyxxsRC48rCLcQ4=
    =MbiH
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Le Cuirot@21:1/5 to Sam James on Tue Dec 6 22:50:01 2022
    On Tue, 2022-12-06 at 10:12 +0000, Sam James wrote:

    On 6 Dec 2022, at 09:03, James Le Cuirot <chewi@gentoo.org> wrote:

    We were setting CBUILD within econf_build but not CHOST. crossdev's /usr/share/config.site relies on both of these to decide whether to load configure overrides needed when cross-compiling. Using the wrong
    overrides leads to packages such as Python failing.

    Doing this also avoids the need to duplicate the --build and --host configure arguments.

    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/toolchain-funcs.eclass | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index a184887ad3b9..61a29d1b6ea6 100644
    --- a/eclass/toolchain-funcs.eclass
    +++ b/eclass/toolchain-funcs.eclass
    @@ -442,7 +442,8 @@ tc-env_build() {
    # @CODE
    econf_build() {
    local CBUILD=${CBUILD:-${CHOST}}
    - tc-env_build econf --build=${CBUILD} --host=${CBUILD} "$@"
    + econf_env() { CHOST=${CBUILD} econf "$@"; }
    + tc-env_build econf_env "$@"
    }

    # @FUNCTION: tc-ld-is-gold
    --

    Lgtm provided you've tested it in the relevant envs (which I'm sure you have).

    Curious how this didn't come up as a problem before, but it
    seems fine!

    econf_build is not widely used, and you only added it to Python in June. It's been used in other packages for much longer, but Python explicitly checks that the size of a long is what it expects. I didn't see it with m68k because we don't have any overrides for that. You also might not see it going from amd64 to arm64 either with them both being 64-bit. The lack of m68k overrides makes me wonder if some of these are even needed any more. ac_cv_sizeof_* can seemingly be determined when cross-compiling now.

    Since we've already had some reports of success, I'm merging this now.

    -----BEGIN PGP SIGNATURE-----

    iQJFBAABCAAvFiEEPxcZ3tkwcedKm2a8EiZBXQDdMTcFAmOPuFQRHGNoZXdpQGdl bnRvby5vcmcACgkQEiZBXQDdMTfe6g/+M2/npbXL5l1J+MuUEwJSd0fYrEKen1A0 mAnU1LKcbYNcYXfQlFzC9Cuq6BfXyCsW3ZxtTGyEhISh8VaPTNQg2/hymeqRwSTg db5DxXUSSi+V0EJLH26WWOJoEkI1t02PT04nUM2GynxLYZ8zTwdlVqk8xTFnzTO9 uK8ED82EWFT68FXC4NvC/Xc1IyyAlNwus6RKCLoD5Ndt8e5ipTcScVJuVVUvFScX 4h3XmLRCSDhxhPvZ+pBJeGPDrGujcYSuTVY6RKToxSW+ZDr+82/jjEfTDYIlXBuU XrZbdNp78jDfcgumP3ZzMrt/Tk38CZU+0VykKDooIGwnxWxTHm+q7WrLxu4T7Ms0 pXTUqdY6FXLeOgps2ykVwPJ7w/8TGoR9K0N3jowFDhJ9KmMJUjBGwGSAAAAm5wKG ll3CR/dC2Yrr2SCafcVYj0KCjnIzSDwyfESKAR9CX16b2MI+DZZCvfJuO6Fs/2KT 8ITGFVAre3uT5AyQ7bGwzDMovqZRd18RWSwpqkMmUpPOasKFQZMXGU2ul2pkp0zA 38qcBy955nZ0s2cS5SzhewnWgu+6VTv7dolsGSHjIq2OLoLVaBVk2NWS1jBrMuz+ oK4sIX3Z+oOfFoQR0XG0vDey/MdPzgYtiQmbpiJhjcOCIkLUb0vb0GZx3/yRKS5/
    rH5jtSkHe8w=
    =V2CE
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Wed Dec 7 14:30:02 2022
    On 6 Dec 2022, at 21:47, James Le Cuirot <chewi@gentoo.org> wrote:

    On Tue, 2022-12-06 at 10:12 +0000, Sam James wrote:
    [snip]
    Lgtm provided you've tested it in the relevant envs (which I'm sure you have).

    Curious how this didn't come up as a problem before, but it
    seems fine!

    econf_build is not widely used, and you only added it to Python in June. It's been used in other packages for much longer, but Python explicitly checks that
    the size of a long is what it expects. I didn't see it with m68k because we don't have any overrides for that. You also might not see it going from amd64 to arm64 either with them both being 64-bit. The lack of m68k overrides makes me wonder if some of these are even needed any more. ac_cv_sizeof_* can seemingly be determined when cross-compiling now.

    Since we've already had some reports of success, I'm merging this now.

    Thank you for explaining! That makes sense now.

    -----BEGIN PGP SIGNATURE-----

    iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY5CUWV8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kFwGAQCAe4ZoIgM9jtiqJ4ujR2q+bKiODqu7QWG/94Hsxjn6aQEA00kdK3QFChgN TkHqoKTrDi/kkIS0rVXKwTqffUSHSQY=
    =PLa3
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)